[cairo-commit] boilerplate/cairo-boilerplate-xlib.c src/cairo-xlib-surface-private.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 31 06:50:57 PDT 2009


 boilerplate/cairo-boilerplate-xlib.c |   10 ++++++++--
 src/cairo-xlib-surface-private.h     |    3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 097484da6fd70867ed2128e78247eab5c43217fb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 31 14:48:32 2009 +0100

    [boilerplate] Conditionally tweak the xlib surface
    
    Prior to introduction of the buggy members to the surface, we obviously
    cannot set them. However, the boilerplate code is meant to compile against
    older revisions of the library so we need to check for the existence prior
    to use.

diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 6810dd6..d67a938 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -257,9 +257,15 @@ cairo_boilerplate_xlib_surface_disable_render (cairo_surface_t *abstract_surface
     surface->base.content = CAIRO_CONTENT_COLOR;
 
     /* These flags are set based on known bugs and lack of RENDER support */
-    surface->buggy_repeat = TRUE;
-    surface->buggy_pad_reflect = TRUE;
+#if CAIRO_XLIB_SURFACE_HAS_BUGGY_GRADIENTS
     surface->buggy_gradients = TRUE;
+#endif
+#if CAIRO_XLIB_SURFACE_HAS_BUGGY_PAD_REFLECT
+    surface->buggy_pad_reflect = TRUE;
+#endif
+#if CAIRO_XLIB_SURFACE_HAS_BUGGY_REPEAT
+    surface->buggy_repeat = TRUE;
+#endif
 
     return CAIRO_STATUS_SUCCESS;
 }
diff --git a/src/cairo-xlib-surface-private.h b/src/cairo-xlib-surface-private.h
index d963cd6..cb97650 100644
--- a/src/cairo-xlib-surface-private.h
+++ b/src/cairo-xlib-surface-private.h
@@ -78,6 +78,9 @@ struct _cairo_xlib_surface {
     unsigned int buggy_gradients : 1;
     unsigned int buggy_pad_reflect : 1;
     unsigned int buggy_repeat : 1;
+#define CAIRO_XLIB_SURFACE_HAS_BUGGY_GRADIENTS 1
+#define CAIRO_XLIB_SURFACE_HAS_BUGGY_PAD_REFLECT 1
+#define CAIRO_XLIB_SURFACE_HAS_BUGGY_REPEAT 1
 
     int width;
     int height;


More information about the cairo-commit mailing list