summaryrefslogtreecommitdiff
path: root/src/cairo-surface.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-07-31 14:45:54 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-07-31 14:45:54 -0400
commitb3341b4eda274036a74eea3187d47ef257688828 (patch)
treec7b752f5b66d400b17a8b7408ba2554345f5c355 /src/cairo-surface.c
parentbdb4e1edadb78a2118ff70b28163f8bd4317f1ec (diff)
Let backends return NULL in create_similar to take the fallback path.
Make xlib backend use it.
Diffstat (limited to 'src/cairo-surface.c')
-rw-r--r--src/cairo-surface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 914e2c713..ceceab576 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -244,7 +244,7 @@ _cairo_surface_create_similar_scratch (cairo_surface_t *other,
int width,
int height)
{
- cairo_surface_t *surface;
+ cairo_surface_t *surface = NULL;
cairo_font_options_t options;
cairo_format_t format = _cairo_format_from_content (content);
@@ -254,7 +254,8 @@ _cairo_surface_create_similar_scratch (cairo_surface_t *other,
if (other->backend->create_similar)
surface = other->backend->create_similar (other, content, width, height);
- else
+
+ if (!surface)
surface = cairo_image_surface_create (format, width, height);
cairo_surface_get_font_options (other, &options);