Bug 1773770: Part 10 - Migrate xpcshell to register components without defining a...
[gecko.git] / gfx / cairo / cairo-region-clip.patch
bloba0eb2d26582c081e7030b29b304e681647cab81b
1 # HG changeset patch
2 # User Matt Woodrow <mwoodrow@mozilla.com>
3 # Date 1408674084 -43200
4 # Fri Aug 22 14:21:24 2014 +1200
5 # Node ID 2b819b882c3b26c02d821e8d713591a9b56f1728
6 # Parent ffd1fc7e7d5a85e4823b5f2067b4a24d358a0e41
7 Bug 1050788 - Fix cairo clip path region construction when the first path generates no traps. r=jrmuizel
9 diff --git a/gfx/cairo/cairo/src/cairo-clip.c b/gfx/cairo/cairo/src/cairo-clip.c
10 --- a/gfx/cairo/cairo/src/cairo-clip.c
11 +++ b/gfx/cairo/cairo/src/cairo-clip.c
12 @@ -590,16 +590,22 @@ static cairo_int_status_t
13 status = _cairo_path_fixed_fill_rectilinear_to_traps (&clip_path->path,
14 clip_path->fill_rule,
15 &traps);
16 if (unlikely (_cairo_status_is_error (status)))
17 return status;
18 if (status == CAIRO_INT_STATUS_UNSUPPORTED)
19 goto UNSUPPORTED;
21 + if (unlikely (traps.num_traps == 0)) {
22 + clip_path->region = cairo_region_create ();
23 + clip_path->flags |= CAIRO_CLIP_PATH_HAS_REGION;
24 + return CAIRO_STATUS_SUCCESS;
25 + }
27 if (traps.num_traps > ARRAY_LENGTH (stack_boxes)) {
28 boxes = _cairo_malloc_ab (traps.num_traps, sizeof (cairo_box_t));
29 if (unlikely (boxes == NULL))
30 return _cairo_error (CAIRO_STATUS_NO_MEMORY);
33 for (n = 0; n < traps.num_traps; n++) {
34 boxes[n].p1.x = traps.traps[n].left.p1.x;