summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-image-surface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 9310a517..05b0edbb 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -760,12 +760,19 @@ _cairo_format_bits_per_pixel (cairo_format_t format)
}
static cairo_surface_t *
-_cairo_image_surface_create_similar (void *abstract_src,
+_cairo_image_surface_create_similar (void *abstract_other,
cairo_content_t content,
int width,
int height)
{
- assert (CAIRO_CONTENT_VALID (content));
+ cairo_image_surface_t *other = abstract_other;
+
+ if (content == other->base.content) {
+ return _cairo_image_surface_create_with_pixman_format (NULL,
+ other->pixman_format,
+ width, height,
+ 0);
+ }
return _cairo_image_surface_create_with_content (content,
width, height);