summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-09-18 08:25:11 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-18 08:27:06 +0100
commite4ebee1cf47f5c211abb79b8e3a3bc5ff7a5cc4b (patch)
tree571943f7b34e934f698b84879e4ccfc1c4319c02 /src/cairo-pdf-surface.c
parent6c6bd6fb292c7168b60f1cc0580c52292f99ae86 (diff)
pdf: Use the helper functions to update the composite rectangles
These functions also know to update the clip and recompute the sample areas and other derived information. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-pdf-surface.c')
-rw-r--r--src/cairo-pdf-surface.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 8da4f7ba..988a2155 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -6104,6 +6104,8 @@ _cairo_pdf_surface_mask (void *abstract_surface,
cairo_pdf_smask_group_t *group;
cairo_composite_rectangles_t extents;
cairo_int_status_t status;
+ cairo_rectangle_int_t r;
+ cairo_box_t box;
status = _cairo_composite_rectangles_init_for_mask (&extents,
&surface->base,
@@ -6141,18 +6143,25 @@ _cairo_pdf_surface_mask (void *abstract_surface,
assert (_cairo_pdf_surface_operation_supported (surface, op, mask, &extents.bounded));
/* get the accurate extents */
- status = _cairo_pattern_get_ink_extents (source, &extents.source);
+ status = _cairo_pattern_get_ink_extents (source, &r);
if (unlikely (status))
goto cleanup;
- if (! _cairo_rectangle_intersect (&extents.bounded, &extents.source))
+ /* XXX slight impedance mismatch */
+ _cairo_box_from_rectangle (&box, &r);
+ status = _cairo_composite_rectangles_intersect_source_extents (&extents,
+ &box);
+ if (unlikely (status))
goto cleanup;
- status = _cairo_pattern_get_ink_extents (mask, &extents.mask);
+ status = _cairo_pattern_get_ink_extents (mask, &r);
if (unlikely (status))
goto cleanup;
- if (! _cairo_rectangle_intersect (&extents.bounded, &extents.mask))
+ _cairo_box_from_rectangle (&box, &r);
+ status = _cairo_composite_rectangles_intersect_mask_extents (&extents,
+ &box);
+ if (unlikely (status))
goto cleanup;
status = _cairo_pdf_surface_set_clip (surface, &extents);