[cairo-commit] cairo/src cairo-meta-surface.c, 1.20, 1.21 test-fallback-surface.c, 1.3, 1.4 test-fallback-surface.h, 1.1, 1.2 test-meta-surface.c, 1.1, 1.2 test-meta-surface.h, NONE, 1.1

Carl Worth commit at pdx.freedesktop.org
Tue Dec 20 10:30:14 PST 2005


Committed by: cworth

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

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

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

        * src/cairo-meta-surface.c: Add some comments describing what a
        cairo_meta_surface_t is.

        * src/test-fallback-surface.c:
        * src/test-fallback-surface.h: Remove unused
        _test_fallback_surface_create_for_data.

        * src/test-meta-surface.c:
        * src/test-meta-surface.h: Remove unused
        _test_meta_surface_create_for_data. Add missing source file
        src/test-meta-surface.h.


Index: cairo-meta-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-meta-surface.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cairo-meta-surface.c	16 Dec 2005 11:02:35 -0000	1.20
+++ cairo-meta-surface.c	20 Dec 2005 18:30:11 -0000	1.21
@@ -34,6 +34,25 @@
  *	Carl Worth <cworth at cworth.org>
  */
 
+/* A meta surface is a surface that records all drawing operations at
+ * the highest level of the surface backend interface, (that is, the
+ * level of paint, mask, stroke, fill, and show_glyphs). The meta
+ * surface can then be "replayed" against any target surface with:
+ *
+ *	_cairo_meta_surface_replay (meta, target);
+ *
+ * after which the results in target will be identical to the results
+ * that would have been obtained if the original operations applied to
+ * the meta surface had instead been applied to the target surface.
+ *
+ * The recording phase of the meta surface is careful to snapshot all
+ * necessary objects (paths, patterns, etc.), in order to acheive
+ * accurate replay. The efficiency of the meta surface could be
+ * improved by improving the implementation of snapshot for the
+ * various objects. For example, it would be nice to have a
+ * copy-on-write implementation for _cairo_surface_snapshot.
+ */
+
 #include "cairoint.h"
 #include "cairo-meta-surface-private.h"
 #include "cairo-clip-private.h"

Index: test-fallback-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-fallback-surface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test-fallback-surface.c	20 Dec 2005 06:01:39 -0000	1.3
+++ test-fallback-surface.c	20 Dec 2005 18:30:11 -0000	1.4
@@ -89,34 +89,6 @@
     return &surface->base;
 }
 
-cairo_surface_t *
-_test_fallback_surface_create_for_data (unsigned char	*data,
-					cairo_format_t	 format,
-					int		 width,
-					int		 height,
-					int		 stride)
-{
-    test_fallback_surface_t *surface;
-    cairo_surface_t *backing;
-
-    backing = cairo_image_surface_create_for_data (data, format,
-						   width, height, stride);
-    if (cairo_surface_status (backing))
-	return (cairo_surface_t*) &_cairo_surface_nil;
-
-    surface = malloc (sizeof (test_fallback_surface_t));
-    if (surface == NULL) {
-	_cairo_error (CAIRO_STATUS_NO_MEMORY);
-	return (cairo_surface_t*) &_cairo_surface_nil;
-    }
-
-    _cairo_surface_init (&surface->base, &test_fallback_surface_backend);
-
-    surface->backing = backing;
-
-    return &surface->base;
-}
-
 static cairo_surface_t *
 _test_fallback_surface_create_similar (void		*abstract_surface,
 				       cairo_content_t	 content,

Index: test-fallback-surface.h
===================================================================
RCS file: /cvs/cairo/cairo/src/test-fallback-surface.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test-fallback-surface.h	16 Dec 2005 19:31:11 -0000	1.1
+++ test-fallback-surface.h	20 Dec 2005 18:30:11 -0000	1.2
@@ -45,13 +45,6 @@
 			       int		width,
 			       int		height);
 
-cairo_surface_t *
-_test_fallback_surface_create_for_data (unsigned char	*data,
-					cairo_format_t	format,
-					int		width,
-					int		height,
-					int		stride);
-
 CAIRO_END_DECLS
 
 #endif /* TEST_FALLBACK_SURFACE_H */

Index: test-meta-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/test-meta-surface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test-meta-surface.c	20 Dec 2005 06:01:39 -0000	1.1
+++ test-meta-surface.c	20 Dec 2005 18:30:11 -0000	1.2
@@ -101,44 +101,6 @@
     return (cairo_surface_t*) &_cairo_surface_nil;
 }
 
-cairo_surface_t *
-_test_meta_surface_create_for_data (unsigned char	*data,
-				    cairo_format_t	 format,
-				    int		 	 width,
-				    int		 	 height,
-				    int		 	 stride)
-{
-    test_meta_surface_t *surface;
-    cairo_surface_t *meta, *image;
-
-    meta = _cairo_meta_surface_create (width, height);
-    if (cairo_surface_status (meta))
-	return (cairo_surface_t*) &_cairo_surface_nil;
-
-    image = cairo_image_surface_create_for_data (data, format,
-						   width, height, stride);
-    if (cairo_surface_status (image)) {
-	cairo_surface_destroy (meta);
-	return (cairo_surface_t*) &_cairo_surface_nil;
-    }
-
-    surface = malloc (sizeof (test_meta_surface_t));
-    if (surface == NULL) {
-	cairo_surface_destroy (meta);
-	cairo_surface_destroy (image);	
-	_cairo_error (CAIRO_STATUS_NO_MEMORY);
-	return (cairo_surface_t*) &_cairo_surface_nil;
-    }
-
-    _cairo_surface_init (&surface->base, &test_meta_surface_backend);
-
-    surface->meta = meta;
-    surface->image = image;
-    surface->image_reflects_meta = FALSE;
-
-    return &surface->base;
-}
-
 static cairo_surface_t *
 _test_meta_surface_create_similar (void			*abstract_surface,
 				   cairo_content_t	 content,

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



More information about the cairo-commit mailing list