diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-28 09:55:20 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-28 09:55:20 +0100 |
commit | 6a99e83c50d715ba1e47aa5c7be714a423568e57 (patch) | |
tree | 3db9a69135d953567650a7f1a91e4dd64ba929d6 /src/cairo-surface-subsurface.c | |
parent | ca3df75e8f876991f2dc9e85c9daa3fd96e826d2 (diff) |
subsurface: Mark the image as !clear after copying.
Diffstat (limited to 'src/cairo-surface-subsurface.c')
-rw-r--r-- | src/cairo-surface-subsurface.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c index 93754aa3..3d6d4a55 100644 --- a/src/cairo-surface-subsurface.c +++ b/src/cairo-surface-subsurface.c @@ -293,7 +293,7 @@ _cairo_surface_subsurface_acquire_source_image (void *abstrac goto CLEANUP; /* only copy if we need to perform sub-byte manipulation */ - if (PIXMAN_FORMAT_BPP (extra->image->pixman_format) > 8) { + if (PIXMAN_FORMAT_BPP (extra->image->pixman_format) >= 8) { assert ((PIXMAN_FORMAT_BPP (extra->image->pixman_format) % 8) == 0); data = extra->image->data + surface->extents.y * extra->image->stride; @@ -325,6 +325,8 @@ _cairo_surface_subsurface_acquire_source_image (void *abstrac surface->extents.width, surface->extents.height); } + image->base.is_clear = FALSE; + *image_out = image; *extra_out = extra; return CAIRO_STATUS_SUCCESS; @@ -372,15 +374,15 @@ _cairo_surface_subsurface_snapshot (void *abstract_surface) surface->extents.width, surface->extents.height, 0); - if (unlikely (clone->base.status)) - return &clone->base; - - pixman_image_composite32 (PIXMAN_OP_SRC, - image->pixman_image, NULL, clone->pixman_image, - surface->extents.x, surface->extents.y, - 0, 0, - 0, 0, - surface->extents.width, surface->extents.height); + if (likely (clone->base.status == CAIRO_STATUS_SUCCESS)) { + pixman_image_composite32 (PIXMAN_OP_SRC, + image->pixman_image, NULL, clone->pixman_image, + surface->extents.x, surface->extents.y, + 0, 0, + 0, 0, + surface->extents.width, surface->extents.height); + clone->base.is_clear = FALSE; + } _cairo_surface_release_source_image (surface->target, image, image_extra); |