[cairo] pattern/glitz update merge

Owen Taylor otaylor at redhat.com
Sun Feb 6 20:16:11 PST 2005


On Mon, 2005-02-07 at 04:55 +0100, David Reveman wrote:
> I did some work today to get my updates to the pattern system and to the
> glitz backend merged with current cvs. The patch is actually too big for
> the list so I put it here:
> http://www.cs.umu.se/~c99drn/cairo-pattern-merge-1.diff
> 
> It modifies the new fall-back system slightly. I moved some of the
> fall-back stuff into the cairo_image_surface struct, it cleaned up
> things quite nicely and made the merge a lot easier. 

You know, at one point last weekend, I had it pretty much as you
have it in your patch, then rewrote it all because there were
some very difficult to deal with memory management problems.

Look at the win32_acquire_source_image() in your patch. When a 
new surface is returned, if I'm not misreading the patch, the reference
count of 'local' is 1. The reference count of 'local->image' is 2. 
(One from the function, one from the reference count that 'local'
holds.)

When the caller unrefs the image, the reference count drops to 
1 and 1 ... classic refcount cycle. 

(On the other code path, you don't reference local->image at all,
so it's going to segfault when the caller unrefs.)

> Another thing that might be of concern is that I've done some much
> needed restructuring of the internal cairo_pattern struct, and it's now
> a union instead of a struct, which meant I also had to change the
> typedef in cairo.h. I don't see any problem with this, but maybe someone
> else does?

How can we reduce the size of the diff between your working tree and
CVS? Are there patches you can merge in independently of the rest?

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050206/6dcc5bb7/attachment.pgp


More information about the cairo mailing list