[cairo-commit] cairo/test .cvsignore, 1.24, 1.25 Makefile.am, 1.43, 1.44 cairo-test.c, 1.24, 1.25 create-for-png.c, 1.3, 1.4 filter-nearest-offset-ref.png, NONE, 1.1 filter-nearest-offset.c, NONE, 1.1 move-to-show-surface.c, 1.6, 1.7 pixman-rotate.c, 1.7, 1.8 scale-source-surface-paint-ref.png, NONE, 1.1 scale-source-surface-paint.c, NONE, 1.1 source-surface-scale-paint-ref.png, NONE, 1.1 source-surface-scale-paint.c, NONE, 1.1 translate-show-surface.c, 1.2, 1.3

Carl Worth commit at pdx.freedesktop.org
Tue May 3 08:33:35 PDT 2005


Committed by: cworth

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

Modified Files:
	.cvsignore Makefile.am cairo-test.c create-for-png.c 
	move-to-show-surface.c pixman-rotate.c 
	translate-show-surface.c 
Added Files:
	filter-nearest-offset-ref.png filter-nearest-offset.c 
	scale-source-surface-paint-ref.png 
	scale-source-surface-paint.c 
	source-surface-scale-paint-ref.png 
	source-surface-scale-paint.c 
Log Message:

        Originally 2005-04-20  Carl Worth  <cworth at cworth.org>

        * src/cairo.h:
        * src/cairo.c: Remove cairo_show_surface. Add new
        cairo_set_source_surface.

        * src/cairo-gstate.c: Remove _cairo_gstate_show_surface.

        * test/create-for-png.c: (draw):
        * test/pixman-rotate.c: (draw):
        * test/move-to-show-surface.c: (draw):
        * test/translate-show-surface.c: (draw): Replace calls to
        cairo_show_surface with cairo_set_source_surface; cairo_paint.

        * test/cairo-test.c: (cairo_test_real): Fix messages to prefer -
        over _.

        * src/cairo-png.c: (cairo_surface_write_to_png): Fix
        documentation.

        * test/filter-nearest-offset-ref.png:
        * test/filter-nearest-offset.c:
        * test/scale-source-surface-paint-ref.png:
        * test/scale-source-surface-paint.c:
        * test/source-surface-scale-paint-ref.png:
        * test/source-surface-scale-paint.c: Three new tests to exercise
        set_source_surface more completely, (two of these are expected
        failures dues to outstanding bugs).


Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/cairo/test/.cvsignore,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- .cvsignore	28 Apr 2005 18:15:47 -0000	1.24
+++ .cvsignore	3 May 2005 15:33:32 -0000	1.25
@@ -2,25 +2,33 @@
 .libs
 Makefile
 Makefile.in
+clip-nesting
 clip-twice
 coverage
 create-for-png
 fill-and-stroke
 fill-rule
+filter-nearest-offset
 get-and-set
 gradient-alpha
 imagediff
 leaky-polygon
 line-width
 linear-gradient
+mask
 move-to-show-surface
 paint
 path-data
 pdf-surface
 pdf-surface.pdf
 pixman-rotate
-set-source
+rel-path
+scale-source-surface-paint
 select-font-no-show-text
+self-copy
+set-source
+source-clip
+source-surface-scale-paint
 surface-finish-twice
 surface-pattern
 text-cache-crash

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- Makefile.am	2 May 2005 20:39:34 -0000	1.43
+++ Makefile.am	3 May 2005 15:33:32 -0000	1.44
@@ -1,64 +1,69 @@
 # All test cases go here
-TESTS = 		\
-clip-twice		\
-clip-nesting		\
-coverage		\
-create-for-png		\
-fill-and-stroke		\
-fill-rule		\
-get-and-set		\
-gradient-alpha		\
-leaky-polygon		\
-line-width		\
-linear-gradient		\
-mask			\
-move-to-show-surface	\
-paint			\
-path-data		\
-pdf-surface		\
-pixman-rotate		\
-select-font-no-show-text\
-self-copy		\
-set-source		\
-source-clip		\
-surface-finish-twice	\
-surface-pattern		\
-text-cache-crash	\
-text-rotate		\
-transforms		\
-translate-show-surface	\
-trap-clip		\
-user-data		\
+TESTS = 			\
+clip-nesting			\
+clip-twice			\
+coverage			\
+create-for-png			\
+fill-and-stroke			\
+fill-rule			\
+filter-nearest-offset		\
+get-and-set			\
+gradient-alpha			\
+leaky-polygon			\
+line-width			\
+linear-gradient			\
+mask				\
+move-to-show-surface		\
+paint				\
+path-data			\
+pdf-surface			\
+pixman-rotate			\
+scale-source-surface-paint	\
+select-font-no-show-text	\
+self-copy			\
+set-source			\
+source-clip			\
+source-surface-scale-paint	\
+surface-finish-twice		\
+surface-pattern			\
+text-cache-crash		\
+text-rotate			\
+transforms			\
+translate-show-surface		\
+trap-clip			\
+user-data			\
 rel-path
 
 # All tests which have a reference image go here.
 # I really don't like having to repeat this list. Anyone know a good
 # way to avoid it? Can I use a wildcard here?
-EXTRA_DIST =			\
-clip-nesting-ref.png		\
-create-for-png-ref.png		\
-fill-and-stroke-ref.png		\
-fill-rule-ref.png		\
-gradient-alpha-ref.png		\
-leaky-polygon-ref.png		\
-line-width-ref.png		\
-linear-gradient-ref.png		\
-mask-ref.png			\
-move-to-show-surface-ref.png	\
-coverage-ref.png		\
-clip-twice-ref.png		\
-mask-ref.png			\
-paint-ref.png			\
-path-data-ref.png		\
-pixman-rotate-ref.png		\
-romedalen.png			\
-self-copy-ref.png		\
-set-source-ref.png		\
-source-clip-ref.png		\
-surface-pattern-ref.png		\
-transforms-ref.png		\
-translate-show-surface-ref.png	\
-trap-clip-ref.png		\
+EXTRA_DIST =				\
+clip-nesting-ref.png			\
+clip-twice-ref.png			\
+coverage-ref.png			\
+create-for-png-ref.png			\
+fill-and-stroke-ref.png			\
+fill-rule-ref.png			\
+filter-nearest-offset-ref.png		\
+gradient-alpha-ref.png			\
+leaky-polygon-ref.png			\
+line-width-ref.png			\
+linear-gradient-ref.png			\
+mask-ref.png				\
+move-to-show-surface-ref.png		\
+paint-ref.png				\
+path-data-ref.png			\
+pixman-rotate-ref.png			\
+romedalen.png				\
+self-copy-ref.png			\
+scale-source-surface-paint-ref.png	\
+set-source-ref.png			\
+source-clip-ref.png			\
+source-surface-scale-paintref.png	\
+surface-pattern-ref.png			\
+transforms-ref.png			\
+translate-show-surface-ref.png		\
+trap-clip-ref.png			\
 rel-path-ref.png
 
 # Any test for which the code committed to CVS is expected to fail
@@ -74,10 +79,12 @@
 #
 # Also, any test listed here should call cairo_test_expect_failure and
 # provide an explanation for the expected failure.
-XFAIL_TESTS =		\
-coverage		\
-pixman-rotate		\
-self-copy		\
+XFAIL_TESTS =			\
+coverage			\
+filter-nearest-offset		\
+pixman-rotate			\
+self-copy			\
+source-surface-scale-paint	\
 text-rotate
 
 check_PROGRAMS = $(TESTS)
@@ -113,6 +120,7 @@
 create_for_png_LDADD = $(LDADDS)
 fill_and_stroke_LDADD = $(LDADDS)
 fill_rule_LDADD = $(LDADDS)
+filter_nearest_offset_LDADD = $(LDADDS)
 get_and_set_LDADD = $(LDADDS)
 gradient_alpha_LDADD = $(LDADDS)
 leaky_polygon_LDADD = $(LDADDS)
@@ -124,10 +132,12 @@
 path_data_LDADD = $(LDADDS)
 pdf_surface_LDADD = $(LDADDS)
 pixman_rotate_LDADD = $(LDADDS)
+scale_source_surface_paint_LDADD = $(LDADDS)
 select_font_no_show_text_LDADD = $(LDADDS)
 self_copy_LDADD = $(LDADDS)
 set_source_LDADD = $(LDADDS)
 source_clip_LDADD = $(LDADDS)
+source_surface_scale_paint_LDADD = $(LDADDS)
 surface_finish_twice_LDADD = $(LDADDS)
 surface_pattern_LDADD = $(LDADDS)
 text_cache_crash_LDADD = $(LDADDS)

Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cairo-test.c	28 Apr 2005 18:15:47 -0000	1.24
+++ cairo-test.c	3 May 2005 15:33:32 -0000	1.25
@@ -358,7 +358,7 @@
     for (i=0; i < sizeof(targets)/sizeof(targets[0]); i++) {
 	cairo_test_target_t *target = &targets[i];
 	fprintf (stderr, "Testing %s with %s target\n", test->name, target->name);
-	printf ("%s_%s:\t", test->name, target->name);
+	printf ("%s-%s:\t", test->name, target->name);
 	status = cairo_test_for_target (test, draw, target);
 	if (status) {
 	    printf ("FAIL\n");

Index: create-for-png.c
===================================================================
RCS file: /cvs/cairo/cairo/test/create-for-png.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- create-for-png.c	26 Apr 2005 16:43:39 -0000	1.3
+++ create-for-png.c	3 May 2005 15:33:32 -0000	1.4
@@ -42,7 +42,6 @@
     char *srcdir = getenv ("srcdir");
     char *filename;
     cairo_surface_t *surface;
-    int png_width, png_height;
 
     xasprintf (&filename, "%s/%s", srcdir ? srcdir : ".",
 	       "create-for-png-ref.png");
@@ -55,9 +54,8 @@
 	return CAIRO_TEST_FAILURE;
     }
 
-    png_width = cairo_image_surface_get_width (surface);
-    png_height = cairo_image_surface_get_height (surface);
-    cairo_show_surface (cr, surface, png_width, png_height);
+    cairo_set_source_surface (cr, surface, 0, 0);
+    cairo_paint (cr);
 
     cairo_surface_destroy (surface);
 

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

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

Index: move-to-show-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/move-to-show-surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- move-to-show-surface.c	8 Apr 2005 21:06:32 -0000	1.6
+++ move-to-show-surface.c	3 May 2005 15:33:32 -0000	1.7
@@ -64,8 +64,9 @@
     for (i=0; i < 4; i++) {
 	surface = cairo_surface_create_for_image ((unsigned char *) &colors[i],
 						  CAIRO_FORMAT_ARGB32, 1, 1, 4);
-	cairo_move_to (cr, i % 2, i / 2);
-	cairo_show_surface (cr, surface, 1, 1);
+	cairo_set_source_surface (cr, surface,
+				  i % 2, i / 2);
+	cairo_paint (cr);
 	cairo_surface_destroy (surface);
     }
 

Index: pixman-rotate.c
===================================================================
RCS file: /cvs/cairo/cairo/test/pixman-rotate.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pixman-rotate.c	26 Apr 2005 16:43:39 -0000	1.7
+++ pixman-rotate.c	3 May 2005 15:33:32 -0000	1.8
@@ -58,7 +58,8 @@
     cairo_translate (cr, WIDTH, HEIGHT);
 #endif
 
-    cairo_show_surface (cr, stamp, WIDTH + 2, HEIGHT + 2);
+    cairo_set_source_surface (cr, stamp, 0, 0);
+    cairo_paint (cr);
 
     cairo_show_page (cr);
 

--- NEW FILE: scale-source-surface-paint-ref.png ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: scale-source-surface-paint.c ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: source-surface-scale-paint-ref.png ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: source-surface-scale-paint.c ---
(This appears to be a binary file; contents omitted.)

Index: translate-show-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/translate-show-surface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- translate-show-surface.c	12 Apr 2005 20:24:54 -0000	1.2
+++ translate-show-surface.c	3 May 2005 15:33:32 -0000	1.3
@@ -65,7 +65,8 @@
 	cairo_save (cr);
 	{
 	    cairo_translate (cr, i % 2, i / 2);
-	    cairo_show_surface (cr, surface, 1, 1);
+	    cairo_set_source_surface (cr, surface, 0, 0);
+	    cairo_paint (cr);
 	}
 	cairo_restore (cr);
 	cairo_surface_destroy (surface);




More information about the cairo-commit mailing list