summaryrefslogtreecommitdiff
path: root/src/cairo-paginated-surface.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2007-09-16 19:43:28 +0930
committerAdrian Johnson <ajohnson@redneon.com>2007-09-16 19:43:28 +0930
commit14786385b40aa0ae83e3b077a82e3f34aba63f22 (patch)
treee6bf02991466815635977cd0ce9452e86250c9b7 /src/cairo-paginated-surface.c
parent46cb7e69526e8b5663077e7409dc232a0f56800b (diff)
Change paginated surface size when PS/PDF _set_size() called
The finer-grained fallbacks would not work correctly if the page was set to a larger size. Add _cairo_paginated_surface_set_size() function that is called from cairo_ps_surface_set_size() and cairo_pdf_surface_set_size().
Diffstat (limited to 'src/cairo-paginated-surface.c')
-rw-r--r--src/cairo-paginated-surface.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index b9085734..76cf5bb3 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -128,6 +128,29 @@ _cairo_paginated_surface_get_target (cairo_surface_t *surface)
return paginated_surface->target;
}
+cairo_status_t
+_cairo_paginated_surface_set_size (cairo_surface_t *surface,
+ int width,
+ int height)
+{
+ cairo_paginated_surface_t *paginated_surface;
+
+ assert (_cairo_surface_is_paginated (surface));
+
+ paginated_surface = (cairo_paginated_surface_t *) surface;
+
+ paginated_surface->width = width;
+ paginated_surface->height = height;
+
+ cairo_surface_destroy (paginated_surface->meta);
+ paginated_surface->meta = _cairo_meta_surface_create (paginated_surface->content,
+ width, height);
+ if (cairo_surface_status (paginated_surface->meta))
+ return cairo_surface_status (paginated_surface->meta);
+
+ return CAIRO_STATUS_SUCCESS;
+}
+
static cairo_status_t
_cairo_paginated_surface_finish (void *abstract_surface)
{