[cairo] Pattern (pop) and clip
ranma42 at gmail.com
Thu Nov 28 08:35:45 PST 2013
On Tue, Nov 26, 2013 at 10:02 AM, Donn <donn.ingle at gmail.com> wrote:
> (In a valid context with a surface 500px by 500px)
> rectangle (50px by 50px)
> draw other stuff
> Would the pattern, pat, be the size of the clip 50x50px, or of the size of
> the surface 500x500px?
> i.e. Should I bother clipping before I pop a pattern, or should I clip
> before using that pat in a set_source(pat) then paint() ?
If you clip before pushing, the group size will be smaller, which is
usually going to result in decreased memory usage and better performance.
This is especially true on backends which store a rasterization of the
surface you're working on, like in the image backend. On other backends
(example: the recording backend) keep an implicit representation of the
operations performed on the surface, so this might have little to no impact.
> What's the more efficient/fast approach?
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo