Re: Pattern (pop) and clip

Andrea Canciani <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAN_5=BCN5UsnxdUqf-rPeSrpuJK071wOYn3VBRL2GrGx5p8ZKA@mail.gmail.com>
On Tue, Nov 26, 2013 at 10:02 AM, Donn <[email protected]> wrote:

> Hi,
>
> Given:
>
> (In a valid context with a surface 500px by 500px)
> rectangle (50px by 50px)
> save
> clip
> push_group
> draw other stuff
> pop_group(pat)
> restore
>
> 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.

Andrea



>
> What's the more efficient/fast approach?
>
>
> \d
>
> --
> cairo mailing list
> [email protected]
> http://lists.cairographics.org/mailman/listinfo/cairo
>

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.