[cairo-commit] cairo/test cairo-test.c, 1.44, 1.45 cairo-test.h,
1.11, 1.12 composite-integer-translate-over.c, 1.1,
1.2 composite-integer-translate-source.c, 1.1, 1.2 mask.c, 1.7,
1.8 trap-clip.c, 1.5, 1.6
Carl Worth
commit at pdx.freedesktop.org
Mon Jul 18 08:04:18 PDT 2005
Committed by: cworth
Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv27841/test
Modified Files:
cairo-test.c cairo-test.h composite-integer-translate-over.c
composite-integer-translate-source.c mask.c trap-clip.c
Log Message:
* ROADMAP: Note some progress.
* test/cairo-test.h:
* test/cairo-test.c: (cairo_test_create_surface_from_png),
(cairo_test_create_pattern_from_png): New helper function to help
create an image surface from a PNG file, while taking the srcdir
environment variable into consideration. Rename the pattern
creating helper function to match.
* test/composite-integer-translate-over.c: (draw):
* test/composite-integer-translate-source.c: (draw): Use new
cairo_test_create_surface_from_png so that non-srcdir builds work.
* test/mask.c: (set_image_pattern):
* test/trap-clip.c: (set_image_pattern): Track change in
cairo_test_create_pattern_from_png.
Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- cairo-test.c 15 Jul 2005 07:56:58 -0000 1.44
+++ cairo-test.c 18 Jul 2005 15:04:16 -0000 1.45
@@ -575,11 +575,10 @@
return cairo_test_expecting (test, draw, CAIRO_TEST_SUCCESS);
}
-cairo_pattern_t *
-cairo_test_create_png_pattern (cairo_t *cr, const char *filename)
+cairo_surface_t *
+cairo_test_create_surface_from_png (const char *filename)
{
cairo_surface_t *image;
- cairo_pattern_t *pattern;
char *srcdir = getenv ("srcdir");
image = cairo_image_surface_create_from_png (filename);
@@ -594,6 +593,17 @@
return NULL;
}
+ return image;
+}
+
+cairo_pattern_t *
+cairo_test_create_pattern_from_png (const char *filename)
+{
+ cairo_surface_t *image;
+ cairo_pattern_t *pattern;
+
+ image = cairo_test_create_surface_from_png (filename);
+
pattern = cairo_pattern_create_for_surface (image);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
Index: cairo-test.h
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- cairo-test.h 14 Jul 2005 19:20:42 -0000 1.11
+++ cairo-test.h 18 Jul 2005 15:04:16 -0000 1.12
@@ -53,8 +53,11 @@
cairo_test_draw_function_t draw,
const char *reason);
+cairo_surface_t *
+cairo_test_create_surface_from_png (const char *filename);
+
cairo_pattern_t *
-cairo_test_create_png_pattern (cairo_t *cr, const char *filename);
+cairo_test_create_pattern_from_png (const char *filename);
void
cairo_test_log (const char *fmt, ...);
@@ -63,4 +66,3 @@
xasprintf (char **strp, const char *fmt, ...);
#endif
-
Index: composite-integer-translate-over.c
===================================================================
RCS file: /cvs/cairo/cairo/test/composite-integer-translate-over.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- composite-integer-translate-over.c 15 Jul 2005 20:45:19 -0000 1.1
+++ composite-integer-translate-over.c 18 Jul 2005 15:04:16 -0000 1.2
@@ -18,7 +18,7 @@
{
cairo_surface_t *image;
- image = cairo_image_surface_create_from_png (png_filename);
+ image = cairo_test_create_surface_from_png (png_filename);
cairo_set_source_rgba (cr, 0, 0, 0, 1);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
Index: composite-integer-translate-source.c
===================================================================
RCS file: /cvs/cairo/cairo/test/composite-integer-translate-source.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- composite-integer-translate-source.c 15 Jul 2005 20:45:19 -0000 1.1
+++ composite-integer-translate-source.c 18 Jul 2005 15:04:16 -0000 1.2
@@ -18,7 +18,7 @@
{
cairo_surface_t *image;
- image = cairo_image_surface_create_from_png (png_filename);
+ image = cairo_test_create_surface_from_png (png_filename);
cairo_set_source_rgba (cr, 0, 0, 0, 1);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
Index: mask.c
===================================================================
RCS file: /cvs/cairo/cairo/test/mask.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mask.c 15 Jul 2005 08:38:38 -0000 1.7
+++ mask.c 18 Jul 2005 15:04:16 -0000 1.8
@@ -64,7 +64,7 @@
{
cairo_pattern_t *pattern;
- pattern = cairo_test_create_png_pattern (cr, png_filename);
+ pattern = cairo_test_create_pattern_from_png (png_filename);
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
Index: trap-clip.c
===================================================================
RCS file: /cvs/cairo/cairo/test/trap-clip.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- trap-clip.c 14 Jul 2005 23:18:39 -0000 1.5
+++ trap-clip.c 18 Jul 2005 15:04:16 -0000 1.6
@@ -63,7 +63,7 @@
{
cairo_pattern_t *pattern;
- pattern = cairo_test_create_png_pattern (cr, png_filename);
+ pattern = cairo_test_create_pattern_from_png (png_filename);
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
More information about the cairo-commit
mailing list