1 diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c
2 --- a/gfx/cairo/cairo/src/cairo-image-surface.c
3 +++ b/gfx/cairo/cairo/src/cairo-image-surface.c
4 @@ -1788,18 +1788,35 @@ static cairo_status_t
10 struct _cairo_boxes_chunk *chunk;
13 - if (boxes->num_boxes < 1 && clip_region == NULL)
14 - return _cairo_image_surface_fixup_unbounded (dst, extents, NULL);
15 + // If we have no boxes then we need to clear the entire extents
16 + // because we have nothing to draw.
17 + if (boxes->num_boxes < 1 && clip_region == NULL) {
18 + int x = extents->unbounded.x;
19 + int y = extents->unbounded.y;
20 + int width = extents->unbounded.width;
21 + int height = extents->unbounded.height;
23 + pixman_color_t color = { 0 };
24 + pixman_box32_t box = { x, y, x + width, y + height };
26 + if (! pixman_image_fill_boxes (PIXMAN_OP_CLEAR,
30 + return _cairo_error (CAIRO_STATUS_NO_MEMORY);
32 + return CAIRO_STATUS_SUCCESS;
35 _cairo_boxes_init (&clear);
37 box.p1.x = _cairo_fixed_from_int (extents->unbounded.x + extents->unbounded.width);
38 box.p1.y = _cairo_fixed_from_int (extents->unbounded.y);
39 box.p2.x = _cairo_fixed_from_int (extents->unbounded.x);
40 box.p2.y = _cairo_fixed_from_int (extents->unbounded.y + extents->unbounded.height);