[cairo] [cairo-commit] 7 commits - src/cairo.c src/cairo-color.c src/cairo-gl-glyphs.c src/cairo-gl-private.h src/cairo-gl-surface.c src/cairo-gstate.c src/cairo-image-surface.c test/Makefile.sources test/zero-mask.c test/zero-mask.ref.png test/zero-mask.rgb24.ref.png

Benjamin Otte otte at redhat.com
Thu May 13 04:15:11 PDT 2010


On Thu, 2010-05-13 at 12:00 +0100, Chris Wilson wrote:
> Eric thinks this a necessary as creating surfaces in GL is not cheap. The
> canonical place to clean up caches and break circular-references is in
> cairo_device_finish().
> 
I benchmarked this with gnome-terminal-vim, which should hit that case a
lot and didn't notice any differences. That said, if Eric thinks it's a
good thing to have, I'll readd it.

Second, circular references aren't a good idea because noone can
guarantee that cairo_device_finish() will ever be called. An example
would be a GStreamer element that creates a device and produces surfaces
on an as-needed basis until you get rid of it. But then, it cannot
finish the device as that would mean that outstanding surfaces would
stop working. And that would be bad.

My idea for this was to reduce the device's refcount when we create a
cache surface and to increase it again before we get rid of it. That
way, we'd get rid of the surface's reference to the device.
But that would look ugly.

> cairo_color_stop_t is now a separate type, can you add this nice short-cut
> there as well.
> 
will do.

> > +
> > +mask_func_t mask_funcs[] = {
> ^^^ needs to be static in case we every a second test with mask_funcs[].
> 
oops, will fix.

Benjamin



More information about the cairo mailing list