image: Avoid reusing pixman images for threadsafety.

The pixman_image_ref() and pixman_image_unref() functions
aren't threadsafe in current pixman, so we can't share
pixman images across contexts where they may end up
moving between threads.  The main use of these functions
is in keeping a global cache of pixman_image_ts for
solid colours and reusing the same pixman_image_t for
patterns pointing to the same image data where possible.

This patch removes those uses from cairo by wrapping
them in a PIXMAN_HAS_ATOMIC_OPS conditional.  There is
no automatic test this, so we will have to manually
turn this code back on when pixman does gain atomic
ops.

The only two remaining calls to pixman_image_ref() are
done on locally created images so they are safe.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34177
1 file changed