[cairo-commit] src/cairo-xlib-display.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 16 12:12:27 PDT 2012


 src/cairo-xlib-display.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 140fafed89508c4685f3a464c9dbe8df769f2411
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Thu Aug 16 18:23:41 2012 +0100

    Fix broken XRender ARGB32 formats
    
    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>

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;
     }
 


More information about the cairo-commit mailing list