diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c index eaf72e2cc..b752041cf 100644 --- a/src/cairo-image-source.c +++ b/src/cairo-image-source.c @@ -62,9 +62,10 @@ #endif #if PIXMAN_HAS_ATOMIC_OPS -static pixman_image_t *__pixman_transparent_image; -static pixman_image_t *__pixman_black_image; -static pixman_image_t *__pixman_white_image; + +static cairo_atomic_intptr_t __pixman_transparent_image; /* (pixman_image_t *) */ +static cairo_atomic_intptr_t __pixman_black_image; +static cairo_atomic_intptr_t __pixman_white_image; static pixman_image_t * _pixman_transparent_image (void) @@ -73,7 +74,7 @@ _pixman_transparent_image (void) TRACE ((stderr, "%s\n", __FUNCTION__)); - image = __pixman_transparent_image; + image = (pixman_image_t *) _cairo_atomic_ptr_get (&__pixman_transparent_image); if (unlikely (image == NULL)) { pixman_color_t color; @@ -105,7 +106,7 @@ _pixman_black_image (void) TRACE ((stderr, "%s\n", __FUNCTION__)); - image = __pixman_black_image; + image = (pixman_image_t *) _cairo_atomic_ptr_get (&__pixman_black_image); if (unlikely (image == NULL)) { pixman_color_t color; @@ -137,7 +138,7 @@ _pixman_white_image (void) TRACE ((stderr, "%s\n", __FUNCTION__)); - image = __pixman_white_image; + image = (pixman_image_t *) _cairo_atomic_ptr_get (&__pixman_white_image); if (unlikely (image == NULL)) { pixman_color_t color; @@ -178,6 +179,7 @@ static struct { static int n_cached; #else /* !PIXMAN_HAS_ATOMIC_OPS */ + static pixman_image_t * _pixman_transparent_image (void) { @@ -198,6 +200,7 @@ _pixman_white_image (void) TRACE ((stderr, "%s\n", __FUNCTION__)); return _pixman_image_for_color (CAIRO_COLOR_WHITE); } + #endif /* !PIXMAN_HAS_ATOMIC_OPS */