[cairo-commit] cairo/src cairo-paginated-surface.c,1.7,1.8
Carl Worth
commit at pdx.freedesktop.org
Thu Jan 12 16:47:08 PST 2006
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv13026/src
Modified Files:
cairo-paginated-surface.c
Log Message:
2006-01-12 Carl Worth <cworth at cworth.org>
* test/multi-page.c: (draw_some_pages), (main): Add a call to
cairo_copy_page, so that that gets called at least once within the
test suite.
* src/cairo-paginated-surface.c:
(_cairo_paginated_surface_copy_page): Fix broken implementation of
copy_page in the paginated surface by hiding it from the target
surface which sees only show_page operations. (It's hard to do
better than that unless we can guarantee thathe subsequent page
won't trigger any image fallbacks.)
Index: cairo-paginated-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-paginated-surface.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cairo-paginated-surface.c 12 Jan 2006 00:29:18 -0000 1.7
+++ cairo-paginated-surface.c 13 Jan 2006 00:47:06 -0000 1.8
@@ -222,31 +222,18 @@
_cairo_paginated_surface_copy_page (void *abstract_surface)
{
cairo_paginated_surface_t *surface = abstract_surface;
- cairo_int_status_t status;
_paint_page (surface);
- status = _cairo_surface_copy_page (surface->target);
-
- /* If the surface does not support copy_page then we use show_page
- * instead, and we leave the meta-surface untouched so that its
- * contents will remain for the next page. */
- if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
- status = _cairo_surface_show_page (surface->target);
- /* And if the surface doesn't support show_page either, we
- * also fall through and clear the meta-surface. */
- if (status != CAIRO_INT_STATUS_UNSUPPORTED)
- return status;
- }
-
- /* Otherwise, we clear the meta-surface since the target surface
- * has already taken care of any copying in its implementation of
- * copy_page. */
- cairo_surface_destroy (surface->meta);
+ /* XXX: It might make sense to add some suport here for calling
+ * _cairo_surface_copy_page on the target surface. It would be an
+ * optimization for the output, (so that PostScript could include
+ * copypage, for example), but the interaction with image
+ * fallbacks gets tricky. For now, we just let the target see a
+ * show_page and we implement the copying by simply not destroying
+ * the meta-surface. */
- surface->meta = _cairo_meta_surface_create (surface->width, surface->height);
- if (cairo_surface_status (surface->meta))
- return cairo_surface_status (surface->meta);
+ _cairo_surface_show_page (surface->target);
return CAIRO_STATUS_SUCCESS;
}
More information about the cairo-commit
mailing list