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

Ko, Heinrich Heinrich.Ko at am.sony.com
Thu May 5 14:20:02 PDT 2011



> -----Original Message-----
> From: Benjamin Otte [mailto:otte at redhat.com]
> Sent: Thursday, May 05, 2011 12:05 PM
> To: Ko, Heinrich
> Cc: cairo at cairographics.org
> Subject: Re: [cairo] confirming behavior of cairo_clip() with
> cairo_show_glyphs()
> 
> 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
> 

Thanks for the confirmation Benjamin.  I also just realized that I was using an older version of cairo and I found that the latest version of cairo has already addressed this issue.

Heinrich


More information about the cairo mailing list