[cairo] [PATCH] Fix broken XRender ARGB32 formats

Daniel Stone daniel at fooishbar.org
Thu Aug 16 10:23:41 PDT 2012


46d79228 did indeed silence the compilation warning, but did so by never
creating an ARGB32 format, as PictStandardARGB32 is defined to 0.  Fix
this by using PictStandardNUM as our canary value instead.

This fixes GEdit and Chromium for me, both of which were only rendering
backgrounds and text in their GTK+ sections.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 src/cairo-xlib-display.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index d806bfd..06242ff 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -492,7 +492,7 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t	*display,
 
     xrender_format = display->cached_xrender_formats[format];
     if (xrender_format == NULL) {
-	int pict_format = 0;
+	int pict_format = PictStandardNUM;
 
 	switch (format) {
 	case CAIRO_FORMAT_A1:
@@ -515,10 +515,9 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t	*display,
 	case CAIRO_FORMAT_ARGB32:
 	    pict_format = PictStandardARGB32; break;
 	}
-	if (pict_format) {
+	if (pict_format != PictStandardNUM)
 	    xrender_format =
 		XRenderFindStandardFormat (display->display, pict_format);
-	}
 	display->cached_xrender_formats[format] = xrender_format;
     }
 
-- 
1.7.10.4



More information about the cairo mailing list