[cairo] [PATCH] fix bugs 15797 (1.8) and 18632 (master)

Jeff Muizelaar jeff at infidigm.net
Tue Dec 9 07:25:08 PST 2008


On Tue, Dec 09, 2008 at 03:45:32PM +0100, Paolo Bonzini wrote:
> Hi all, I tracked PR15797 and PR18632 to be caused by the same code of
> cairo-quartz-surface.c.
> 
> In 1.8, CreateGradientFunction and CreateRepeatingGradientFunction (two
> functions in the quartz backend) erroneously unbalance the reference
> count of the pattern, causing PR15797.  This was fixed in commits
> 79446018 and 57551a91, but the fix caused PR18632 in turn because the
> code now tries to increase the reference count of cairo-gstate.c's
> stack-allocated patterns.
> 
> The fix in both cases is to avoid reference counting for the argument of
> CreateGradientFunction and CreateRepeatingGradientFunction.  Since the
> lifetime of the Quartz patterns for the source (created by
> _cairo_quartz_setup_source and destroyed by
> _cairo_quartz_teardown_source; _cairo_quartz_setup_source is what calls
> the Create*GradientFunction functions instead) always coincides within
> the execution of _cairo_quartz_setup_source's caller, we know that if
> the source had a valid reference count upon _cairo_quartz_setup_source's
> entrance, it will keep it until the surface is torn down.
> 
> The fixes are in my repository at
> http://www.inf.unisi.ch/~bonzini/webdav/cairo.git in branches
> fix-15797-1.8 and fix-18632 (no test case: the bug basically makes the
> Quartz backend unusable with gradients).

Thanks. I'm taking a look at this now.

-Jeff


More information about the cairo mailing list