mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 12:48:04 +02:00
Simplify _cairo_clip_intersect_region()
The intermediate intersection region is not necessary because if the operation fails, clip->region will end up as a pixman error region.
This commit is contained in:
parent
fe10cd6467
commit
c2c637cf1d
1 changed files with 5 additions and 14 deletions
|
|
@ -357,23 +357,14 @@ _cairo_clip_intersect_region (cairo_clip_t *clip,
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
if (!clip->has_region) {
|
||||
if (clip->has_region) {
|
||||
status = _cairo_region_intersect (&clip->region,
|
||||
&clip->region,
|
||||
®ion);
|
||||
} else {
|
||||
status = _cairo_region_copy (&clip->region, ®ion);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
clip->has_region = TRUE;
|
||||
} else {
|
||||
cairo_region_t intersection;
|
||||
|
||||
_cairo_region_init (&intersection);
|
||||
|
||||
status = _cairo_region_intersect (&intersection,
|
||||
&clip->region,
|
||||
®ion);
|
||||
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = _cairo_region_copy (&clip->region, &intersection);
|
||||
|
||||
_cairo_region_fini (&intersection);
|
||||
}
|
||||
|
||||
clip->serial = _cairo_surface_allocate_clip_serial (target);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue