[cairo-commit] cairo/src cairo-paginated-surface.c,1.6,1.7

Carl Worth commit at pdx.freedesktop.org
Wed Jan 11 16:29:20 PST 2006


Committed by: cworth

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

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

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

        * src/cairo-paginated-surface.c:
        (_cairo_paginated_surface_acquire_source_image), (_paint_page),
        (_cairo_paginated_surface_snapshot): Paint with white to
        intermediate RGB24 images before replaying meta-surface to
        preserve default white background instead of forcing a black
        background instead.


Index: cairo-paginated-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-paginated-surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo-paginated-surface.c	12 Jan 2006 00:01:25 -0000	1.6
+++ cairo-paginated-surface.c	12 Jan 2006 00:29:18 -0000	1.7
@@ -163,11 +163,18 @@
     cairo_paginated_surface_t *surface = abstract_surface;
     cairo_surface_t *image;
     cairo_rectangle_t extents;
+    cairo_pattern_t *white;
 
     _cairo_surface_get_extents (surface->target, &extents);
 
     image = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
 					extents.width, extents.height);
+    
+    white = _cairo_pattern_create_solid (_cairo_stock_color (CAIRO_STOCK_WHITE));
+
+    _cairo_surface_paint (image, CAIRO_OPERATOR_SOURCE, white);
+
+    cairo_pattern_destroy (white);
 
     _cairo_meta_surface_replay (surface->meta, image);
 
@@ -189,11 +196,17 @@
 _paint_page (cairo_paginated_surface_t *surface)
 {
     cairo_surface_t *image;
-    cairo_pattern_t *pattern;
+    cairo_pattern_t *white, *pattern;
 
     image = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
 					surface->width, surface->height);
 
+    white = _cairo_pattern_create_solid (_cairo_stock_color (CAIRO_STOCK_WHITE));
+
+    _cairo_surface_paint (image, CAIRO_OPERATOR_SOURCE, white);
+
+    cairo_pattern_destroy (white);
+
     _cairo_meta_surface_replay (surface->meta, image);
 
     pattern = cairo_pattern_create_for_surface (image);
@@ -372,6 +385,7 @@
 #else
     cairo_rectangle_t extents;
     cairo_surface_t *surface;
+    cairo_pattern_t *white;
 
     _cairo_surface_get_extents (other->target, &extents);
 
@@ -379,6 +393,12 @@
 					  extents.width,
 					  extents.height);
 
+    white = _cairo_pattern_create_solid (_cairo_stock_color (CAIRO_STOCK_WHITE));
+
+    _cairo_surface_paint (surface, CAIRO_OPERATOR_SOURCE, white);
+
+    cairo_pattern_destroy (white);
+
     _cairo_meta_surface_replay (other->meta, surface);
 
     return surface;



More information about the cairo-commit mailing list