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>
This commit is contained in:
Chris Wilson 2012-02-02 02:06:45 +00:00
parent 24445f9468
commit c6c02f5194

View file

@ -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;