summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac9
-rw-r--r--src/cairo-xlib-xrender-private.h23
2 files changed, 23 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 09bdd9fc..951e9607 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,15 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
[use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"])
CPPFLAGS=$old_CPPFLAGS
])
+
+ old_CFLAGS=$CFLAGS
+ old_LIBS=$LIBS
+ CFLAGS="$CFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS $xlib_xrender_CFLAGS $xlib_xrender_NONPKGCONFIG_CFLAGS"
+ LIBS="$LIBS $xlib_LIBS $xlib_NONPKGCONFIG_LIBS $xlib_xrender_LIBS $xlib_xrender_NONPKGCONFIG_LIBS"
+ AC_CHECK_FUNCS([XRenderCreateLinearGradient XRenderCreateRadialGradient XRenderCreateConicalGradient])
+ CFLAGS=$old_CFLAGS
+ LIBS=$old_LIBS
+
fi
])
diff --git a/src/cairo-xlib-xrender-private.h b/src/cairo-xlib-xrender-private.h
index 52f41591..bf3199c4 100644
--- a/src/cairo-xlib-xrender-private.h
+++ b/src/cairo-xlib-xrender-private.h
@@ -96,26 +96,31 @@ __attribute__((__unused__)) static void _void_consume_free (Display *p, XID
#define PictOpBlendMaximum 0x3e
#endif
-/* There doesn't appear to be a simple #define that we can conditionalize
- * on. Instead, use the version; gradients were introdiced in 0.10. */
-#if RENDER_MAJOR == 0 && RENDER_MINOR < 10
+#if !HAVE_XRENDERCREATELINEARGRADIENT
#define XRenderCreateLinearGradient _int_consume
+
+typedef struct _XLinearGradient {
+ XPointFixed p1;
+ XPointFixed p2;
+} XLinearGradient;
+#endif
+
+#if !HAVE_XRENDERCREATERADIALGRADIENT
#define XRenderCreateRadialGradient _int_consume
-#define XRenderCreateConicalGradient _int_consume
+
typedef struct _XCircle {
XFixed x;
XFixed y;
XFixed radius;
} XCircle;
-typedef struct _XLinearGradient {
- XPointFixed p1;
- XPointFixed p2;
-} XLinearGradient;
-
typedef struct _XRadialGradient {
XCircle inner;
XCircle outer;
} XRadialGradient;
+#endif
+
+#if !HAVE_XRENDERCREATECONICALGRADIENT
+#define XRenderCreateConicalGradient _int_consume
typedef struct _XConicalGradient {
XPointFixed center;