[cairo-commit] cairo/src Makefile.am, 1.71, 1.72 cairo-surface.c, 1.115, 1.116 test-fallback-surface.c, 1.2, 1.3 test-meta-surface.c, NONE, 1.1

Carl Worth commit at pdx.freedesktop.org
Mon Dec 19 22:01:41 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv11678/src

Modified Files:
	Makefile.am cairo-surface.c test-fallback-surface.c 
Added Files:
	test-meta-surface.c 
Log Message:

2005-12-19  Carl Worth  <cworth at cworth.org>

        * src/cairo-surface.c: (_cairo_surface_create_similar_solid):
        Use _cairo_surface_paint rather than _cairo_surface_fill_rectangle
        as only the former is guaranteed to work with all backends.

        * src/test-fallback-surface.c: Refine the comment describing this
        test surface.

        * src/Makefile.am:
        * src/test-meta-surface.c: (_test_meta_surface_create),
        (_test_meta_surface_create_for_data),
        (_test_meta_surface_create_similar), (_test_meta_surface_finish),
        (_test_meta_surface_acquire_source_image),
        (_test_meta_surface_release_source_image),
        (_test_meta_surface_show_page),
        (_test_meta_surface_intersect_clip_path),
        (_test_meta_surface_get_extents), (_test_meta_surface_paint),
        (_test_meta_surface_mask), (_test_meta_surface_stroke),
        (_test_meta_surface_fill), (_test_meta_surface_show_glyphs),
        (_test_meta_surface_snapshot): Add new test surface for exercising
        cairo_meta_surface.

        * test/.cvsignore:
        * test/cairo-test.c: (create_image_surface),
        (create_test_fallback_surface), (create_test_meta_surface),
        (cairo_test_for_target), (cairo_test_expecting): Simplify the
        image and test_fallback targets by not using
        create_for_data. Allow for NULL cleanup target functions. Add
        support for the test_meta_surface.


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- Makefile.am	19 Dec 2005 01:20:06 -0000	1.71
+++ Makefile.am	20 Dec 2005 06:01:39 -0000	1.72
@@ -21,7 +21,8 @@
 endif
 
 if CAIRO_HAS_TEST_SURFACES
-libcairo_test_sources = test-fallback-surface.c test-fallback-surface.h
+libcairo_test_sources = test-fallback-surface.c test-fallback-surface.h \
+			test-meta-surface.c test-meta-surface.h
 endif
 
 if CAIRO_HAS_XLIB_SURFACE

Index: cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- cairo-surface.c	19 Dec 2005 23:08:05 -0000	1.115
+++ cairo-surface.c	20 Dec 2005 06:01:39 -0000	1.116
@@ -223,6 +223,7 @@
 {
     cairo_status_t status;
     cairo_surface_t *surface;
+    cairo_pattern_t *source;
 
     surface = _cairo_surface_create_similar_scratch (other, content,
 						     width, height);
@@ -230,10 +231,18 @@
 	_cairo_error (CAIRO_STATUS_NO_MEMORY);
 	return (cairo_surface_t*) &_cairo_surface_nil;
     }
+
+    source = _cairo_pattern_create_solid (color);
+    if (source->status) {
+	cairo_surface_destroy (surface);
+	_cairo_error (CAIRO_STATUS_NO_MEMORY);
+	return (cairo_surface_t*) &_cairo_surface_nil;
+    }
+
+    status = _cairo_surface_paint (surface, CAIRO_OPERATOR_SOURCE, source);
+
+    cairo_pattern_destroy (source);
     
-    status = _cairo_surface_fill_rectangle (surface,
-					    CAIRO_OPERATOR_SOURCE, color,
-					    0, 0, width, height);
     if (status) {
 	cairo_surface_destroy (surface);
 	_cairo_error (status);

Index: test-fallback-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-fallback-surface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test-fallback-surface.c	16 Dec 2005 19:48:49 -0000	1.2
+++ test-fallback-surface.c	20 Dec 2005 06:01:39 -0000	1.3
@@ -38,8 +38,12 @@
  * fallbacks.
  *
  * The defining feature of this backend is that it has as many NULL
- * backend function entries as possible, (and it might be worth
- * working to try to allow one or two more to be NULL as well).
+ * backend function entries as possible. The ones that aren't NULL are
+ * simply those that must be implemented to have working fallbacks.
+ * (Except for create_similar---fallbacks would work fine without
+ * that---I implemented it here in order to create as many surfaces as
+ * possible of type test_fallback_surface_t during the test suite
+ * run).
  *
  * It's possible that this code might serve as a good starting point
  * for someone working on bringing up a new backend, starting with the

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



More information about the cairo-commit mailing list