Reviewed by keithp

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).
This commit is contained in:
Carl Worth 2006-01-06 14:24:55 +00:00
parent fbb8a62797
commit 7ce7b20a82
2 changed files with 32 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2006-01-06 Carl Worth <cworth@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).
2006-01-06 Carl Worth <cworth@cworth.org>
Reviewed by keithp

View file

@ -168,13 +168,33 @@ _cairo_paginated_surface_release_source_image (void *abstract_surface,
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_show_page (void *abstract_surface)
{
cairo_paginated_surface_t *surface = abstract_surface;
_cairo_meta_surface_replay (surface->meta, surface->target);
_paint_page (surface);
_cairo_surface_show_page (surface->target);