[cairo-commit]
cairo/test .cvsignore, 1.60, 1.61 Makefile.am, 1.103,
1.104 cairo-test.c, 1.67, 1.68
Carl Worth
commit at pdx.freedesktop.org
Fri Dec 16 11:31:13 PST 2005
Committed by: cworth
Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv591/test
Modified Files:
.cvsignore Makefile.am cairo-test.c
Log Message:
2005-12-16 Carl Worth <cworth at cworth.org>
* configure.in: Add a new option --enable-test-surfaces.
* src/Makefile.am:
* src/test-fallback-surface.h:
* src/test-fallback-surface.c: (_test_fallback_surface_create),
(_test_fallback_surface_create_for_data),
(_test_fallback_surface_create_similar),
(_test_fallback_surface_finish),
(_test_fallback_surface_acquire_source_image),
(_test_fallback_surface_release_source_image),
(_test_fallback_surface_acquire_dest_image),
(_test_fallback_surface_release_dest_image),
(_test_fallback_surface_get_extents): New surface backend for
testing only. It has as many NULL backend entries as possible.
* test/Makefile.am:
* test/cairo-test.c: (create_test_fallback_surface),
(cleanup_test_fallback), (cairo_test_expecting): Add support to
test the new test_fallback backend.
Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/cairo/test/.cvsignore,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- .cvsignore 15 Dec 2005 00:22:07 -0000 1.60
+++ .cvsignore 16 Dec 2005 19:31:11 -0000 1.61
@@ -85,6 +85,7 @@
*-pdf-rgb24-out.pdf
*-ps-rgb24-out.png
*-ps-rgb24-out.ps
+*-test-fallback-argb32-out.png
*-xcb-out.png
*-xcb-argb32-out.png
*-xcb-rgb24-out.png
Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- Makefile.am 12 Dec 2005 19:56:40 -0000 1.103
+++ Makefile.am 16 Dec 2005 19:31:11 -0000 1.104
@@ -241,15 +241,15 @@
noinst_LTLIBRARIES = libcairotest.la
libcairotest_la_SOURCES =\
-buffer-diff.c \
-buffer-diff.h \
-cairo-test.c \
-cairo-test.h \
-read-png.c \
-read-png.h \
-write-png.c \
-write-png.h \
-xmalloc.c \
+buffer-diff.c \
+buffer-diff.h \
+cairo-test.c \
+cairo-test.h \
+read-png.c \
+read-png.h \
+write-png.c \
+write-png.h \
+xmalloc.c \
xmalloc.h
LDADDS = libcairotest.la $(top_builddir)/src/libcairo.la
Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- cairo-test.c 15 Dec 2005 03:56:09 -0000 1.67
+++ cairo-test.c 16 Dec 2005 19:31:11 -0000 1.68
@@ -199,6 +199,35 @@
free (buf);
}
+#ifdef CAIRO_HAS_TEST_SURFACES
+
+#include "test-fallback-surface.h"
+
+static cairo_surface_t *
+create_test_fallback_surface (cairo_test_t *test, cairo_format_t format,
+ void **closure)
+{
+ int stride = 4 * test->width;
+ unsigned char *data;
+
+ *closure = data = xcalloc (stride * test->height, 1);
+
+ return _test_fallback_surface_create_for_data (data, format,
+ test->width,
+ test->height,
+ stride);
+}
+
+static void
+cleanup_test_fallback (void *closure)
+{
+ unsigned char *data = closure;
+
+ free (data);
+}
+
+#endif
+
#ifdef CAIRO_HAS_GLITZ_SURFACE
#include <glitz.h>
#include <cairo-glitz.h>
@@ -1215,6 +1244,11 @@
{ "image", CAIRO_FORMAT_RGB24,
create_image_surface, cairo_surface_write_to_png,
cleanup_image },
+#ifdef CAIRO_HAS_TEST_SURFACES
+ { "test-fallback", CAIRO_FORMAT_ARGB32,
+ create_test_fallback_surface, cairo_surface_write_to_png,
+ cleanup_test_fallback },
+#endif
#ifdef CAIRO_HAS_GLITZ_SURFACE
#if CAIRO_CAN_TEST_GLITZ_GLX_SURFACE
{ "glitz-glx", CAIRO_FORMAT_ARGB32,
More information about the cairo-commit
mailing list