mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 04:58:04 +02:00
[surface] Propagate region allocation failure.
Propagate the error status from failing to allocate the region.
This commit is contained in:
parent
c35d226f7d
commit
ea6197c2f5
1 changed files with 10 additions and 11 deletions
|
|
@ -2678,12 +2678,11 @@ _cairo_surface_composite_fixup_unbounded_internal (cairo_surface_t *dst,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t dst_rectangle;
|
cairo_rectangle_int_t dst_rectangle;
|
||||||
cairo_rectangle_int_t drawn_rectangle;
|
cairo_region_t *clear_region;
|
||||||
cairo_region_t *clear_region = NULL;
|
|
||||||
cairo_status_t status;
|
cairo_status_t status;
|
||||||
|
|
||||||
/* The area that was drawn is the area in the destination rectangle but not within
|
/* The area that was drawn is the area in the destination rectangle but
|
||||||
* the source or the mask.
|
* not within the source or the mask.
|
||||||
*/
|
*/
|
||||||
dst_rectangle.x = dst_x;
|
dst_rectangle.x = dst_x;
|
||||||
dst_rectangle.y = dst_y;
|
dst_rectangle.y = dst_y;
|
||||||
|
|
@ -2691,22 +2690,22 @@ _cairo_surface_composite_fixup_unbounded_internal (cairo_surface_t *dst,
|
||||||
dst_rectangle.height = height;
|
dst_rectangle.height = height;
|
||||||
|
|
||||||
clear_region = cairo_region_create_rectangle (&dst_rectangle);
|
clear_region = cairo_region_create_rectangle (&dst_rectangle);
|
||||||
|
status = clear_region->status;
|
||||||
drawn_rectangle = dst_rectangle;
|
if (unlikely (status))
|
||||||
|
goto CLEANUP_REGIONS;
|
||||||
|
|
||||||
if (src_rectangle) {
|
if (src_rectangle) {
|
||||||
if (! _cairo_rectangle_intersect (&drawn_rectangle, src_rectangle))
|
if (! _cairo_rectangle_intersect (&dst_rectangle, src_rectangle))
|
||||||
goto EMPTY;
|
goto EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask_rectangle) {
|
if (mask_rectangle) {
|
||||||
if (! _cairo_rectangle_intersect (&drawn_rectangle, mask_rectangle))
|
if (! _cairo_rectangle_intersect (&dst_rectangle, mask_rectangle))
|
||||||
goto EMPTY;
|
goto EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now compute the area that is in dst_rectangle but not in drawn_rectangle
|
/* Now compute the area that is in dst but not drawn */
|
||||||
*/
|
status = cairo_region_subtract_rectangle (clear_region, &dst_rectangle);
|
||||||
status = cairo_region_subtract_rectangle (clear_region, &drawn_rectangle);
|
|
||||||
if (unlikely (status))
|
if (unlikely (status))
|
||||||
goto CLEANUP_REGIONS;
|
goto CLEANUP_REGIONS;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue