[cairo] Lifecycle of a Pattern

Mark Meier immarkm at yahoo.com
Wed May 2 08:01:01 PDT 2012


Hopefully I did not miss this in the FAQ, if so please forgive the Cairo newbie.

I have a Win32 surface that I keep redrawing with the same pattern fills and hatch fills.  I want to be sure that I am keeping the proper parts of the patterns around for the proper amount of time.

The steps are (as I see it):

for patterns-

1) put my data in the proper Cairo ARGB32 order
2) create a surface from my data
3) create a pattern from my surface

for hatches-
1) create a surface to draw on
2) create a cairo_t to draw hatch lines with
3) create a pattern from my surface

..then fill some shape with my pattern.

The problem is I do not how long to keep each object around.  I do not seem to be able to delete every thing after I am done with "cairo_fill()".  At the minimum, I have to keep the data I used to "create surface from data".  Can someone point me to the documentation (or code) that helps explain the lifecycle of a pattern.

Thanks,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120502/55a109dd/attachment.htm>


More information about the cairo mailing list