summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-06-06 21:20:56 +0200
committerAlex Deucher <alexander.deucher@amd.com>2014-06-09 13:52:58 -0400
commitecf6ce02d673780583efc338b6501c15fae18169 (patch)
tree4d3ff01d1f1fa1799e237843e8720a25f7e97e15
parent18c2ff6245fd80fbc1b7f0b12ff17bf8b969d9fd (diff)
glamor: Fix accelerated rendering of GTK's ARGB vs xBGR composites.
There is some complicated code to support tweaking the format as we upload from a SHM pixmap (aka the GTK icon cache), but if we weren't sourcing from a SHM pixmap we just forgot to check that the formats matched at all. We could potentially be a little more discerning here (xRGB source and ARGB mask would be fine, for example), but this will all change with texture views anyway, so just get the rendering working for 1.16 release. Fixes the new rendercheck gtk_argb_xbgr test. v2: Squash in keithp's fix for checking that we have a non-NULL pixmap, and reword the comment even more. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/glamor_render.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glamor_render.c b/src/glamor_render.c
index a2141be..4c31fea 100644
--- a/src/glamor_render.c
+++ b/src/glamor_render.c
@@ -1129,6 +1129,16 @@ Bool glamor_composite_choose_shader(CARD8 op,
}
#endif
+ /* If the source and mask are two differently-formatted views of
+ * the same pixmap bits, and the pixmap was already uploaded (so
+ * the dynamic code above doesn't apply), then fall back to
+ * software. We should use texture views to fix this properly.
+ */
+ if (source_pixmap && source_pixmap == mask_pixmap &&
+ source->format != mask->format) {
+ goto fail;
+ }
+
/*Before enter the rendering stage, we need to fixup
* transformed source and mask, if the transform is not int translate. */
if (key.source != SHADER_SOURCE_SOLID