[cairo-commit] 2 commits - configure.ac src/cairo-xlib-surface-shm.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Oct 28 03:15:13 PDT 2012
configure.ac | 4 +
src/cairo-xlib-surface-shm.c | 103 +++++++++++++++++++++++++++++++++++++++++--
2 files changed, 104 insertions(+), 3 deletions(-)
New commits:
commit 0e2458697848cf8c89c9d57fa9b64f0ea7bd0877
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Oct 28 10:08:39 2012 +0000
xlib/shm: Use shmstr.h instead of shmproto.h if available
Before it was known as shmproto.h, the wire protocol definition was to
be found in shmstr.h, so if we don't have the current version of libXext
try to use the older includes.
Reported-by: Sebastian Haas <sehaas at gmail.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/configure.ac b/configure.ac
index 021ec8e..f523284 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [
AC_MSG_RESULT(assuming no))
fi
- AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h], [], [],
+ AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [],
[#include <X11/Xlibint.h>
#include <X11/Xproto.h>])
])
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index a3d4385..44e6284 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -42,7 +42,7 @@
#include "cairo-xlib-private.h"
#include "cairo-xlib-surface-private.h"
-#if !HAVE_X11_EXTENSIONS_XSHM_H || !HAVE_X11_EXTENSIONS_SHMPROTO_H
+#if !HAVE_X11_EXTENSIONS_XSHM_H || !(HAVE_X11_EXTENSIONS_SHMPROTO_H || HAVE_X11_EXTENSIONS_SHMSTR_H)
void _cairo_xlib_display_init_shm (cairo_xlib_display_t *display) {}
cairo_surface_t *
@@ -144,7 +144,11 @@ void _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display) {}
#include <X11/Xlibint.h>
#include <X11/Xproto.h>
#include <X11/extensions/XShm.h>
+#if HAVE_X11_EXTENSIONS_SHMPROTO_H
#include <X11/extensions/shmproto.h>
+#elif HAVE_X11_EXTENSIONS_SHMSTR_H
+#include <X11/extensions/shmstr.h>
+#endif
#include <sys/ipc.h>
#include <sys/shm.h>
commit f18199fcfb3b052c198041fc05156ae3d9e6aee7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Oct 28 10:04:12 2012 +0000
xlib/shm: Check for XShm headers
Not all version of libXext ship the same set of headers, so play safe
and check during configure that we have the headers we depend upon in
the code.
Reported-by: Sebastian Haas <sehaas at gmail.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/configure.ac b/configure.ac
index 7adbeb1..021ec8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,6 +105,10 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [
AC_MSG_RESULT(no),
AC_MSG_RESULT(assuming no))
fi
+
+ AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h], [], [],
+ [#include <X11/Xlibint.h>
+ #include <X11/Xproto.h>])
])
CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 89f51a9..a3d4385 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -41,12 +41,105 @@
#include "cairo-xlib-private.h"
#include "cairo-xlib-surface-private.h"
-#include "cairo-image-surface-private.h"
-#include "cairo-mempool-private.h"
+
+#if !HAVE_X11_EXTENSIONS_XSHM_H || !HAVE_X11_EXTENSIONS_SHMPROTO_H
+void _cairo_xlib_display_init_shm (cairo_xlib_display_t *display) {}
+
+cairo_surface_t *
+_cairo_xlib_surface_get_shm (cairo_xlib_surface_t *surface,
+ cairo_bool_t overwrite)
+{
+ return NULL;
+}
+
+cairo_int_status_t
+_cairo_xlib_surface_put_shm (cairo_xlib_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return CAIRO_INT_STATUS_SUCCESS;
+}
+
+cairo_surface_t *
+_cairo_xlib_surface_create_shm (cairo_xlib_surface_t *other,
+ pixman_format_code_t format,
+ int width, int height)
+{
+ return NULL;
+}
+
+cairo_surface_t *
+_cairo_xlib_surface_create_shm__image (cairo_xlib_surface_t *surface,
+ pixman_format_code_t format,
+ int width, int height)
+{
+ return NULL;
+}
+
+cairo_surface_t *
+_cairo_xlib_surface_create_similar_shm (void *other,
+ cairo_format_t format,
+ int width, int height)
+{
+ return cairo_image_surface_create (format, width, height);
+}
+
+void
+_cairo_xlib_shm_surface_mark_active (cairo_surface_t *_shm)
+{
+ ASSERT_NOT_REACHED;
+}
+
+void
+_cairo_xlib_shm_surface_get_ximage (cairo_surface_t *surface,
+ XImage *ximage)
+{
+ ASSERT_NOT_REACHED;
+}
+
+void *
+_cairo_xlib_shm_surface_get_obdata (cairo_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return NULL;
+}
+
+Pixmap
+_cairo_xlib_shm_surface_get_pixmap (cairo_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return 0;
+}
+
+XRenderPictFormat *
+_cairo_xlib_shm_surface_get_xrender_format (cairo_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return NULL;
+}
+
+cairo_bool_t
+_cairo_xlib_shm_surface_is_active (cairo_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return FALSE;
+}
+
+cairo_bool_t
+_cairo_xlib_shm_surface_is_idle (cairo_surface_t *surface)
+{
+ ASSERT_NOT_REACHED;
+ return TRUE;
+}
+
+void _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display) {}
+
+#else
#include "cairo-damage-private.h"
#include "cairo-default-context-private.h"
+#include "cairo-image-surface-private.h"
#include "cairo-list-inline.h"
+#include "cairo-mempool-private.h"
#include <X11/Xlibint.h>
#include <X11/Xproto.h>
@@ -1281,5 +1374,5 @@ _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display)
free (shm);
display->shm = NULL;
}
-
+#endif
#endif
More information about the cairo-commit
mailing list