[cairo] confirming behavior of cairo_clip() with cairo_show_glyphs()

Benjamin Otte otte at redhat.com
Thu May 5 12:05:20 PDT 2011


On Tue, 2011-05-03 at 19:41 -0700, Ko, Heinrich wrote:
> Hi,
> 
> I have a series of calls as follows:
> 1. cairo_clip() with region x,y=(0,0) w,h=(1920,1080)
> 2. cairo_clip() with region x,y=(100,100) w,h=(100,100)
> 3. cairo_show_glyph()
> (actual behavior) glyphs rendered with cairo_show_glyphs() with x,y=(401,101) are clipped.
> 
> The strange behavior is when cairo_clip() is called with an area that is outside the bounds of the current clip region. For example:
> 1. cairo_clip() with region x,y=(0,0) w,h=(1920,1080)
> 2. cairo_clip() with region x,y=(100,100) w,h=(100,100)
> 3. cairo_clip() with region x,y=(400,100) w,h=(100,100)
> 4. cairo_show_glyph()
> (actual behavior) glyphs rendered with cairo_show_glyphs() with x,y=(401,101) are not clipped.  
> 
> With this observation, I would like to confirm whether or not the behavior is correct for the second case.  My expectation is that glyphs should be clipped as the 3rd call to cairo_clip() was not specified with a region that intersects the current clip region.
> 
Just to ensure somebody answered this:
Such a behavior is incorrect and the glyphs should be clipped. In fact,
everything should be clipped in this situation.

Benjamin



More information about the cairo mailing list