[cairo] cairo_draw_with_xlib API

Vladimir Vukicevic vladimirv at gmail.com
Mon Feb 27 12:13:29 PST 2006


On 2/27/06, Carl Worth <cworth at cworth.org> wrote:
> On Mon, 27 Feb 2006 10:17:01 +1300, Robert O'Callahan wrote:
> >                                                           In fact, even
> > if we have a clip path, it may be impossible to express as a union of
> > rectangles.
>
> It does get pretty messy without having path intersection in cairo.
>
> The expected use for this stuff is when the user has only passed in a
> list-of-pixel-aligned-rectangle (a "region" let's say) clip anyway,
> right? So we could define the clip_as_rectangles operation in a way
> that would only be guaranteed to give useful results in such a
> case. For example, it could convert each path to its bounding region
> and then perform the intersection on those.
>
> Then again, this is the same criteria that determines mask-based
> clipping or not. So maybe there would be no point in storing the paths
> just to be able to return a result here that would not be accurate nor
> likely ever to be desired.
>
> So maybe we do just let the clip_as_rectangles stuff fail in these
> cases, (though we'll have to document that in terms of what the user
> must do---we can't just say "fails if we happen to be using a mask
> internally).

We could just return a clip structure similar to cairo_clip_t -- with
a flag indicating what kind of clip data is present, and then the
region/path set/surface mask.  If we always keep the clip path around
(I think I have a patch somewhere that does this, though it wasn't
that complicated of a patch), then in such a struct you'd have access
to both the actual kind of clip set on the surface, and the most
general clip info (the path).

    - Vlad


More information about the cairo mailing list