summaryrefslogtreecommitdiff
path: root/src/cairo-traps-compositor.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-08-27 14:46:16 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-05 16:11:09 +0100
commitbc792a5e0e196dd9761649b14c9206465b42ef1d (patch)
tree78ffa8e991f1fed99a16fc06cce80bddb8d8a3b5 /src/cairo-traps-compositor.c
parentbdccf4fe51bca785f73205ccd26c4d020669e312 (diff)
downloadcairo-bc792a5e0e196dd9761649b14c9206465b42ef1d.tar.gz
surface: Merge scratch construction into _cairo_surface_create_scratch
We merge _cairo_surface_create_similar_scratch and _cairo_surface_create_similar_solid into a single function named _cairo_surface_create_scratch, to avoid confusion with cairo_surface_create_similar which now will have a different behaviour wrt the sizes and the device-scale. _create_scratch assumes the width and height are in backend coordinates, while create_similar does not.
Diffstat (limited to 'src/cairo-traps-compositor.c')
-rw-r--r--src/cairo-traps-compositor.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c
index 631e172e7..8d679656d 100644
--- a/src/cairo-traps-compositor.c
+++ b/src/cairo-traps-compositor.c
@@ -307,10 +307,11 @@ __clip_to_surface (const cairo_traps_compositor_t *compositor,
if (unlikely (status))
return status;
- mask = _cairo_surface_create_similar_scratch (composite->surface,
- CAIRO_CONTENT_ALPHA,
- extents->width,
- extents->height);
+ mask = _cairo_surface_create_scratch (composite->surface,
+ CAIRO_CONTENT_ALPHA,
+ extents->width,
+ extents->height,
+ NULL);
if (unlikely (mask->status)) {
_cairo_traps_fini (&traps);
return status;
@@ -371,11 +372,11 @@ traps_get_clip_surface (const cairo_traps_compositor_t *compositor,
status = __clip_to_surface (compositor, composite, extents, &surface);
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
- surface = _cairo_surface_create_similar_solid (composite->surface,
- CAIRO_CONTENT_ALPHA,
- extents->width,
- extents->height,
- CAIRO_COLOR_WHITE);
+ surface = _cairo_surface_create_scratch (composite->surface,
+ CAIRO_CONTENT_ALPHA,
+ extents->width,
+ extents->height,
+ CAIRO_COLOR_WHITE);
if (unlikely (surface->status))
return surface;
@@ -430,9 +431,10 @@ create_composite_mask (const cairo_traps_compositor_t *compositor,
TRACE ((stderr, "%s\n", __FUNCTION__));
- surface = _cairo_surface_create_similar_scratch (dst, CAIRO_CONTENT_ALPHA,
- extents->bounded.width,
- extents->bounded.height);
+ surface = _cairo_surface_create_scratch (dst, CAIRO_CONTENT_ALPHA,
+ extents->bounded.width,
+ extents->bounded.height,
+ NULL);
if (unlikely (surface->status))
return surface;
@@ -590,9 +592,10 @@ clip_and_composite_combine (const cairo_traps_compositor_t *compositor,
TRACE ((stderr, "%s\n", __FUNCTION__));
- tmp = _cairo_surface_create_similar_scratch (dst, dst->content,
- extents->bounded.width,
- extents->bounded.height);
+ tmp = _cairo_surface_create_scratch (dst, dst->content,
+ extents->bounded.width,
+ extents->bounded.height,
+ NULL);
if (unlikely (tmp->status))
return tmp->status;