[cairo] Getting mozilla-specific changes merged in

Carl Worth cworth at cworth.org
Thu May 18 23:02:23 PDT 2006

On Thu, 18 May 2006 20:47:04 +1200, Robert O'Callahan wrote:
> I have a question about the cairo_get_clip_as_rectangles API: should the
> returned rectangles be in user space or device space?
> User space is more consistent with the rest of the cairo API. But
> returning rectangles in device space would let us return useful
> rectangles in strictly more cases.

Tricky, tricky...

Obviously device-space rectangles are the only interesting thing for
the limited case where you actually want the clip. But as you point
out, that doesn't fit in well with the main cairo API.

> To elucidate: as currently implemented, we can only return rectangles if
> the clip is a union of pixel-aligned rectangles in device space. If
> transforming those rectangles to user space produces rectangles that are
> no longer axis-aligned, then we will just have to bail out saying
> "sorry"

Oh, here's an idea. What if we did user-space rectangles and
implemented/documented the bailing out as you describe.

Of course, you still want to get device-space rectangles, but you
could simply install an identity CTM before calling
cairo_copy_clip_as_rectangles and then you could ensure that you get
the device-space rectangles as often as they are available.

Does that seem reasonable?

To me, this seems quite similar to what we already have for setting
the clip in the first place. We have both the mask-based clipping and
the fast-path clipping. But we don't have separate API for getting at
them. Instead, if you want to guarantee that you're setting the
fast-path clip, then you basically have to install an identity CTM.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060518/70b61dd5/attachment.pgp

More information about the cairo mailing list