summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r--[-rwxr-xr-x]src/cairo-image-surface.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index b68f4a9e7..1948a1add 100755..100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -48,6 +48,7 @@
#include "cairo-image-surface-inline.h"
#include "cairo-paginated-private.h"
#include "cairo-pattern-private.h"
+#include "cairo-pixman-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-region-private.h"
#include "cairo-scaled-font-private.h"
@@ -123,7 +124,7 @@ _cairo_image_shadow_caches_destroy (void)
cairo_surface_destroy (shadow->surface);
free (shadow);
}
- shadow_caches_size = 0;
+ shadow_caches_size = 0;
}
}
@@ -222,7 +223,12 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format)
return CAIRO_FORMAT_A1;
case PIXMAN_r5g6b5:
return CAIRO_FORMAT_RGB16_565;
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0)
case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8:
+#endif
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,27,2)
+ case PIXMAN_a8r8g8b8_sRGB:
+#endif
case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
case PIXMAN_b8g8r8: case PIXMAN_b5g6r5:
case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:
@@ -239,7 +245,9 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format)
case PIXMAN_a2b10g10r10:
case PIXMAN_x2b10g10r10:
case PIXMAN_a2r10g10b10:
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,22,0)
case PIXMAN_x14r6g6b6:
+#endif
default:
return CAIRO_FORMAT_INVALID;
}
@@ -535,7 +543,7 @@ _cairo_image_surface_create_with_content (cairo_content_t content,
* <informalexample><programlisting>
* int stride;
* unsigned char *data;
- * #cairo_surface_t *surface;
+ * cairo_surface_t *surface;
*
* stride = cairo_format_stride_for_width (format, width);
* data = malloc (stride * height);
@@ -883,12 +891,12 @@ _cairo_image_surface_snapshot (void *abstract_surface)
return &clone->base;
image->pixman_image = NULL;
+ image->owns_data = FALSE;
clone->transparency = image->transparency;
clone->color = image->color;
- clone->owns_data = image->owns_data;
- image->owns_data = FALSE;
+ clone->owns_data = TRUE;
return &clone->base;
}
@@ -964,8 +972,9 @@ _cairo_image_surface_finish (void *abstract_surface)
}
if (surface->parent) {
- cairo_surface_destroy (surface->parent);
+ cairo_surface_t *parent = surface->parent;
surface->parent = NULL;
+ cairo_surface_destroy (parent);
}
_cairo_image_shadow_caches_destroy ();
@@ -1034,7 +1043,7 @@ _cairo_image_surface_paint (void *abstract_surface,
const cairo_clip_t *clip)
{
cairo_image_surface_t *surface = abstract_surface;
- cairo_int_status_t status;
+ cairo_int_status_t status;
TRACE ((stderr, "%s (surface=%d)\n",
__FUNCTION__, surface->base.unique_id));
@@ -1322,7 +1331,7 @@ _cairo_image_surface_shadow_surface (void *surface,
else
shadow_width = width;
}
-
+
if (height < MIN_IMAGE_SHADOW_SIZE)
shadow_height = height;
else if (has_blur) {