filling by way of clipping path
Cosmin Apreutesei <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAKJdRak4=URN-42R_8BhP+-100Dijas5eFvD+uhNqQvK2KoxJQ@mail.gmail.com> |
Hi guys, I'm new to cairo and I'd like some feedback on an idea. I'm making a DOM-like data structure for cairo which can be rendered on a surface and should cover all of cairo's capabilities. This includes filling a path with a "group object" which can itself contain other filled paths and other groups. At first I implemented this by way of push_group(); draw-object...; pop_group_to_source(); draw-path...; fill(). But I want to re-implement this using only clipping paths, that is: save(); draw-path...; clip(); draw-object...; restore(). I will choose this strategy assuming 1) the drawing will be faster as cairo is smart enough to avoid drawing outside the clipping path, and 2) a temporary bitmap will not be created as with push_group(), so again faster and less memory. Are these assumptions correct? Also, can there be anything different in terms of screen results between the first and the second strategy? In can't see any difference in my limited tests but maybe I'm missing something. [OT: anyone knows of a C lib that can do path union & intersection, including paths with curves?] Thanks, Cosmin. -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo