[cairo] Pattern questions

Ian Britten britten at caris.com
Fri Sep 4 08:20:14 PDT 2009


Chris Wilson wrote:
>>    - I seem to recall discussions about embedding+reusing patterns
>>      in some output surfaces (PDF?), and wasn't sure if using paint()
>>      would result in that being done (Assuming it actually is done).
> 
> Yes, but pattern reuse is only available in the 1.10 release (you can
> test it in the 1.9.2 snapshot). Snapshotting of patterns is not limited
> to paint, but applies to any use of the pattern.

Follow-up question... (Re: 1.10 pattern enhancements)

Is there any semantic/functional/structural difference to a pattern
(sprite) versus plain linework?  Does it appear as some sort of
entity in some formats (PDF, SVG), which might benefit some tools
working with those output files?
Or is it just a cairo-level API convenience/optimization?

For example, if I have just one sprite to draw, is there any benefit
to making it into a pattern and rendering the pattern, as opposed to
just rendering the linework the one time?

If that's the case, I'm now pondering whether many of my higher-level
entities would benefit from a two-stage pattern+draw approach, rather
than a straight render.  Due to the advanced patterning/symbology/etc
that we perform, it's very common for a single piece of data to end
up being rendered by many discrete cairo draw instructions.

Thanks for any info!
Ian



More information about the cairo mailing list