diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 16:19:31 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 23:01:51 +0000 |
commit | 29bedde904824098f73b978d73d36b3b5420ac32 (patch) | |
tree | 6802612ed1781127755aedf8f9e59c1192b50137 /src/cairo-surface-fallback.c | |
parent | 9eb98e1dc5af7eac896bf469e491063777e678be (diff) |
pattern: Add convenience patterns for stock colours
By preallocating in our data segment a couple of solid patterns for the
stock colours, it becomes more convenient when using those in surface
operations, such as when clearing.
Diffstat (limited to 'src/cairo-surface-fallback.c')
-rw-r--r-- | src/cairo-surface-fallback.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c index a20bd68c..51e3d7ee 100644 --- a/src/cairo-surface-fallback.c +++ b/src/cairo-surface-fallback.c @@ -127,7 +127,6 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern, { cairo_surface_t *mask; cairo_region_t *clip_region = NULL; - cairo_solid_pattern_t solid; cairo_status_t status; cairo_bool_t clip_surface = FALSE; @@ -156,9 +155,8 @@ _create_composite_mask_pattern (cairo_surface_pattern_t *mask_pattern, if (unlikely (mask->status)) return mask->status; - _cairo_pattern_init_solid (&solid, CAIRO_COLOR_WHITE, CAIRO_CONTENT_ALPHA); status = draw_func (draw_closure, CAIRO_OPERATOR_ADD, - &solid.base, mask, + &_cairo_pattern_white.base, mask, extents->x, extents->y, extents, clip_region); @@ -416,7 +414,6 @@ _clip_and_composite (cairo_clip_t *clip, cairo_surface_t *dst, const cairo_rectangle_int_t *extents) { - cairo_solid_pattern_t solid_pattern; cairo_status_t status; if (_cairo_rectangle_empty (extents)) @@ -424,9 +421,7 @@ _clip_and_composite (cairo_clip_t *clip, return CAIRO_STATUS_SUCCESS; if (op == CAIRO_OPERATOR_CLEAR) { - _cairo_pattern_init_solid (&solid_pattern, CAIRO_COLOR_WHITE, - CAIRO_CONTENT_COLOR); - src = &solid_pattern.base; + src = &_cairo_pattern_white.base; op = CAIRO_OPERATOR_DEST_OUT; } @@ -487,7 +482,6 @@ _composite_trap_region (cairo_clip_t *clip, const cairo_rectangle_int_t *extents) { cairo_status_t status; - cairo_solid_pattern_t solid_pattern; cairo_surface_pattern_t mask_pattern; cairo_pattern_t *mask = NULL; int mask_x = 0, mask_y =0; @@ -501,9 +495,7 @@ _composite_trap_region (cairo_clip_t *clip, return clip_surface->status; if (op == CAIRO_OPERATOR_CLEAR) { - _cairo_pattern_init_solid (&solid_pattern, CAIRO_COLOR_WHITE, - CAIRO_CONTENT_COLOR); - src = &solid_pattern.base; + src = &_cairo_pattern_white.base; op = CAIRO_OPERATOR_DEST_OUT; } |