In Cairo release 1.10.0, cairo_region_t data type was added.
However pixman was removed.
Now there is no way to use cairo_region_t in cairo_context. So cairo_region is just a reflection of rectangles.
Setting the CLIP region to the cairo_region is not possible. So if we have a cairo_region_t created after union, subtract, we cannot use it for clipping purposes.
Currently cairo_clip(_preserve) can use ONLY path, but cannot make use all rectangles (obtained from cairo_region_t).
By some or other way, we need to create/expose a function
cairo_clip_intersect_to_region (cairo_region_t *region), which would clip according to PATH and INTERSECT with region
What you want is a cairo_append_region() convenience function:
for (i in cairo_region_num_rectangles())
No, I am looking for function like
cairo_clip_region (cairo_t *cr,
as mentioned in http://www.gtkforums.com/viewtopic.php?f=3&t=54873
Thanks to Carlos for giving me the link
(In reply to comment #1)
> What you want is a cairo_append_region() convenience function:
> for (i in cairo_region_num_rectangles())
> cairo_rectangle(cr, cairo_region_get_rectangle(i));
What you are looking for and what cairo will provide are two separate things...
Separating the action of adding the path from the operation, provides much greater flexibilty. For example:
And cairo is still free to use the knowledge that we have a region to optimise it path.
I was looking for direct function to
(1) Use cairo_region_t directly in cairo context OR
(2) Somehow, get the clipping region intersect with cairo_region_t, so
that my drawing occurs only in intersected region.
Assuming that cairoregion already exists, a workaround suggested in
the website states
(1) From Cairo Region, get ALL rectangles via cairo_region_num_rectangles
(2) For each rectangle, actually create rectangle via cairo_rectangle
(3) Use clip_path
(1) - (3) now means that the current path consists of the entire region
(4) Create a new path via cairo_line_to
(5) Clip it
I was looking for direct function which has just steps (4) and (5)
(1) Create a new path via cairo_line etc.
(2) call cairo_clip_intersect(m_cr, region)
On Wed, Oct 10, 2012 at 4:48 PM, <firstname.lastname@example.org> wrote:
> Comment # 3 on bug 55836 from Chris Wilson
> What you are looking for and what cairo will provide are two separate
> Separating the action of adding the path from the operation, provides much
> greater flexibilty. For example:
> And cairo is still free to use the knowledge that we have a region to
> it path.
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
> You are watching the QA Contact of the bug.
Moving from 1.14 tracker to 1.16 tracker
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/214.