[cairo-commit] 12 commits - boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-directfb.c boilerplate/cairo-boilerplate-drm.c boilerplate/cairo-boilerplate-egl.c boilerplate/cairo-boilerplate-glx.c boilerplate/cairo-boilerplate.h boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-quartz.c boilerplate/cairo-boilerplate-script.c boilerplate/cairo-boilerplate-skia.c boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/cairo-boilerplate-vg.c boilerplate/cairo-boilerplate-wgl.c boilerplate/cairo-boilerplate-win32.c boilerplate/cairo-boilerplate-win32-printing.c boilerplate/cairo-boilerplate-xcb.c boilerplate/cairo-boilerplate-xlib.c boilerplate/Makefile.win32.features build/aclocal.dolt.m4 build/aclocal.shave.m4 build/.gitignore build/Makefile.win32.features-h build/shave.in build/shave-libtool.in configure.ac Makefile.am perf/cairo-perf-trace.c src/cairo-surface.c src/cairo-surface-sub surface.c src/Makefile.win32.features test/api-special-cases.c test/api-special-cases.ref.png test/Makefile.sources

Benjamin Otte company at kemper.freedesktop.org
Mon Jul 5 09:39:25 PDT 2010


 Makefile.am                                    |    5 
 boilerplate/Makefile.win32.features            |    8 
 boilerplate/cairo-boilerplate-directfb.c       |    4 
 boilerplate/cairo-boilerplate-drm.c            |    2 
 boilerplate/cairo-boilerplate-egl.c            |    1 
 boilerplate/cairo-boilerplate-glx.c            |   25 +
 boilerplate/cairo-boilerplate-pdf.c            |    4 
 boilerplate/cairo-boilerplate-ps.c             |    8 
 boilerplate/cairo-boilerplate-quartz.c         |    5 
 boilerplate/cairo-boilerplate-script.c         |    2 
 boilerplate/cairo-boilerplate-skia.c           |    4 
 boilerplate/cairo-boilerplate-svg.c            |    8 
 boilerplate/cairo-boilerplate-test-surfaces.c  |   16 -
 boilerplate/cairo-boilerplate-vg.c             |    4 
 boilerplate/cairo-boilerplate-wgl.c            |    2 
 boilerplate/cairo-boilerplate-win32-printing.c |    4 
 boilerplate/cairo-boilerplate-win32.c          |    4 
 boilerplate/cairo-boilerplate-xcb.c            |    7 
 boilerplate/cairo-boilerplate-xlib.c           |    4 
 boilerplate/cairo-boilerplate.c                |   19 +
 boilerplate/cairo-boilerplate.h                |    4 
 build/.gitignore                               |    2 
 build/Makefile.win32.features-h                |    1 
 build/aclocal.dolt.m4                          |  178 ------------
 build/aclocal.shave.m4                         |   77 -----
 build/shave-libtool.in                         |   69 ----
 build/shave.in                                 |   82 -----
 configure.ac                                   |    6 
 perf/cairo-perf-trace.c                        |   31 ++
 src/Makefile.win32.features                    |    8 
 src/cairo-surface-subsurface.c                 |    2 
 src/cairo-surface.c                            |    8 
 test/Makefile.sources                          |    1 
 test/api-special-cases.c                       |  360 +++++++++++++++++++++++++
 test/api-special-cases.ref.png                 |binary
 35 files changed, 515 insertions(+), 450 deletions(-)

New commits:
commit 9de25a0297c141a0776835920168afaa3ca77a87
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:33:40 2010 +0200

    configure: remove dolt
    
    libtool should be fast by now

diff --git a/Makefile.am b/Makefile.am
index dd72661..aa78455 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,9 +53,8 @@ EXTRA_DIST += \
 	cairo-version.h \
 	$(NULL)
 
-DISTCLEANFILES += config.cache	\
-		  doltlibtool	\
-		  doltcompile
+DISTCLEANFILES += config.cache
+
 MAINTAINERCLEANFILES += \
 	$(srcdir)/aclocal.m4 \
 	$(srcdir)/autoscan.log \
diff --git a/build/aclocal.dolt.m4 b/build/aclocal.dolt.m4
deleted file mode 100644
index ece5eea..0000000
--- a/build/aclocal.dolt.m4
+++ /dev/null
@@ -1,178 +0,0 @@
-dnl dolt, a replacement for libtool
-dnl Copyright © 2007-2008 Josh Triplett <josh at freedesktop.org>
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-dnl
-dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
-dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
-dnl installed when running autoconf on your project.
-
-AC_DEFUN([DOLT], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-# dolt, a replacement for libtool
-# Josh Triplett <josh at freedesktop.org>
-AC_PATH_PROG(DOLT_BASH, bash)
-AC_MSG_CHECKING([if dolt supports this host])
-dolt_supported=yes
-if test x$DOLT_BASH = x; then
-    dolt_supported=no
-fi
-if test x$GCC != xyes; then
-    dolt_supported=no
-fi
-case $host in
-i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
-|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
-    pic_options='-fPIC'
-    ;;
-i?86-apple-darwin*)
-    pic_options='-fno-common'
-    ;;
-*)
-    dolt_supported=no
-    ;;
-esac
-if test x$dolt_supported = xno ; then
-    AC_MSG_RESULT([no, falling back to libtool])
-    LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
-    LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
-else
-    AC_MSG_RESULT([yes, replacing libtool])
-
-dnl Start writing out doltcompile.
-    cat <<__DOLTCOMPILE__EOF__ >doltcompile
-#!$DOLT_BASH
-__DOLTCOMPILE__EOF__
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-args=("$[]@")
-for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
-    if test x"${args@<:@$arg@:>@}" = x-o ; then
-        objarg=$((arg+1))
-        break
-    fi
-done
-if test x$objarg = x ; then
-    echo 'Error: no -o on compiler command line' 1>&2
-    exit 1
-fi
-lo="${args@<:@$objarg@:>@}"
-obj="${lo%.lo}"
-if test x"$lo" = x"$obj" ; then
-    echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
-    exit 1
-fi
-objbase="${obj##*/}"
-__DOLTCOMPILE__EOF__
-
-dnl Write out shared compilation code.
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-libobjdir="${obj%$objbase}.libs"
-if test ! -d "$libobjdir" ; then
-    mkdir_out="$(mkdir "$libobjdir" 2>&1)"
-    mkdir_ret=$?
-    if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
-	echo "$mkdir_out" 1>&2
-        exit $mkdir_ret
-    fi
-fi
-pic_object="$libobjdir/$objbase.o"
-args@<:@$objarg@:>@="$pic_object"
-__DOLTCOMPILE__EOF__
-    cat <<__DOLTCOMPILE__EOF__ >>doltcompile
-"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
-__DOLTCOMPILE__EOF__
-    fi
-
-dnl Write out static compilation code.
-dnl Avoid duplicate compiler output if also building shared objects.
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-non_pic_object="$obj.o"
-args@<:@$objarg@:>@="$non_pic_object"
-__DOLTCOMPILE__EOF__
-        if test x$enable_shared = xyes; then
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
-__DOLTCOMPILE__EOF__
-        else
-            cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" || exit $?
-__DOLTCOMPILE__EOF__
-        fi
-    fi
-
-dnl Write out the code to write the .lo file.
-dnl The second line of the .lo file must match "^# Generated by .*libtool"
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-{
-echo "# $lo - a libtool object file"
-echo "# Generated by doltcompile, not libtool"
-__DOLTCOMPILE__EOF__
-
-    if test x$enable_shared = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "pic_object='.libs/${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    if test x$enable_static = xyes; then
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "non_pic_object='${objbase}.o'"
-__DOLTCOMPILE__EOF__
-    else
-        cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo non_pic_object=none
-__DOLTCOMPILE__EOF__
-    fi
-
-    cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-} > "$lo"
-__DOLTCOMPILE__EOF__
-
-dnl Done writing out doltcompile; substitute it for libtool compilation.
-    chmod +x doltcompile
-    LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
-    LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
-
-dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
-dnl a target, so write out a libtool wrapper to handle that case.
-dnl Note that doltlibtool does not handle inferred tags or option arguments
-dnl without '=', because automake does not use them.
-    cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
-#!$DOLT_BASH
-__DOLTLIBTOOL__EOF__
-    cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
-top_builddir_slash="${0%%doltlibtool}"
-: ${top_builddir_slash:=./}
-args=()
-modeok=false
-tagok=false
-for arg in "$[]@"; do
-    case "$arg" in
-	--silent) ;;
-        --mode=compile) modeok=true ;;
-        --tag=CC|--tag=CXX) tagok=true ;;
-        *) args@<:@${#args[@]}@:>@="$arg" ;;
-    esac
-done
-if $modeok && $tagok ; then
-    . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
-else
-    exec ${top_builddir_slash}libtool "$[]@"
-fi
-__DOLTLIBTOOL__EOF__
-
-dnl Done writing out doltlibtool; substitute it for libtool.
-    chmod +x doltlibtool
-    LIBTOOL='$(top_builddir)/doltlibtool'
-fi
-AC_SUBST(LTCOMPILE)
-AC_SUBST(LTCXXCOMPILE)
-# end dolt
-])
diff --git a/configure.ac b/configure.ac
index 43c3b19..8d2c007 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,6 @@ AM_INIT_AUTOMAKE([1.9.6 gnu -Wall no-define])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_LIBTOOL_WIN32_DLL dnl Must be called before AC_PROG_LIBTOOL
 AC_PROG_LIBTOOL dnl ([1.4]) Don't remove!
-DOLT dnl Make my libtool fast!
 GTK_DOC_CHECK([1.6])
 
 AC_SYS_LARGEFILE
commit 6744b78de17930285569da2158a334763e2bd333
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:25:31 2010 +0200

    subsurface: Fail if created from a finished surface
    
    Caught by api-special-cases test

diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index c8d785b..f39dcd2 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -496,6 +496,8 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
 
     if (unlikely (target->status))
 	return _cairo_surface_create_in_error (target->status);
+    if (unlikely (target->finished))
+	return _cairo_surface_create_in_error (CAIRO_STATUS_SURFACE_FINISHED);
 
     surface = malloc (sizeof (cairo_surface_subsurface_t));
     if (unlikely (surface == NULL))
commit 8fd1ecea12f15c2bda710065909a14415ba92bd8
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:25:16 2010 +0200

    surface: Fail if set_mime_data() is called on a finished surface
    
    Caught by api-special-cases test

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index d0e3a55..a5439c2 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -857,6 +857,8 @@ cairo_surface_set_mime_data (cairo_surface_t		*surface,
 
     if (unlikely (surface->status))
 	return surface->status;
+    if (surface->finished)
+	return _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
 
     status = _cairo_intern_string (&mime_type, -1);
     if (unlikely (status))
commit e388ff1ae732970d6166780817ec121cf58ccd0e
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:24:23 2010 +0200

    surface: Fail early if create_similar() is called on a finished surface
    
    Caught by api-special-cases test

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 642a75b..d0e3a55 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -453,6 +453,8 @@ cairo_surface_create_similar (cairo_surface_t  *other,
 {
     if (unlikely (other->status))
 	return _cairo_surface_create_in_error (other->status);
+    if (unlikely (other->finished))
+	return _cairo_surface_create_in_error (CAIRO_STATUS_SURFACE_FINISHED);
 
     if (unlikely (! CAIRO_CONTENT_VALID (content)))
 	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_CONTENT));
commit c1689ef6f27f99c36e1a5f4de658363ca0aad25a
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:23:37 2010 +0200

    surface: don't call begin_modification on finished surfaces
    
    Fixes https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/600622
    
    Caught by api-special-cases test

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 8806f13..642a75b 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -2346,14 +2346,14 @@ cairo_surface_show_page (cairo_surface_t *surface)
     if (surface->status)
 	return;
 
-    _cairo_surface_begin_modification (surface);
-
     if (surface->finished) {
 	status_ignored = _cairo_surface_set_error (surface,
 		                                 CAIRO_STATUS_SURFACE_FINISHED);
 	return;
     }
 
+    _cairo_surface_begin_modification (surface);
+
     /* It's fine if some backends don't implement show_page */
     if (surface->backend->show_page == NULL)
 	return;
commit cf0245c1201d4884ff19e881e9c118784fa14884
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 18:17:09 2010 +0200

    tests: Add a testcase that checks APIs work consistently
    
    In particular, it checks that finished and surfaces in an error state do
    not do bad things, like cause crashes.
    So far this test only checks surface APIs, but it should be extended to
    cover all APIs.
    
    Please update this test when new APIs get added.
    
    Motivated by https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/600622

diff --git a/test/Makefile.sources b/test/Makefile.sources
index d6c84a0..99aab70 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -8,6 +8,7 @@ test_sources = \
 	a8-mask.c					\
 	aliasing.c					\
 	alpha-similar.c					\
+	api-special-cases.c				\
 	big-line.c					\
 	big-trap.c					\
 	bilevel-image.c					\
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
new file mode 100644
index 0000000..ebac5c5
--- /dev/null
+++ b/test/api-special-cases.c
@@ -0,0 +1,360 @@
+/*
+ * Copyright © 2010 Red Hat Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Benjamin Otte <otte at redhat.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <limits.h>
+
+#include "cairo-test.h"
+
+#if CAIRO_HAS_GL_SURFACE
+#include <cairo-gl.h>
+#endif
+#if CAIRO_HAS_OS2_SURFACE
+#include <cairo-os2.h>
+#endif
+#if CAIRO_HAS_PDF_SURFACE
+#include <cairo-pdf.h>
+#endif
+#if CAIRO_HAS_PS_SURFACE
+#include <cairo-ps.h>
+#endif
+#if CAIRO_HAS_XCB_SURFACE
+#include <cairo-xcb.h>
+#endif
+#if CAIRO_HAS_XLIB_SURFACE
+#include <cairo-xlib.h>
+#endif
+
+#define ARRAY_LENGTH(array) (sizeof (array) / sizeof ((array)[0]))
+
+typedef cairo_test_status_t (* surface_test_func_t) (cairo_surface_t *surface);
+
+static cairo_test_status_t
+test_cairo_surface_create_similar (cairo_surface_t *surface)
+{
+    cairo_surface_t *similar;
+    
+    similar = cairo_surface_create_similar (surface, CAIRO_CONTENT_ALPHA, 100, 100);
+    
+    cairo_surface_destroy (similar);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_create_for_rectangle (cairo_surface_t *surface)
+{
+    cairo_surface_t *similar;
+    
+    similar = cairo_surface_create_for_rectangle (surface, 1, 1, 8, 8);
+    
+    cairo_surface_destroy (similar);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_reference (cairo_surface_t *surface)
+{
+    cairo_surface_destroy (cairo_surface_reference (surface));
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_finish (cairo_surface_t *surface)
+{
+    cairo_surface_finish (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_device (cairo_surface_t *surface)
+{
+    /* cairo_device_t *device = */cairo_surface_get_device (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_reference_count (cairo_surface_t *surface)
+{
+    unsigned int refcount = cairo_surface_get_reference_count (surface);
+    if (refcount > 0)
+        return CAIRO_TEST_SUCCESS;
+    /* inert error surfaces have a refcount of 0 */
+    return cairo_surface_status (surface) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_surface_status (cairo_surface_t *surface)
+{
+    cairo_status_t status = cairo_surface_status (surface);
+    return status < CAIRO_STATUS_LAST_STATUS ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_type (cairo_surface_t *surface)
+{
+    /* cairo_surface_type_t type = */cairo_surface_get_type (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_content (cairo_surface_t *surface)
+{
+    cairo_content_t content = cairo_surface_get_content (surface);
+
+    switch (content) {
+    case CAIRO_CONTENT_COLOR:
+    case CAIRO_CONTENT_ALPHA:
+    case CAIRO_CONTENT_COLOR_ALPHA:
+        return CAIRO_TEST_SUCCESS;
+    default:
+        return CAIRO_TEST_ERROR;
+    }
+}
+
+static cairo_test_status_t
+test_cairo_surface_set_user_data (cairo_surface_t *surface)
+{
+    static cairo_user_data_key_t key;
+    cairo_status_t status;
+
+    status = cairo_surface_set_user_data (surface, &key, &key, NULL);
+    if (status == CAIRO_STATUS_NO_MEMORY)
+        return CAIRO_TEST_NO_MEMORY;
+    else if (status)
+        return CAIRO_TEST_SUCCESS;
+
+    if (cairo_surface_get_user_data (surface, &key) != &key)
+        return CAIRO_TEST_ERROR;
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_set_mime_data (cairo_surface_t *surface)
+{
+    const char *mimetype = "text/x-uri";
+    const char *data = "http://www.cairographics.org";
+    cairo_status_t status;
+
+    status = cairo_surface_set_mime_data (surface,
+                                          mimetype,
+                                          (const unsigned char *) data, strlen (data),
+                                          NULL, NULL);
+    return status ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_mime_data (cairo_surface_t *surface)
+{
+    const char *mimetype = "text/x-uri";
+    const unsigned char *data;
+    unsigned int length;
+
+    cairo_surface_get_mime_data (surface, mimetype, &data, &length);
+    return data == NULL && length == 0 ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_font_options (cairo_surface_t *surface)
+{
+    cairo_font_options_t *options;
+    cairo_status_t status;
+
+    options = cairo_font_options_create ();
+    if (likely (!cairo_font_options_status (options)))
+        cairo_surface_get_font_options (surface, options);
+    status = cairo_font_options_status (options);
+    cairo_font_options_destroy (options);
+    return status ? CAIRO_TEST_ERROR : CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_flush (cairo_surface_t *surface)
+{
+    cairo_surface_flush (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_mark_dirty (cairo_surface_t *surface)
+{
+    cairo_surface_mark_dirty (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface)
+{
+    cairo_surface_mark_dirty_rectangle (surface, 1, 1, 8, 8);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_set_device_offset (cairo_surface_t *surface)
+{
+    cairo_surface_set_device_offset (surface, 5, 5);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_device_offset (cairo_surface_t *surface)
+{
+    double x, y;
+
+    cairo_surface_get_device_offset (surface, &x, &y);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_set_fallback_resolution (cairo_surface_t *surface)
+{
+    cairo_surface_set_fallback_resolution (surface, 42, 42);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_get_fallback_resolution (cairo_surface_t *surface)
+{
+    double x, y;
+
+    cairo_surface_get_fallback_resolution (surface, &x, &y);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_copy_page (cairo_surface_t *surface)
+{
+    cairo_surface_copy_page (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_show_page (cairo_surface_t *surface)
+{
+    cairo_surface_show_page (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_surface_has_show_text_glyphs (cairo_surface_t *surface)
+{
+    cairo_surface_has_show_text_glyphs (surface);
+    return CAIRO_TEST_SUCCESS;
+}
+
+
+
+#define TEST(name, sets_status) { #name, test_ ## name, sets_status }
+
+struct {
+    const char *name;
+    surface_test_func_t func;
+    cairo_bool_t modifies_surface;
+} tests[] = {
+    TEST (cairo_surface_create_similar, FALSE),
+    TEST (cairo_surface_create_for_rectangle, FALSE),
+    TEST (cairo_surface_reference, FALSE),
+    TEST (cairo_surface_finish, TRUE),
+    TEST (cairo_surface_get_device, FALSE),
+    TEST (cairo_surface_get_reference_count, FALSE),
+    TEST (cairo_surface_status, FALSE),
+    TEST (cairo_surface_get_type, FALSE),
+    TEST (cairo_surface_get_content, FALSE),
+    TEST (cairo_surface_set_user_data, FALSE),
+    TEST (cairo_surface_set_mime_data, TRUE),
+    TEST (cairo_surface_get_mime_data, FALSE),
+    TEST (cairo_surface_get_font_options, FALSE),
+    TEST (cairo_surface_flush, TRUE),
+    TEST (cairo_surface_mark_dirty, TRUE),
+    TEST (cairo_surface_mark_dirty_rectangle, TRUE),
+    TEST (cairo_surface_set_device_offset, TRUE),
+    TEST (cairo_surface_get_device_offset, FALSE),
+    TEST (cairo_surface_set_fallback_resolution, TRUE),
+    TEST (cairo_surface_get_fallback_resolution, FALSE),
+    TEST (cairo_surface_copy_page, TRUE),
+    TEST (cairo_surface_show_page, TRUE),
+    TEST (cairo_surface_has_show_text_glyphs, FALSE)
+};
+
+static cairo_test_status_t
+preamble (cairo_test_context_t *ctx)
+{
+    return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+    const cairo_test_context_t *ctx = cairo_test_get_context (cr);
+    cairo_surface_t *similar, *target;
+    cairo_test_status_t test_status;
+    cairo_status_t status;
+    unsigned int i;
+
+    target = cairo_get_target (cr);
+
+    for (i = 0; i < ARRAY_LENGTH (tests); i++) {
+        similar = cairo_surface_create_similar (target,
+                                                cairo_surface_get_content (target),
+                                                10, 10);
+        cairo_surface_finish (similar);
+        test_status = tests[i].func (similar);
+        status = cairo_surface_status (similar);
+        cairo_surface_destroy (similar);
+
+        if (test_status != CAIRO_TEST_SUCCESS) {
+            cairo_test_log (ctx,
+                            "Failed test %s with %d\n",
+                            tests[i].name, (int) test_status);
+            return test_status;
+        }
+
+        if (tests[i].modifies_surface &&
+            strcmp (tests[i].name, "cairo_surface_finish") &&
+            strcmp (tests[i].name, "cairo_surface_flush") &&
+            status != CAIRO_STATUS_SURFACE_FINISHED) {
+            cairo_test_log (ctx,
+                            "Failed test %s: Finished surface not set into error state\n",
+                            tests[i].name);
+            return CAIRO_TEST_ERROR;
+        }
+    }
+
+    /* 565-compatible gray background */
+    cairo_set_source_rgb (cr, 0.51613, 0.55555, 0.51613);
+    cairo_paint (cr);
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+CAIRO_TEST (api_special_cases,
+	    "Check surface functions properly handle wrong surface arguments",
+	    "api", /* keywords */
+	    NULL, /* requirements */
+	    10, 10,
+	    preamble, draw)
diff --git a/test/api-special-cases.ref.png b/test/api-special-cases.ref.png
new file mode 100644
index 0000000..56b88a9
Binary files /dev/null and b/test/api-special-cases.ref.png differ
commit eb63284fc3ae9377003ca312be58ae8f5dbbfdbd
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 00:37:10 2010 +0200

    configure: Use automake silent rules
    
    This replaces shave usage.
    If silent rules are not available, don't use them.

diff --git a/configure.ac b/configure.ac
index a6819f8..43c3b19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,7 @@ AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_AUX_DIR(build)
 AC_CONFIG_MACRO_DIR(build)
 AM_INIT_AUTOMAKE([1.9.6 gnu -Wall no-define])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_LIBTOOL_WIN32_DLL dnl Must be called before AC_PROG_LIBTOOL
 AC_PROG_LIBTOOL dnl ([1.4]) Don't remove!
 DOLT dnl Make my libtool fast!
commit 68bbb6b4a0a3b9bc923ccf130b1ca4221a5e54bd
Author: Benjamin Otte <otte at redhat.com>
Date:   Mon Jul 5 00:35:39 2010 +0200

    configure: remove shave

diff --git a/build/.gitignore b/build/.gitignore
index ce1256a..53f31d7 100644
--- a/build/.gitignore
+++ b/build/.gitignore
@@ -10,5 +10,3 @@ mkinstalldirs
 #Makefile.win32.features-h
 libtool.m4
 lt*.m4
-shave
-shave-libtool
diff --git a/build/aclocal.shave.m4 b/build/aclocal.shave.m4
deleted file mode 100644
index 0a3509e..0000000
--- a/build/aclocal.shave.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-dnl Make automake/libtool output more friendly to humans
-dnl  Damien Lespiau <damien.lespiau at gmail.com>
-dnl
-dnl SHAVE_INIT([shavedir],[default_mode])
-dnl
-dnl shavedir: the directory where the shave scripts are, it defaults to
-dnl           $(top_builddir)
-dnl default_mode: (enable|disable) default shave mode.  This parameter
-dnl               controls shave's behaviour when no option has been
-dnl               given to configure.  It defaults to disable.
-dnl
-dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
-dnl   before AC_CONFIG_FILE/AC_OUTPUT is perfect.  This macro rewrites CC and
-dnl   LIBTOOL, you don't want the configure tests to have these variables
-dnl   re-defined.
-dnl * This macro requires GNU make's -s option.
-
-AC_DEFUN([_SHAVE_ARG_ENABLE],
-[
-  AC_ARG_ENABLE([shave],
-    AS_HELP_STRING(
-      [--enable-shave],
-      [use shave to make the build pretty [[default=$1]]]),,
-      [enable_shave=$1]
-    )
-])
-
-AC_DEFUN([SHAVE_INIT],
-[
-  dnl you can tweak the default value of enable_shave
-  m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)])
-
-  if test x"$enable_shave" = xyes; then
-    dnl where can we find the shave scripts?
-    m4_if([$1],,
-      [shavedir="$ac_pwd"],
-      [shavedir="$ac_pwd/$1"])
-    AC_SUBST(shavedir)
-
-    dnl make is now quiet
-    AC_SUBST([MAKEFLAGS], [-s])
-    AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
-
-    dnl we need sed
-    AC_CHECK_PROG(SED,sed,sed,false)
-
-    dnl substitute libtool
-    SHAVE_SAVED_LIBTOOL=$LIBTOOL
-    LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
-    AC_SUBST(LIBTOOL)
-
-    dnl substitute cc/cxx
-    SHAVE_SAVED_CC=$CC
-    SHAVE_SAVED_CXX=$CXX
-    SHAVE_SAVED_FC=$FC
-    SHAVE_SAVED_F77=$F77
-    SHAVE_SAVED_OBJC=$OBJC
-    CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}"
-    CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}"
-    FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}"
-    F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}"
-    OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}"
-    AC_SUBST(CC)
-    AC_SUBST(CXX)
-    AC_SUBST(FC)
-    AC_SUBST(F77)
-    AC_SUBST(OBJC)
-
-    V=@
-  else
-    V=1
-  fi
-  Q='$(V:1=)'
-  AC_SUBST(V)
-  AC_SUBST(Q)
-])
-
diff --git a/build/shave-libtool.in b/build/shave-libtool.in
deleted file mode 100644
index 1f3a720..0000000
--- a/build/shave-libtool.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-# we need sed
-SED=@SED@
-if test -z "$SED" ; then
-SED=sed
-fi
-
-lt_unmangle ()
-{
-   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
-}
-
-# the real libtool to use
-LIBTOOL="$1"
-shift
-
-# if 1, don't print anything, the underlaying wrapper will do it
-pass_though=0
-
-# scan the arguments, keep the right ones for libtool, and discover the mode
-preserved_args=
-while test "$#" -gt 0; do
-    opt="$1"
-    shift
-
-    case $opt in
-    --mode=*)
-        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
-        preserved_args="$preserved_args $opt"
-        ;;
-    -o)
-        lt_output="$1"
-        preserved_args="$preserved_args $opt"
-	;;
-    *)
-        preserved_args="$preserved_args $opt"
-        ;;
-      esac
-done
-
-case "$mode" in
-compile)
-    # shave will be called and print the actual CC/CXX/LINK line
-    preserved_args="$preserved_args --shave-mode=$mode"
-    pass_though=1
-    ;;
-link)
-    preserved_args="$preserved_args --shave-mode=$mode"
-    Q="  LINK  "
-    ;;
-*)
-    # let's u
-    # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
-    ;;
-esac
-
-lt_unmangle "$lt_output"
-output=$last_result
-
-if test -z $V; then
-    if test $pass_though -eq 0; then
-        echo "$Q$output"
-    fi
-    $LIBTOOL --silent $preserved_args
-else
-    echo $LIBTOOL $preserved_args
-    $LIBTOOL $preserved_args
-fi
diff --git a/build/shave.in b/build/shave.in
deleted file mode 100644
index a23ec29..0000000
--- a/build/shave.in
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-# we need sed
-SED=@SED@
-if test -z "$SED" ; then
-SED=sed
-fi
-
-lt_unmangle ()
-{
-   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
-}
-
-# the tool to wrap (cc, cxx, ar, ranlib, ..)
-tool="$1"
-shift
-
-# the reel tool (to call)
-REEL_TOOL="$1"
-shift
-
-pass_through=0
-preserved_args=
-while test "$#" -gt 0; do
-    opt="$1"
-    shift
-
-    case $opt in
-    --shave-mode=*)
-        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
-	;;
-    -o)
-        lt_output="$1"
-        preserved_args="$preserved_args $opt"
-	;;
-    *)
-        preserved_args="$preserved_args $opt"
-        ;;
-      esac
-done
-
-# mode=link is handled in the libtool wrapper
-case "$mode,$tool" in
-link,*)
-    pass_through=1
-    ;;
-*,cxx)
-    Q="  CXX   "
-    ;;
-*,cc)
-    Q="  CC    "
-    ;;
-*,fc)
-    Q="  FC    "
-    ;;
-*,f77)
-    Q="  F77   "
-    ;;
-*,objc)
-    Q="  OBJC   "
-    ;;
-*,*)
-    # should not happen
-    Q="  CC    "
-    ;;
-esac
-
-lt_unmangle "$lt_output"
-output=$last_result
-
-if test -z $V; then
-    if test "$output" = "/dev/null"; then
-	pass_through=1
-    fi
-    if test $pass_through -eq 0; then
-        echo "$Q$output"
-    fi
-    $REEL_TOOL $preserved_args
-else
-    echo $REEL_TOOL $preserved_args
-    $REEL_TOOL $preserved_args
-fi
diff --git a/configure.ac b/configure.ac
index 96fb4a0..a6819f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -781,11 +781,7 @@ dnl ===========================================================================
 PKG_CHECK_MODULES(gtk, "gtk+-2.0",have_gtk=yes, have_gtk=no)
 AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
 
-SHAVE_INIT([build], [enable]) # dnl Make the output pretty
-
 AC_CONFIG_FILES([
-build/shave
-build/shave-libtool
 Makefile
 boilerplate/Makefile
 src/Makefile
commit 9ce87c67ff64083ec48edfefe83a1df3756c364c
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Jul 3 02:54:55 2010 +0200

    perf: print comment describing backend
    
    Use the descibe string to output information about the backend we're
    testing.

diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 5afe9e7..d347908 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -273,7 +273,34 @@ interrupt (int sig)
 }
 
 static void
+describe (cairo_perf_t *perf,
+          void *closure)
+{
+    char *description = NULL;
+
+    if (perf->target->describe)
+        description = perf->target->describe (closure);
+
+    if (description == NULL)
+        return;
+
+    if (perf->raw) {
+        printf ("[ # ] %s: %s\n", perf->target->name, description);
+    }
+
+    if (perf->summary) {
+        fprintf (perf->summary,
+                 "[ # ] %8s: %s\n",
+                 perf->target->name,
+                 description);
+    }
+
+    free (description);
+}
+
+static void
 execute (cairo_perf_t	 *perf,
+         void            *closure,
 	 cairo_surface_t *target,
 	 const char	 *trace)
 {
@@ -316,6 +343,8 @@ execute (cairo_perf_t	 *perf,
 	first_run = FALSE;
     }
 
+    describe (perf, closure);
+
     times = perf->times;
 
     if (perf->summary) {
@@ -686,7 +715,7 @@ cairo_perf_trace (cairo_perf_t			   *perf,
 
     cairo_perf_timer_set_synchronize (target->synchronize, closure);
 
-    execute (perf, surface, trace);
+    execute (perf, closure, surface, trace);
 
     cairo_surface_destroy (surface);
 
commit fcfe7c67248ea171dc40c0dbd861e489a2df5941
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Jul 3 02:54:28 2010 +0200

    boilerplate: Add describe string
    
    Print the pixman version we're using

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 529a4f2..a77fa57 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -29,6 +29,8 @@
 #include "cairo-boilerplate-private.h"
 #include "cairo-boilerplate-scaled-font.h"
 
+#include <pixman.h>
+
 #include <cairo-types-private.h>
 #include <cairo-scaled-font-private.h>
 
@@ -166,6 +168,16 @@ _cairo_boilerplate_image16_create_surface (const char		     *name,
     return cairo_image_surface_create (CAIRO_FORMAT_RGB16_565, ceil (width), ceil (height));
 }
 
+static char *
+_cairo_boilerplate_image_describe (void *closure)
+{
+    char *s;
+  
+    xasprintf (&s, "pixman %s", pixman_version_string ());
+
+    return s;
+}
+
 #if CAIRO_HAS_RECORDING_SURFACE
 static cairo_surface_t *
 _cairo_boilerplate_recording_create_surface (const char 	       *name,
@@ -326,7 +338,8 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, NULL,
+	NULL, NULL,
+        _cairo_boilerplate_image_describe,
 	TRUE, FALSE, FALSE
     },
     {
@@ -336,7 +349,8 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, NULL,
+	NULL, NULL,
+        _cairo_boilerplate_image_describe,
 	FALSE, FALSE, FALSE
     },
     {
@@ -346,7 +360,8 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, NULL,
+	NULL, NULL,
+        _cairo_boilerplate_image_describe,
 	TRUE, FALSE, FALSE
     },
 #if CAIRO_HAS_RECORDING_SURFACE
commit 0a7135148a634ea6692a4edd83193870a5d526b3
Author: Benjamin Otte <otte at redhat.com>
Date:   Sat Jul 3 02:54:08 2010 +0200

    gl: Add describe string

diff --git a/boilerplate/cairo-boilerplate-glx.c b/boilerplate/cairo-boilerplate-glx.c
index 3fe7149..f419070 100644
--- a/boilerplate/cairo-boilerplate-glx.c
+++ b/boilerplate/cairo-boilerplate-glx.c
@@ -346,6 +346,27 @@ _cairo_boilerplate_gl_synchronize (void *closure)
     cairo_device_release (gltc->device);
 }
 
+static char *
+_cairo_boilerplate_gl_describe (void *closure)
+{
+    gl_target_closure_t *gltc = closure;
+    char *s;
+    const GLubyte *vendor, *renderer, *version;
+
+    if (cairo_device_acquire (gltc->device))
+	return NULL;
+
+    vendor   = glGetString (GL_VENDOR);
+    renderer = glGetString (GL_RENDERER);
+    version  = glGetString (GL_VERSION);
+
+    xasprintf (&s, "%s %s %s", vendor, renderer, version);
+
+    cairo_device_release (gltc->device);
+
+    return s;
+}
+
 static const cairo_boilerplate_target_t targets[] = {
     {
 	"gl", "gl", NULL, NULL,
@@ -357,7 +378,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
-        NULL,
+        _cairo_boilerplate_gl_describe,
 	TRUE, FALSE, FALSE
     },
     {
@@ -370,7 +391,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
-        NULL,
+        _cairo_boilerplate_gl_describe,
 	FALSE, FALSE, FALSE
     },
     {
@@ -384,7 +405,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
-        NULL,
+        _cairo_boilerplate_gl_describe,
 	FALSE, FALSE, FALSE
     },
     {
@@ -398,7 +419,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
-        NULL,
+        _cairo_boilerplate_gl_describe,
 	FALSE, FALSE, FALSE
     },
 };
commit a1c4b001a548611b7d77e9280fdb5a82da275830
Author: Benjamin Otte <otte at redhat.com>
Date:   Wed Jun 30 18:27:54 2010 +0200

    boilerplate: Add a describe vfunc
    
    This function is supposed to describe the backend in use. The describe
    function is optional - and therefore initialized as NULL everywhere.
    Note:
    It is well known that the xlib backend uses X. What is not known is what
    version the server supports or what graphics card it is running on. That
    is the information the describe vfunc is supposed to provide.

diff --git a/boilerplate/Makefile.win32.features b/boilerplate/Makefile.win32.features
index fd0e9c7..d79fe2f 100644
--- a/boilerplate/Makefile.win32.features
+++ b/boilerplate/Makefile.win32.features
@@ -209,6 +209,14 @@ enabled_cairo_boilerplate_private += $(cairo_boilerplate_png_private)
 enabled_cairo_boilerplate_sources += $(cairo_boilerplate_png_sources)
 endif
 
+supported_cairo_boilerplate_headers += $(cairo_boilerplate_glew_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glew_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glew_private)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glew_sources)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glew_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glew_private)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glew_sources)
+
 unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
 all_cairo_boilerplate_headers += $(cairo_boilerplate_gl_headers)
 all_cairo_boilerplate_private += $(cairo_boilerplate_gl_private)
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index 39252ac..6b657f1 100644
--- a/boilerplate/cairo-boilerplate-directfb.c
+++ b/boilerplate/cairo-boilerplate-directfb.c
@@ -217,7 +217,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_directfb_cleanup,
-	NULL, TRUE, FALSE, FALSE
+	NULL, NULL, TRUE, FALSE, FALSE
     },
     {
 	"directfb-bitmap", "directfb", NULL, NULL,
@@ -228,7 +228,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_directfb_cleanup,
-	NULL, FALSE, FALSE, FALSE
+	NULL, NULL, FALSE, FALSE, FALSE
     },
 };
 CAIRO_BOILERPLATE (directfb, targets);
diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c
index 5d5d17f..40c7049 100644
--- a/boilerplate/cairo-boilerplate-drm.c
+++ b/boilerplate/cairo-boilerplate-drm.c
@@ -85,6 +85,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	NULL,
 	_cairo_boilerplate_drm_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -97,6 +98,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	NULL,
 	_cairo_boilerplate_drm_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 };
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c
index 0bf2855..75439a9 100644
--- a/boilerplate/cairo-boilerplate-egl.c
+++ b/boilerplate/cairo-boilerplate-egl.c
@@ -139,6 +139,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_egl_cleanup,
 	_cairo_boilerplate_egl_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     }
 };
diff --git a/boilerplate/cairo-boilerplate-glx.c b/boilerplate/cairo-boilerplate-glx.c
index a3e0338..3fe7149 100644
--- a/boilerplate/cairo-boilerplate-glx.c
+++ b/boilerplate/cairo-boilerplate-glx.c
@@ -357,6 +357,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -369,6 +370,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -382,6 +384,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -395,6 +398,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_gl_cleanup,
 	_cairo_boilerplate_gl_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 };
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index 9d83b93..6f4afe9 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -249,7 +249,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_pdf_get_image_surface,
 	_cairo_boilerplate_pdf_surface_write_to_png,
 	_cairo_boilerplate_pdf_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"pdf", "pdf", ".pdf", NULL,
@@ -261,7 +261,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_pdf_get_image_surface,
 	_cairo_boilerplate_pdf_surface_write_to_png,
 	_cairo_boilerplate_pdf_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
 #endif
 };
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index de5a6ea..09dce6e 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -310,7 +310,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_ps_get_image_surface,
 	_cairo_boilerplate_ps_surface_write_to_png,
 	_cairo_boilerplate_ps_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"ps2", "ps", ".ps", NULL,
@@ -322,7 +322,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_ps_get_image_surface,
 	_cairo_boilerplate_ps_surface_write_to_png,
 	_cairo_boilerplate_ps_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"ps3", "ps", ".ps", NULL,
@@ -335,7 +335,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_ps_get_image_surface,
 	_cairo_boilerplate_ps_surface_write_to_png,
 	_cairo_boilerplate_ps_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"ps3", "ps", ".ps", NULL,
@@ -347,7 +347,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_ps_get_image_surface,
 	_cairo_boilerplate_ps_surface_write_to_png,
 	_cairo_boilerplate_ps_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
 #endif
 };
diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c
index 19d5928..67bd5bb 100644
--- a/boilerplate/cairo-boilerplate-quartz.c
+++ b/boilerplate/cairo-boilerplate-quartz.c
@@ -57,7 +57,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL,
+	NULL, NULL, NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -68,7 +68,8 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL,
+        FALSE, FALSE, FALSE
     },
 };
 CAIRO_BOILERPLATE (quartz, targets)
diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c
index 535ca54..f84594d 100644
--- a/boilerplate/cairo-boilerplate-script.c
+++ b/boilerplate/cairo-boilerplate-script.c
@@ -136,6 +136,6 @@ static const cairo_boilerplate_target_t target[] = {{
     _cairo_boilerplate_script_get_image_surface,
     _cairo_boilerplate_script_surface_write_to_png,
     _cairo_boilerplate_script_cleanup,
-    NULL, FALSE, FALSE, FALSE
+    NULL, NULL, FALSE, FALSE, FALSE
 }};
 CAIRO_BOILERPLATE (script, target)
diff --git a/boilerplate/cairo-boilerplate-skia.c b/boilerplate/cairo-boilerplate-skia.c
index 34c19f1..eb3d440 100644
--- a/boilerplate/cairo-boilerplate-skia.c
+++ b/boilerplate/cairo-boilerplate-skia.c
@@ -38,7 +38,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, TRUE, FALSE, FALSE
+	NULL, NULL, NULL, TRUE, FALSE, FALSE
     },
     {
 	"skia", "skia", NULL, NULL,
@@ -48,7 +48,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
 };
 CAIRO_BOILERPLATE (skia, targets)
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index a7d6c79..a0bbba6 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -286,7 +286,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_svg_get_image_surface,
 	_cairo_boilerplate_svg_surface_write_to_png,
 	_cairo_boilerplate_svg_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"svg11", "svg", NULL, NULL,
@@ -298,7 +298,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_svg_get_image_surface,
 	_cairo_boilerplate_svg_surface_write_to_png,
 	_cairo_boilerplate_svg_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"svg12", "svg", NULL, NULL,
@@ -310,7 +310,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_svg_get_image_surface,
 	_cairo_boilerplate_svg_surface_write_to_png,
 	_cairo_boilerplate_svg_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"svg12", "svg", NULL, NULL,
@@ -322,7 +322,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_svg_get_image_surface,
 	_cairo_boilerplate_svg_surface_write_to_png,
 	_cairo_boilerplate_svg_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
 #endif
 };
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index d3572ec..993e211 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -238,7 +238,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
     {
 	"test-fallback", "image", NULL, NULL,
@@ -249,7 +249,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
     {
 	"test-fallback16", "image", NULL, NULL,
@@ -260,7 +260,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	NULL, /* _cairo_boilerplate_get_image_surface, */
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
     {
 	"test-fallback16", "image", NULL, NULL,
@@ -271,7 +271,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	NULL, /* _cairo_boilerplate_get_image_surface, */
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
 #if CAIRO_HAS_TEST_PAGINATED_SURFACE
     {
@@ -284,7 +284,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_test_paginated_get_image_surface,
 	_cairo_boilerplate_test_paginated_surface_write_to_png,
 	_cairo_boilerplate_test_paginated_cleanup,
-	NULL, FALSE, TRUE, FALSE
+	NULL, NULL, FALSE, TRUE, FALSE
     },
     {
 	"test-paginated", "image", NULL, NULL,
@@ -296,7 +296,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_test_paginated_get_image_surface,
 	_cairo_boilerplate_test_paginated_surface_write_to_png,
 	_cairo_boilerplate_test_paginated_cleanup,
-	NULL, FALSE, TRUE, FALSE
+	NULL, NULL, FALSE, TRUE, FALSE
     },
 #endif
 #if CAIRO_HAS_TEST_WRAPPING_SURFACE
@@ -309,7 +309,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
 #endif
 #if CAIRO_HAS_TEST_NULL_SURFACE
@@ -321,7 +321,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_test_null_create_surface,
 	NULL, NULL,
 	NULL, NULL, NULL,
-	NULL,
+	NULL, NULL,
 	TRUE, TRUE, FALSE
     },
 #endif
diff --git a/boilerplate/cairo-boilerplate-vg.c b/boilerplate/cairo-boilerplate-vg.c
index 9803dcc..d5a1372 100644
--- a/boilerplate/cairo-boilerplate-vg.c
+++ b/boilerplate/cairo-boilerplate-vg.c
@@ -312,6 +312,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_vg_cleanup_glx,
 	_cairo_boilerplate_vg_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -324,6 +325,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_vg_cleanup_glx,
 	_cairo_boilerplate_vg_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 #endif
@@ -338,6 +340,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_vg_cleanup_egl,
 	_cairo_boilerplate_vg_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -350,6 +353,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_vg_cleanup_egl,
 	_cairo_boilerplate_vg_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 #endif
diff --git a/boilerplate/cairo-boilerplate-wgl.c b/boilerplate/cairo-boilerplate-wgl.c
index 35e317e..2215659 100644
--- a/boilerplate/cairo-boilerplate-wgl.c
+++ b/boilerplate/cairo-boilerplate-wgl.c
@@ -218,6 +218,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_wgl_cleanup,
 	_cairo_boilerplate_wgl_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -231,6 +232,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_wgl_cleanup,
 	_cairo_boilerplate_wgl_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 };
diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index e150995..0d70620 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -354,7 +354,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_win32_printing_get_image_surface,
 	_cairo_boilerplate_win32_printing_surface_write_to_png,
 	_cairo_boilerplate_win32_printing_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
     {
 	"win32-printing", "win32", ".ps", NULL,
@@ -365,7 +365,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_win32_printing_get_image_surface,
 	_cairo_boilerplate_win32_printing_surface_write_to_png,
 	_cairo_boilerplate_win32_printing_cleanup,
-	NULL, FALSE, TRUE, TRUE
+	NULL, NULL, FALSE, TRUE, TRUE
     },
 #endif
 };
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 72176c8..5194bef 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -57,7 +57,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, TRUE, FALSE, FALSE
+	NULL, NULL, NULL, TRUE, FALSE, FALSE
     },
     /* Testing the win32 surface isn't interesting, since for
      * ARGB images it just chains to the image backend
@@ -70,7 +70,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL, FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
 };
 CAIRO_BOILERPLATE (win32, targets)
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index b16b199..0cac82b 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -623,6 +623,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -636,6 +637,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -649,6 +651,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -662,6 +665,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -675,6 +679,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -688,6 +693,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -701,6 +707,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xcb_cleanup,
 	_cairo_boilerplate_xcb_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 };
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 906b554..db42d67 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -495,6 +495,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xlib_cleanup,
 	_cairo_boilerplate_xlib_synchronize,
+        NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -507,6 +508,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xlib_cleanup,
 	_cairo_boilerplate_xlib_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -519,6 +521,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xlib_cleanup,
 	_cairo_boilerplate_xlib_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 #endif
@@ -535,6 +538,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_xlib_cleanup,
 	_cairo_boilerplate_xlib_synchronize,
+        NULL,
 	FALSE, FALSE, FALSE
     },
 #endif
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 7bbc1e6..529a4f2 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -326,7 +326,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL,
+	NULL, NULL, NULL,
 	TRUE, FALSE, FALSE
     },
     {
@@ -336,7 +336,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL,
+	NULL, NULL, NULL,
 	FALSE, FALSE, FALSE
     },
     {
@@ -346,7 +346,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL, NULL,
+	NULL, NULL, NULL,
 	TRUE, FALSE, FALSE
     },
 #if CAIRO_HAS_RECORDING_SURFACE
@@ -359,7 +359,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_recording_surface_cleanup,
-	NULL,
+	NULL, NULL,
 	FALSE, FALSE, TRUE
     },
     {
@@ -371,7 +371,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
 	_cairo_boilerplate_recording_surface_cleanup,
-	NULL,
+	NULL, NULL,
 	FALSE, FALSE, TRUE
     },
 #endif
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 38df3b9..dae17ea 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -149,6 +149,9 @@ typedef void
 typedef void
 (*cairo_boilerplate_wait_t) (void *closure);
 
+typedef char *
+(*cairo_boilerplate_describe_t) (void *closure);
+
 typedef struct _cairo_boilerplate_target {
     const char					*name;
     const char					*basename;
@@ -165,6 +168,7 @@ typedef struct _cairo_boilerplate_target {
     cairo_boilerplate_write_to_png_t		 write_to_png;
     cairo_boilerplate_cleanup_t 		 cleanup;
     cairo_boilerplate_wait_t			 synchronize;
+    cairo_boilerplate_describe_t                 describe;
     cairo_bool_t				 is_measurable;
     cairo_bool_t				 is_vector;
     cairo_bool_t				 is_recording;
diff --git a/build/Makefile.win32.features-h b/build/Makefile.win32.features-h
index 9d9468c..9aec98c 100644
--- a/build/Makefile.win32.features-h
+++ b/build/Makefile.win32.features-h
@@ -62,6 +62,7 @@ endif
 ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
 	@echo "#define CAIRO_HAS_PNG_FUNCTIONS 1" >> src/cairo-features.h
 endif
+	@echo "#define CAIRO_HAS_GLEW_FUNCTIONS 1" >> src/cairo-features.h
 ifeq ($(CAIRO_HAS_GL_SURFACE),1)
 	@echo "#define CAIRO_HAS_GL_SURFACE 1" >> src/cairo-features.h
 endif
diff --git a/src/Makefile.win32.features b/src/Makefile.win32.features
index 3cbdd2e..f99cb66 100644
--- a/src/Makefile.win32.features
+++ b/src/Makefile.win32.features
@@ -287,6 +287,14 @@ ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
 enabled_cairo_pkgconf += cairo-png.pc
 endif
 
+supported_cairo_headers += $(cairo_glew_headers)
+all_cairo_headers += $(cairo_glew_headers)
+all_cairo_private += $(cairo_glew_private)
+all_cairo_sources += $(cairo_glew_sources)
+enabled_cairo_headers += $(cairo_glew_headers)
+enabled_cairo_private += $(cairo_glew_private)
+enabled_cairo_sources += $(cairo_glew_sources)
+
 unsupported_cairo_headers += $(cairo_gl_headers)
 all_cairo_headers += $(cairo_gl_headers)
 all_cairo_private += $(cairo_gl_private)


More information about the cairo-commit mailing list