[cairo] Clip region problems

Keith Packard keithp at keithp.com
Thu May 19 13:49:05 PDT 2005

Oh, one change that I'm not happy with in my previous cairo patch for
clip list changes.

There are two paths for clipping at present, the first is clipping to a
list of rectangles, the second is clipping to an alpha mask.

When the clip list can be reduced to rectangles, the gstate code asks
the surface to use said rectangles, and if the surface cannot, the
gstate code computes an alpha mask from them.

The old code did this when the clip list was constructed; the surface
would be immediately notified about the new clip and it would be set
into the surface.

The new code doesn't pass the clip list down to the surface until just
before drawing; this ensures that no 'hidden' surface state (e.g., the
clip list), persists across multiple cairo calls.

However, this means that when the clip is set into the gstate, we have
no existing mechanism to detect whether the surface will eventually
accept it.

So, I kludged things -- a new call _cairo_surface_can_clip returns
whether the surface will accept a call to _cairo_surface_set_clip
without returning an error (other than out of memory).

This doesn't make me happy, but I would prefer to leave things as simple
as possible until we see how clip-to-path will work in this new
environment.  Mostly, I want to make sure this particular change doesn't
surprise people or make them think that this is a 'good' internal API.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050519/40eb4451/attachment.pgp

More information about the cairo mailing list