[PATCH] glamor: Fix accelerated rendering of GTK's ARGB vs xBGR composites.
eric at anholt.net
Mon Apr 21 11:01:50 PDT 2014
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
Fixes the new rendercheck gtk_argb_xbgr test.
glamor/glamor_render.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index cdf8eff..56afc38 100644
@@ -1038,6 +1038,13 @@ glamor_composite_choose_shader(CARD8 op,
+ /* If the formats don't match, 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 == 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
More information about the xorg-devel