[cairo-bugs] [Bug 55836] cairo_region cannot be used with CLIP, as NO public API is exposed to use it in cairo_context/surface

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 10 04:35:11 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=55836

--- Comment #4 from Adhir <adhir.garg at gmail.com> ---
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,  <bugzilla-daemon at freedesktop.org> wrote:
> Comment # 3 on bug 55836 from Chris Wilson
>
> 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:
>   cairo_append_region();
>   cairo_clip_preserve();
>   cairo_stroke();
>
> And cairo is still free to use the knowledge that we have a region to
> optimise
> 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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20121010/fbffa40f/attachment-0001.html>


More information about the cairo-bugs mailing list