diff options
-rw-r--r-- | glamor/glamor_image.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c index 315874995..62ac7dc9a 100644 --- a/glamor/glamor_image.c +++ b/glamor/glamor_image.c @@ -116,7 +116,7 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - if (format != ZPixmap || !glamor_pm_is_solid(drawable->depth, plane_mask)) + if (format != ZPixmap) goto bail; glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); @@ -128,6 +128,17 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, drawable->x + off_x, drawable->y + off_y, -x, -y, (uint8_t *) d, byte_stride); + + if (!glamor_pm_is_solid(drawable->depth, plane_mask)) { + int i; + uint32_t *dest = (void *)d; + plane_mask = fbReplicatePixel(plane_mask, + BitsPerPixel(drawable->depth)); + + for (i = 0; i < w * h; i++) + dest[i] &= plane_mask; + } + return TRUE; bail: return FALSE; |