diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-02 02:06:45 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-02 02:08:19 +0000 |
commit | c6c02f519457299909c76cd116f6392c6d0e3a84 (patch) | |
tree | 0c5dc68968b169dea9b15500820c6c252d185b96 /src/cairo-xlib-surface.c | |
parent | 24445f94684a10eeaebb3794dc7c4b20539d873b (diff) | |
download | cairo-c6c02f519457299909c76cd116f6392c6d0e3a84.tar.gz |
xlib: Only reduce a readback of an uninitialised source for pixmaps
For a foreign drawable, we have to assume to that is dirty upon creation
or otherwise we fail to read back the correct pixel data when copying to
an image.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r-- | src/cairo-xlib-surface.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 3e0bed7aa..5fb9185c3 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -693,7 +693,9 @@ _get_image_surface (cairo_xlib_surface_t *surface, assert (extents->x + extents->width <= surface->width); assert (extents->y + extents->height <= surface->height); - if (surface->base.serial == 0) { + if (surface->base.is_clear || + (surface->base.serial == 0 && surface->owns_pixmap)) + { xlib_masks.bpp = bits_per_pixel (surface); xlib_masks.alpha_mask = surface->a_mask; xlib_masks.red_mask = surface->r_mask; |