[cairo-commit] cairo/src cairo-paginated-surface.c,1.3,1.4

Carl Worth commit at pdx.freedesktop.org
Fri Jan 6 14:24:58 PST 2006


Committed by: cworth

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

Modified Files:
	cairo-paginated-surface.c 
Log Message:

2006-01-06  Carl Worth  <cworth at cworth.org>

        Reviewed by keithp

        * src/cairo-paginated-surface.c: (_paint_page),
        (_cairo_paginated_surface_copy_page),
        (_cairo_paginated_surface_show_page): Change the paginated surface
        to force all output to come from an image surface (to be refined
        incrementally as we hook real surface backends up to it).


Index: cairo-paginated-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-paginated-surface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cairo-paginated-surface.c	6 Jan 2006 22:11:07 -0000	1.3
+++ cairo-paginated-surface.c	6 Jan 2006 22:24:56 -0000	1.4
@@ -168,13 +168,33 @@
     cairo_surface_destroy (&image->base);
 }
 
+static void
+_paint_page (cairo_paginated_surface_t *surface)
+{
+    cairo_surface_t *image;
+    cairo_pattern_t *pattern;
+
+    image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+					surface->width, surface->height);
+
+    _cairo_meta_surface_replay (surface->meta, image);
+
+    pattern = cairo_pattern_create_for_surface (image);
+
+    _cairo_surface_paint (surface->target, CAIRO_OPERATOR_SOURCE, pattern);
+
+    cairo_pattern_destroy (pattern);
+
+    cairo_surface_destroy (image);
+}
+
 static cairo_int_status_t
 _cairo_paginated_surface_copy_page (void *abstract_surface)
 {
     cairo_paginated_surface_t *surface = abstract_surface;
     cairo_int_status_t status;
 
-    _cairo_meta_surface_replay (surface->meta, surface->target);
+    _paint_page (surface);
 
     status = _cairo_surface_copy_page (surface->target);
 
@@ -206,7 +226,7 @@
 {
     cairo_paginated_surface_t *surface = abstract_surface;
 
-    _cairo_meta_surface_replay (surface->meta, surface->target);
+    _paint_page (surface);
 
     _cairo_surface_show_page (surface->target);
 



More information about the cairo-commit mailing list