forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cairo-region-clip.patch
34 lines (31 loc) · 1.27 KB
/
cairo-region-clip.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# HG changeset patch
# User Matt Woodrow <[email protected]>
# Date 1408674084 -43200
# Fri Aug 22 14:21:24 2014 +1200
# Node ID 2b819b882c3b26c02d821e8d713591a9b56f1728
# Parent ffd1fc7e7d5a85e4823b5f2067b4a24d358a0e41
Bug 1050788 - Fix cairo clip path region construction when the first path generates no traps. r=jrmuizel
diff --git a/gfx/cairo/cairo/src/cairo-clip.c b/gfx/cairo/cairo/src/cairo-clip.c
--- a/gfx/cairo/cairo/src/cairo-clip.c
+++ b/gfx/cairo/cairo/src/cairo-clip.c
@@ -590,16 +590,22 @@ static cairo_int_status_t
status = _cairo_path_fixed_fill_rectilinear_to_traps (&clip_path->path,
clip_path->fill_rule,
&traps);
if (unlikely (_cairo_status_is_error (status)))
return status;
if (status == CAIRO_INT_STATUS_UNSUPPORTED)
goto UNSUPPORTED;
+ if (unlikely (traps.num_traps == 0)) {
+ clip_path->region = cairo_region_create ();
+ clip_path->flags |= CAIRO_CLIP_PATH_HAS_REGION;
+ return CAIRO_STATUS_SUCCESS;
+ }
+
if (traps.num_traps > ARRAY_LENGTH (stack_boxes)) {
boxes = _cairo_malloc_ab (traps.num_traps, sizeof (cairo_box_t));
if (unlikely (boxes == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
for (n = 0; n < traps.num_traps; n++) {
boxes[n].p1.x = traps.traps[n].left.p1.x;