summaryrefslogtreecommitdiff
path: root/src/sna/sna_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-28 10:14:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-28 10:14:16 +0100
commit541f816815e392db9e798d2f940029d82a6b2e0b (patch)
treeb9fd13f67875ae2f9974c116867e8f865902069e /src/sna/sna_render.c
parent34e6366f2a61c145445056e5fc6c483999c0402c (diff)
sna: Markup when a gradient is opaque
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render.c')
-rw-r--r--src/sna/sna_render.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index dd757dd9..032dba7d 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1480,8 +1480,13 @@ sna_render_picture_approximate_gradient(struct sna *sna,
return -1;
}
+ channel->is_opaque = sna_gradient_is_opaque(picture->pSourcePict);
+ channel->pict_format =
+ channel->is_opaque ? PIXMAN_x8r8g8b8 : PIXMAN_a8r8g8b8;
+ DBG(("%s: gradient is opaque? %d, selecting format %08x\n",
+ __FUNCTION__, channel->is_opaque, channel->pict_format));
assert(channel->card_format == -1);
- channel->pict_format = PIXMAN_a8r8g8b8;
+
channel->bo = kgem_create_buffer_2d(&sna->kgem,
w2, h2, 32,
KGEM_BUFFER_WRITE_INPLACE,
@@ -1492,7 +1497,7 @@ sna_render_picture_approximate_gradient(struct sna *sna,
return 0;
}
- dst = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+ dst = pixman_image_create_bits(channel->pict_format,
w2, h2, ptr, channel->bo->pitch);
if (!dst) {
kgem_bo_destroy(&sna->kgem, channel->bo);