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