summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 30252982..9fe09fff 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17191,8 +17191,7 @@ sna_get_image(DrawablePtr drawable,
if (ACCEL_GET_IMAGE &&
!FORCE_FALLBACK &&
format == ZPixmap &&
- drawable->bitsPerPixel >= 8 &&
- PM_IS_SOLID(drawable, mask)) {
+ drawable->bitsPerPixel >= 8) {
PixmapPtr pixmap = get_drawable_pixmap(drawable);
int16_t dx, dy;
@@ -17204,7 +17203,7 @@ sna_get_image(DrawablePtr drawable,
region.data = NULL;
if (sna_get_image__fast(pixmap, &region, dst, flags))
- return;
+ goto apply_planemask;
if (!sna_drawable_move_region_to_cpu(&pixmap->drawable,
&region, flags))
@@ -17222,6 +17221,16 @@ sna_get_image(DrawablePtr drawable,
region.extents.x1, region.extents.y1, 0, 0, w, h);
sigtrap_put();
}
+
+apply_planemask:
+ if (!PM_IS_SOLID(drawable, mask)) {
+ FbStip pm = fbReplicatePixel(mask, drawable->bitsPerPixel);
+ FbStip *d = (FbStip *)dst;
+ int i, n = PixmapBytePad(w, drawable->depth) / sizeof(FbStip) * h;
+
+ for (i = 0; i < n; i++)
+ d[i] &= pm;
+ }
} else {
region.extents.x1 = x + drawable->x;
region.extents.y1 = y + drawable->y;