[cairo-commit] boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-xlib.c boilerplate/cairo-boilerplate-xlib-private.h boilerplate/Makefile.am src/cairo-freelist-private.h src/cairo-xlib-display.c src/cairo-xlib-private.h src/cairo-xlib-screen.c src/cairo-xlib-surface.c src/cairo-xlib-surface-private.h src/cairo-xlib-xrender.h src/cairo-xlib-xrender-private.h src/Makefile.am test/xlib-surface.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue Jan 15 05:11:33 PST 2008
boilerplate/Makefile.am | 2 -
boilerplate/cairo-boilerplate-xlib-private.h | 2 +
boilerplate/cairo-boilerplate-xlib.c | 29 +++++++++++++++------------
boilerplate/cairo-boilerplate.c | 2 -
src/Makefile.am | 2 -
src/cairo-freelist-private.h | 3 --
src/cairo-xlib-display.c | 1
src/cairo-xlib-private.h | 6 -----
src/cairo-xlib-screen.c | 1
src/cairo-xlib-surface-private.h | 2 +
src/cairo-xlib-surface.c | 6 +++++
src/cairo-xlib-xrender-private.h | 3 --
src/cairo-xlib-xrender.h | 8 +++----
test/xlib-surface.c | 1
14 files changed, 38 insertions(+), 30 deletions(-)
New commits:
commit 968eaf3c44f37ada9c1d7005fc84ead797e11b58
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jan 14 18:09:32 2008 +0000
[cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 7dd9c4d..1d9c342 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -77,7 +77,7 @@ libcairoboilerplate_la_SOURCES += cairo-boilerplate-xcb.c
libcairoboilerplate_la_SOURCES += cairo-boilerplate-xcb-private.h
endif
-if CAIRO_HAS_XLIB_XRENDER_SURFACE
+if CAIRO_HAS_XLIB_SURFACE
libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib.c
libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib.h
libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib-private.h
diff --git a/boilerplate/cairo-boilerplate-xlib-private.h b/boilerplate/cairo-boilerplate-xlib-private.h
index 65da947..54c631c 100644
--- a/boilerplate/cairo-boilerplate-xlib-private.h
+++ b/boilerplate/cairo-boilerplate-xlib-private.h
@@ -27,6 +27,7 @@
#ifndef _CAIRO_BOILERPLATE_XLIB_PRIVATE_H_
#define _CAIRO_BOILERPLATE_XLIB_PRIVATE_H_
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
cairo_surface_t *
_cairo_boilerplate_xlib_create_surface (const char *name,
cairo_content_t content,
@@ -34,6 +35,7 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
int height,
cairo_boilerplate_mode_t mode,
void **closure);
+#endif
cairo_surface_t *
_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 28d1a2e..93000d0 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -28,9 +28,14 @@
#include "cairo-boilerplate-xlib.h"
#include "cairo-boilerplate-xlib-private.h"
+#include <cairo-xlib.h>
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
#include <cairo-xlib-xrender.h>
+#endif
#include <cairo-xlib-surface-private.h>
+#include <X11/Xutil.h> /* for XDestroyImage */
+
typedef struct _xlib_target_closure
{
Display *dpy;
@@ -50,6 +55,17 @@ _cairo_boilerplate_xlib_synchronize (void *closure)
XDestroyImage (ximage);
}
+static cairo_bool_t
+_cairo_boilerplate_xlib_check_screen_size (Display *dpy,
+ int screen,
+ int width,
+ int height)
+{
+ Screen *scr = XScreenOfDisplay (dpy, screen);
+ return width <= WidthOfScreen (scr) && height <= HeightOfScreen (scr);
+}
+
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
/* For the xlib backend we distinguish between TEST and PERF mode in a
* couple of ways.
*
@@ -110,18 +126,6 @@ _cairo_boilerplate_xlib_test_create_surface (Display *dpy,
width, height);
}
-
-static cairo_bool_t
-_cairo_boilerplate_xlib_check_screen_size (Display *dpy,
- int screen,
- int width,
- int height)
-{
- Screen *scr = XScreenOfDisplay (dpy, screen);
- return width <= WidthOfScreen (scr) && height <= HeightOfScreen (scr);
-}
-
-
static cairo_surface_t *
_cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
cairo_content_t content,
@@ -210,6 +214,7 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
else /* mode == CAIRO_BOILERPLATE_MODE_PERF */
return _cairo_boilerplate_xlib_perf_create_surface (dpy, content, width, height, xtc);
}
+#endif
/* The xlib-fallback target differs from the xlib target in two ways:
*
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index e92e2a6..a4c2114 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -57,7 +57,7 @@
#if CAIRO_HAS_XCB_SURFACE
#include "cairo-boilerplate-xcb-private.h"
#endif
-#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+#if CAIRO_HAS_XLIB_SURFACE
#include "cairo-boilerplate-xlib-private.h"
#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 24d3f35..172e062 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,7 +47,7 @@ libcairo_test_sources = test-fallback-surface.c test-fallback-surface.h \
endif
if CAIRO_HAS_XLIB_SURFACE
-libcairo_xlib_headers = cairo-xlib.h cairo-xlib-xrender.h
+libcairo_xlib_headers = cairo-xlib.h
libcairo_xlib_sources = cairo-xlib-surface.c \
cairo-xlib-surface-private.h \
cairo-xlib-display.c \
diff --git a/src/cairo-freelist-private.h b/src/cairo-freelist-private.h
index 7e2036c..0d02127 100644
--- a/src/cairo-freelist-private.h
+++ b/src/cairo-freelist-private.h
@@ -22,8 +22,7 @@
#ifndef CAIRO_FREELIST_H
#define CAIRO_FREELIST_H
-#include "cairoint.h"
-#include <stddef.h>
+#include "cairo-types-private.h"
/* Opaque implementation types. */
typedef struct _cairo_freelist cairo_freelist_t;
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index 430f1ce..8b1fa0a 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -34,6 +34,7 @@
#include "cairoint.h"
#include "cairo-xlib-private.h"
+#include "cairo-xlib-xrender-private.h"
#include <fontconfig/fontconfig.h>
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h
index 05c7d0e..3e04ecd 100644
--- a/src/cairo-xlib-private.h
+++ b/src/cairo-xlib-private.h
@@ -33,16 +33,12 @@
#ifndef CAIRO_XLIB_PRIVATE_H
#define CAIRO_XLIB_PRIVATE_H
-#include "cairoint.h"
-
#include "cairo-xlib.h"
#include "cairo-compiler-private.h"
#include "cairo-freelist-private.h"
+#include "cairo-mutex-private.h"
#include "cairo-reference-count-private.h"
-#include "cairo-xlib-xrender-private.h"
-
-#include <X11/Xutil.h> /* for XDestroyImage */
typedef struct _cairo_xlib_display cairo_xlib_display_t;
typedef struct _cairo_xlib_hook cairo_xlib_hook_t;
diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c
index 578a33a..f8d5936 100644
--- a/src/cairo-xlib-screen.c
+++ b/src/cairo-xlib-screen.c
@@ -55,6 +55,7 @@
#include "cairoint.h"
#include "cairo-xlib-private.h"
+#include "cairo-xlib-xrender-private.h"
#include <fontconfig/fontconfig.h>
diff --git a/src/cairo-xlib-surface-private.h b/src/cairo-xlib-surface-private.h
index 3bbf43e..e5ccf90 100644
--- a/src/cairo-xlib-surface-private.h
+++ b/src/cairo-xlib-surface-private.h
@@ -34,6 +34,8 @@
#define CAIRO_XLIB_SURFACE_PRIVATE_H
#include "cairo-xlib.h"
+#include "cairo-xlib-private.h"
+#include "cairo-xlib-xrender-private.h"
#include "cairo-surface-private.h"
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 129277c..bd1a3e8 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -42,6 +42,8 @@
#include "cairo-xlib-surface-private.h"
#include "cairo-clip-private.h"
+#include <X11/Xutil.h> /* for XDestroyImage */
+
/* Xlib doesn't define a typedef, so define one ourselves */
typedef int (*cairo_xlib_error_func_t) (Display *display,
XErrorEvent *event);
@@ -69,6 +71,10 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst,
int num_glyphs,
cairo_scaled_font_t *scaled_font);
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format);
+#endif
+
/*
* Instead of taking two round trips for each blending request,
* assume that if a particular drawable fails GetImage that it will
diff --git a/src/cairo-xlib-xrender-private.h b/src/cairo-xlib-xrender-private.h
index db27c24..11bbbeb 100644
--- a/src/cairo-xlib-xrender-private.h
+++ b/src/cairo-xlib-xrender-private.h
@@ -33,12 +33,9 @@
#ifndef CAIRO_XLIB_XRENDER_PRIVATE_H
#define CAIRO_XLIB_XRENDER_PRIVATE_H
-#include "cairoint.h"
-
#if CAIRO_HAS_XLIB_XRENDER_SURFACE
#include "cairo-xlib-xrender.h"
-slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format);
#include <X11/extensions/Xrender.h>
#include <X11/extensions/renderproto.h>
diff --git a/src/cairo-xlib-xrender.h b/src/cairo-xlib-xrender.h
index f5c35dc..572049d 100644
--- a/src/cairo-xlib-xrender.h
+++ b/src/cairo-xlib-xrender.h
@@ -39,7 +39,7 @@
#include <cairo.h>
-#if CAIRO_HAS_XLIB_SURFACE
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
@@ -56,8 +56,8 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy,
CAIRO_END_DECLS
-#else /* CAIRO_HAS_XLIB_SURFACE */
-# error Cairo was not compiled with support for the xlib backend
-#endif /* CAIRO_HAS_XLIB_SURFACE */
+#else /* CAIRO_HAS_XLIB_XRENDER_SURFACE */
+# error Cairo was not compiled with support for the xlib XRender backend
+#endif /* CAIRO_HAS_XLIB_XRENDER_SURFACE */
#endif /* CAIRO_XLIB_XRENDER_H */
diff --git a/test/xlib-surface.c b/test/xlib-surface.c
index a1578cd..d958349 100644
--- a/test/xlib-surface.c
+++ b/test/xlib-surface.c
@@ -28,7 +28,6 @@
#include "cairo.h"
#include "cairo-xlib.h"
-#include "cairo-xlib-xrender.h"
#include "cairo-test.h"
#include "cairo-boilerplate-xlib.h"
More information about the cairo-commit
mailing list