[cairo] how to substitute CAIRO_CLIP_PATH_IS_BOX ?
Chris Wilson
chris at chris-wilson.co.uk
Wed Dec 16 04:45:29 PST 2015
On Fri, Dec 11, 2015 at 01:07:55PM +0100, Enrico Weigelt, metux IT consult wrote:
> Hi folks,
>
>
> the flags field in cairo_clip_path_t had been removed, but the DRM
> backend still uses it:
>
> > static cairo_clip_path_t *
> > _clip_get_solitary_path (const cairo_clip_t *clip)
> > {
> > cairo_clip_path_t *iter = clip->path;
> > cairo_clip_path_t *path = NULL;
> >
> > do {
> > if ((iter->flags & CAIRO_CLIP_PATH_IS_BOX) == 0) {
> > if (path != NULL)
> > return FALSE;
> >
> > path = iter;
> > }
> > iter = iter->prev;
> > } while (iter != NULL);
> >
> > return path;
> > }
>
>
> How should I substitute it ?
This basically was replace by cairo_clip_t managing boxes explicitly.
However, in this case what you want to convert over to is
_cairo_clip_get_polygon(). The intention is that we can reduce complex
clips very often to a single polygon and that even do geometric
intersection of clip paths with shapes (to avoid the fill overhead of
rendering multiple passes).
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo
mailing list