[cairo-commit] cairo/test Makefile.am, 1.10, 1.11 cairo_test.c, 1.6, 1.7 cairo_test.h, 1.2, 1.3 coverage-ref.png, NONE, 1.1 coverage.c, NONE, 1.1 romedalen.png, NONE, 1.1

Kristian Hogsberg commit at pdx.freedesktop.org
Wed Jan 26 13:41:58 PST 2005


Committed by: krh

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv10725/test

Modified Files:
	Makefile.am cairo_test.c cairo_test.h 
Added Files:
	coverage-ref.png coverage.c romedalen.png 
Log Message:
2005-01-26  Kristian Høgsberg  <krh at redhat.com>

        * test/Makefile.am, test/coverage.c, test/coverage-ref.png: New
        test case, covering various combinations of pattern types, drawing
        operations and clipping.  Currently fails, for some combinations,
        coverage-ref.png is just a placeholder.

        * test/romedalen.png: Added this PNG from cairo-snippets to use
        for pattern fills.

        * test/cairo_test.c, test/cairo_test.h: expose PNG loading to test
        cases.



Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.am	25 Jan 2005 22:45:31 -0000	1.10
+++ Makefile.am	26 Jan 2005 21:41:55 -0000	1.11
@@ -5,7 +5,8 @@
 line_width		\
 move_to_show_surface	\
 text_cache_crash	\
-text_rotate
+text_rotate		\
+coverage
 
 # And all new test go here too. I really don't like having to repeat
 # this list. Anyone know a good way to avoid it? Can I use a wildcard
@@ -29,7 +30,8 @@
 # be fixed before the code is committed.
 XFAIL_TESTS =		\
 move_to_show_surface	\
-text_rotate
+text_rotate		\
+coverage
 
 check_PROGRAMS = $(TESTS)
 
@@ -62,6 +64,7 @@
 move_to_show_surface_SOURCES = move_to_show_surface.c $(cairo_test_lib)
 text_cache_crash_SOURCES = text_cache_crash.c $(cairo_test_lib)
 text_rotate_SOURCES = text_rotate.c $(cairo_test_lib)
+coverage_SOURCES = coverage.c $(cairo_test_lib)
 
 noinst_PROGRAMS = imagediff
 imagediff_SOURCES = imagediff.c $(cairo_test_lib)

Index: cairo_test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo_test.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo_test.c	25 Jan 2005 22:45:31 -0000	1.6
+++ cairo_test.c	26 Jan 2005 21:41:55 -0000	1.7
@@ -166,3 +166,26 @@
 
     return ret;
 }
+
+cairo_pattern_t *
+cairo_test_create_png_pattern (cairo_t *cr, const char *filename)
+{
+    cairo_surface_t *image;
+    cairo_pattern_t *pattern;
+    unsigned char *buffer;
+    int w, h, stride;
+    read_png_status_t status;
+
+    status = read_png_argb32 (filename, &buffer, &w,&h, &stride);
+    if (status != READ_PNG_SUCCESS)
+	return NULL;
+
+    image = cairo_surface_create_for_image (buffer, CAIRO_FORMAT_ARGB32,
+					    w, h, stride);
+
+    cairo_surface_set_repeat (image, 1);
+
+    pattern = cairo_pattern_create_for_surface (image);
+
+    return pattern;
+}

Index: cairo_test.h
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo_test.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo_test.h	4 Nov 2004 22:23:50 -0000	1.2
+++ cairo_test.h	26 Jan 2005 21:41:55 -0000	1.3
@@ -47,5 +47,9 @@
 cairo_test_status_t
 cairo_test (cairo_test_t *test, cairo_test_draw_function_t draw);
 
+cairo_pattern_t *
+cairo_test_create_png_pattern (cairo_t *cr, const char *filename);
+
+
 #endif
 

--- NEW FILE: coverage-ref.png ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: coverage.c ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: romedalen.png ---
(This appears to be a binary file; contents omitted.)




More information about the cairo-commit mailing list