sna: Upconvert fallback trapezoids to a8

Since the hardware only handles a8 without tricky emulation and pixman
insists on using a1 for sharp trapezoids we need to ensure that we
convert the a1 to a8 for our trapezoidal mask.

More worryingly, this path should never be hit...

References: https://bugs.freedesktop.org/show_bug.cgi?id=46156
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-16 11:22:23 +00:00
parent 8050ced620
commit 52b11f63d7
1 changed files with 26 additions and 5 deletions

View File

@ -2009,20 +2009,41 @@ trapezoids_fallback(CARD8 op, PicturePtr src, PicturePtr dst,
DBG(("%s: mask (%dx%d) depth=%d, format=%08x\n",
__FUNCTION__, width, height, depth, format));
scratch = sna_pixmap_create_upload(screen,
width, height, depth,
width, height, 8,
KGEM_BUFFER_WRITE);
if (!scratch)
return;
memset(scratch->devPrivate.ptr, 0, scratch->devKind*height);
image = pixman_image_create_bits(format, width, height,
scratch->devPrivate.ptr,
scratch->devKind);
if (depth < 8) {
image = pixman_image_create_bits(format, width, height,
NULL, 0);
} else {
memset(scratch->devPrivate.ptr, 0, scratch->devKind*height);
image = pixman_image_create_bits(format, width, height,
scratch->devPrivate.ptr,
scratch->devKind);
}
if (image) {
for (; ntrap; ntrap--, traps++)
pixman_rasterize_trapezoid(image,
(pixman_trapezoid_t *)traps,
-bounds.x1, -bounds.y1);
if (depth < 8) {
pixman_image_t *a8;
a8 = pixman_image_create_bits(PIXMAN_a8, width, height,
scratch->devPrivate.ptr,
scratch->devKind);
if (a8) {
pixman_image_composite(PIXMAN_OP_SRC,
image, NULL, a8,
0, 0,
0, 0,
0, 0,
width, height);
pixman_image_unref (a8);
}
}
pixman_image_unref(image);
}