From fc48341b79822302421001e184cd24fa743256cd Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 27 Jul 2010 17:33:17 +0200 Subject: [PATCH] quartz: add public function to set/update the size of a Quartz surface --- src/cairo-quartz-surface.c | 21 +++++++++++++++++++++ src/cairo-quartz.h | 5 +++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 06fe181..dc777c3 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -3158,6 +3158,27 @@ cairo_quartz_surface_create (cairo_format_t format, } /** + * cairo_quartz_surface_set_size + * @surface: set Cairo Quartz surface + * @width: new width of the surface, in pixels + * @height: new height of the surface, in pixels + * + * Sets the size of the given Quartz surface to be @width, @height. + * + * Since: 1.10 + **/ +void +cairo_quartz_surface_set_size (cairo_surface_t *surface, + unsigned int width, + unsigned int height) +{ + cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t *)surface; + + quartz->extents.width = width; + quartz->extents.height = height; +} + +/** * cairo_quartz_surface_get_cg_context * @surface: the Cairo Quartz surface * diff --git a/src/cairo-quartz.h b/src/cairo-quartz.h index 8d001c5..95b7ca5 100644 --- a/src/cairo-quartz.h +++ b/src/cairo-quartz.h @@ -54,6 +54,11 @@ cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext, unsigned int width, unsigned int height); +cairo_public void +cairo_quartz_surface_set_size (cairo_surface_t *surface, + unsigned int width, + unsigned int height); + cairo_public CGContextRef cairo_quartz_surface_get_cg_context (cairo_surface_t *surface); -- 1.6.4.4