|
1 From: Robert O'Callahan <robert@ocallahan.org> |
|
2 Bug 579985. Using CGContextSetAlpha to implement mask alpha doesn't work for some operators. r=jrmuizel,a=blocking |
|
3 |
|
4 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
5 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
6 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
7 @@ -2734,17 +2734,19 @@ _cairo_quartz_surface_mask (void *abstra |
|
8 |
|
9 if (IS_EMPTY(surface)) |
|
10 return CAIRO_STATUS_SUCCESS; |
|
11 |
|
12 rv = _cairo_surface_clipper_set_clip (&surface->clipper, clip); |
|
13 if (unlikely (rv)) |
|
14 return rv; |
|
15 |
|
16 - if (mask->type == CAIRO_PATTERN_TYPE_SOLID) { |
|
17 + /* Using CGContextSetAlpha to implement mask alpha doesn't work for all operators. */ |
|
18 + if (mask->type == CAIRO_PATTERN_TYPE_SOLID && |
|
19 + op == CAIRO_OPERATOR_OVER) { |
|
20 /* This is easy; we just need to paint with the alpha. */ |
|
21 cairo_solid_pattern_t *solid_mask = (cairo_solid_pattern_t *) mask; |
|
22 |
|
23 CGContextSetAlpha (surface->cgContext, solid_mask->color.alpha); |
|
24 rv = _cairo_quartz_surface_paint (surface, op, source, clip); |
|
25 CGContextSetAlpha (surface->cgContext, 1.0); |
|
26 |
|
27 return rv; |
|
28 diff --git a/layout/reftests/bugs/579985-1-ref.html b/layout/reftests/bugs/579985-1-ref.html |
|
29 new file mode 100644 |
|
30 --- /dev/null |
|
31 +++ b/layout/reftests/bugs/579985-1-ref.html |
|
32 @@ -0,0 +1,6 @@ |
|
33 +<!DOCTYPE HTML> |
|
34 +<html> |
|
35 +<body> |
|
36 +<div style="width:100px; height:100px; background:blue; opacity:0.5;">Hello</div> |
|
37 +</body> |
|
38 +</html> |
|
39 diff --git a/layout/reftests/bugs/579985-1.html b/layout/reftests/bugs/579985-1.html |
|
40 new file mode 100644 |
|
41 --- /dev/null |
|
42 +++ b/layout/reftests/bugs/579985-1.html |
|
43 @@ -0,0 +1,16 @@ |
|
44 +<!DOCTYPE HTML> |
|
45 +<html class="reftest-wait"> |
|
46 +<head> |
|
47 +<script> |
|
48 +function doTest() { |
|
49 + var d = document.getElementById("d"); |
|
50 + d.style.opacity = 0.75; |
|
51 + document.documentElement.removeAttribute("class"); |
|
52 +} |
|
53 +window.addEventListener("MozReftestInvalidate", doTest, false); |
|
54 +</script> |
|
55 +</head> |
|
56 +<body> |
|
57 +<div id="d" style="width:100px; height:100px; background:blue;">Hello</div> |
|
58 +</body> |
|
59 +</html> |
|
60 diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list |
|
61 --- a/layout/reftests/bugs/reftest.list |
|
62 +++ b/layout/reftests/bugs/reftest.list |
|
63 @@ -1499,16 +1499,17 @@ random-if(layersGPUAccelerated) == 56499 |
|
64 == 571347-3.html 571347-3-ref.html |
|
65 == 572598-1.html 572598-ref.html |
|
66 == 574898-1.html 574898-ref.html |
|
67 == 579655-1.html 579655-1-ref.html |
|
68 == 577838-1.html 577838-1-ref.html |
|
69 == 577838-2.html 577838-2-ref.html |
|
70 random-if(layersGPUAccelerated) == 579323-1.html 579323-1-ref.html |
|
71 == 579349-1.html 579349-1-ref.html |
|
72 +== 579985-1.html 579985-1-ref.html |
|
73 == 580160-1.html 580160-1-ref.html |
|
74 HTTP(..) == 580863-1.html 580863-1-ref.html |
|
75 random-if(layersGPUAccelerated) == 581317-1.html 581317-1-ref.html |
|
76 == 581579-1.html 581579-1-ref.html |
|
77 == 582037-1a.html 582037-1-ref.html |
|
78 == 582037-1b.html 582037-1-ref.html |
|
79 == 582037-2a.html 582037-2-ref.html |
|
80 == 582037-2b.html 582037-2-ref.html |