diff options
author | Bryce Harrington <b.harrington@samsung.com> | 2013-10-03 11:13:19 -0700 |
---|---|---|
committer | nisanthmp <nisanth.mp@samsung.com> | 2015-06-12 12:23:34 +0530 |
commit | 7a452ffc0453328a8093d8ffd9a4e25686fde5dd (patch) | |
tree | 64817a21f52d98f41959560c5a46cfb97bc5f26e | |
parent | 31df0838935ec66251397ff70a9bde8e5600f588 (diff) | |
download | cairo-7a452ffc0453328a8093d8ffd9a4e25686fde5dd.tar.gz cairo-7a452ffc0453328a8093d8ffd9a4e25686fde5dd.tar.bz2 cairo-7a452ffc0453328a8093d8ffd9a4e25686fde5dd.zip |
shadow: Add a shadow_surface_extents init routine
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
-rw-r--r-- | src/cairo-surface-shadow.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/cairo-surface-shadow.c b/src/cairo-surface-shadow.c index df50fe722..1fd6078c2 100644 --- a/src/cairo-surface-shadow.c +++ b/src/cairo-surface-shadow.c @@ -242,6 +242,16 @@ _cairo_shadow_cache_list_find (cairo_shadow_cache_list_t *shadow_caches, return NULL; } +static void +_cairo_shadow_surface_extents_init (cairo_rectangle_int_t *extents, + int width, int height) +{ + extents->x = 0; + extents->y = 0; + extents->width = width; + extents->height = height; +} + static double _calculate_shadow_extents_scale (cairo_rectangle_int_t *extents, int shadow_width, int shadow_height) @@ -428,9 +438,8 @@ _cairo_surface_shadow_paint (cairo_surface_t *target, if (! shadow_surface || unlikely (shadow_surface->status)) goto FINISH; - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((device || shadow_cache_list.locked) && shadow->enable_cache && bounded) { content = cairo_surface_get_content (target); @@ -681,9 +690,8 @@ _cairo_surface_shadow_mask (cairo_surface_t *target, if (! shadow_surface || unlikely (shadow_surface->status)) goto FINISH; - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((shadow_cache_list.locked || device) && shadow->enable_cache && bounded) { content = cairo_surface_get_content (target); @@ -943,10 +951,8 @@ _cairo_surface_inset_shadow_stroke (cairo_surface_t *target, goto FINISH; _cairo_surface_get_extents (shadow_surface, &extents); - - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((shadow_cache_list.locked || device) && shadow->enable_cache) { content = cairo_surface_get_content (target); @@ -1238,9 +1244,8 @@ _cairo_surface_shadow_stroke (cairo_surface_t *target, if (unlikely (shadow_surface->status)) goto FINISH; - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((shadow_cache_list.locked || device) && shadow->enable_cache) { content = cairo_surface_get_content (target); @@ -1499,15 +1504,12 @@ _cairo_surface_inset_shadow_fill (cairo_surface_t *target, } if (! shadow_surface) goto FINISH; - if (unlikely (shadow_surface->status)) goto FINISH; _cairo_surface_get_extents (shadow_surface, &extents); - - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((shadow_cache_list.locked || device) && shadow->enable_cache) { content = cairo_surface_get_content (target); @@ -1789,9 +1791,8 @@ _cairo_surface_shadow_fill (cairo_surface_t *target, if (unlikely (shadow_surface->status)) goto FINISH; - shadow_surface_extents.x = shadow_surface_extents.y = 0; - shadow_surface_extents.width = width_out; - shadow_surface_extents.height = height_out; + _cairo_shadow_surface_extents_init (&shadow_surface_extents, + width_out, height_out); if ((shadow_cache_list.locked || device) && shadow->enable_cache) { content = cairo_surface_get_content (target); |