mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 17:30:19 +01:00
[cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when configured with --disable-xlib-xrender.
This commit is contained in:
parent
22d7f311f7
commit
968eaf3c44
14 changed files with 38 additions and 30 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-xlib-private.h"
|
||||
#include "cairo-xlib-xrender-private.h"
|
||||
|
||||
#include <fontconfig/fontconfig.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;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include "cairoint.h"
|
||||
|
||||
#include "cairo-xlib-private.h"
|
||||
#include "cairo-xlib-xrender-private.h"
|
||||
|
||||
#include <fontconfig/fontconfig.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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue