diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-14 18:09:32 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-15 13:08:53 +0000 |
commit | 968eaf3c44f37ada9c1d7005fc84ead797e11b58 (patch) | |
tree | d4ada613243a607e35274eb22cf37b2625fc8885 /boilerplate | |
parent | 22d7f311f7733a57ece5d91708b2b5da9b71de86 (diff) |
[cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/Makefile.am | 2 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate-xlib-private.h | 2 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate-xlib.c | 29 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 2 |
4 files changed, 21 insertions, 14 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index 7dd9c4d98..1d9c3422f 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 65da94762..54c631cc7 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 28d1a2e24..93000d04a 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 e92e2a611..a4c2114b2 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 |