mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-28 23:50:12 +01:00
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>
This commit is contained in:
parent
6c6bd6fb29
commit
e4ebee1cf4
1 changed files with 15 additions and 6 deletions
|
|
@ -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))
|
||||
goto cleanup;
|
||||
|
||||
status = _cairo_pattern_get_ink_extents (mask, &extents.mask);
|
||||
/* XXX slight impedance mismatch */
|
||||
_cairo_box_from_rectangle (&box, &r);
|
||||
status = _cairo_composite_rectangles_intersect_source_extents (&extents,
|
||||
&box);
|
||||
if (unlikely (status))
|
||||
goto cleanup;
|
||||
|
||||
if (! _cairo_rectangle_intersect (&extents.bounded, &extents.mask))
|
||||
status = _cairo_pattern_get_ink_extents (mask, &r);
|
||||
if (unlikely (status))
|
||||
goto cleanup;
|
||||
|
||||
_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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue