Summary: | cairo_region cannot be used with CLIP, as NO public API is exposed to use it in cairo_context/surface | ||
---|---|---|---|
Product: | cairo | Reporter: | Adhir <adhir.garg> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | critical | ||
Priority: | medium | CC: | adhir.garg |
Version: | 1.12.2 | ||
Hardware: | All | ||
OS: | Mac OS X (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 84197 |
Description
Adhir
2012-10-10 10:55:30 UTC
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)); No, I am looking for function like cairo_bool_t cairo_clip_region (cairo_t *cr, cairo_region_t *region) 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: 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. 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@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. 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. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.