[PATCH] Fix broken XRender ARGB32 formats

Daniel Stone <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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 <[email protected]>
---
 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

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.