[cairo] Re: new clipping change patch

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Wed May 25 05:57:05 PDT 2005


On Tue, 2005-05-24 at 14:48 -0400, Owen Taylor wrote:
> On Mon, 2005-05-23 at 23:28 -0700, Keith Packard wrote:
> > After our IRC discussion today, I went and rewrote the clipping code
> > again to pull most of the clipping work into the gstate where it belongs.
> > 
> > The surface now just reflects state down to the backend, the only thing
> > retained is the serial number for the clipping that was set.
> > 
> > Extents for the clip are kept up in the gstate; the surface will only
> > return the extents for the entire object.
> > 
> > My email is dead until tomorrow sometime; bad things happened to my 
> > home box this week and my ISP disabled my line as a result...
> > 
> > Patch available at http:/freedesktop.org/~keithp/cairo-serialclip-2.diff
> > 
> > I should be back on-line sometime tomorrow; failing that, I'll rework
> > email so I can get at it somehow.
> 
> Hopefully this mail will get through to you one way or the other.
> 
> I like this version of the patch a lot more than the last one. 
> 
> Various comments:
> 
>  * I'm not sure the name change cairo_surface_set_clip_region() =>
>    cairo_surface_clip_region() makes sense. It's still a setter...
>    there are no plans to make clip_region() intersect with the
>    current clip region.

  Do you mean that if I clip to a certain rectangle, then save state and
call a function to draw some object, the object is allowed to change the
clip region and draw outside the initial rectangle?

  If so, in my opinion this is a terrible idea.  It's analogous to
letting a user gain root privileges.  Please, can we not allow this?
Setting a new clip region should always intersect with the previous one.
Most of the time the new clip region is a rectangle completely inside
the old clip region, so this should not be a performance problem...

  Best regards.

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3086 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050525/fd25c70d/smime.bin


More information about the cairo mailing list