gfx/cairo/quartz-mask-non-OVER.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/cairo/quartz-mask-non-OVER.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,80 @@
     1.4 +From: Robert O'Callahan <robert@ocallahan.org>
     1.5 +Bug 579985. Using CGContextSetAlpha to implement mask alpha doesn't work for some operators. r=jrmuizel,a=blocking
     1.6 +
     1.7 +diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     1.8 +--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
     1.9 ++++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
    1.10 +@@ -2734,17 +2734,19 @@ _cairo_quartz_surface_mask (void *abstra
    1.11 + 
    1.12 +     if (IS_EMPTY(surface))
    1.13 + 	return CAIRO_STATUS_SUCCESS;
    1.14 + 
    1.15 +     rv = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
    1.16 +     if (unlikely (rv))
    1.17 + 	return rv;
    1.18 + 
    1.19 +-    if (mask->type == CAIRO_PATTERN_TYPE_SOLID) {
    1.20 ++    /* Using CGContextSetAlpha to implement mask alpha doesn't work for all operators. */
    1.21 ++    if (mask->type == CAIRO_PATTERN_TYPE_SOLID &&
    1.22 ++        op == CAIRO_OPERATOR_OVER) {
    1.23 + 	/* This is easy; we just need to paint with the alpha. */
    1.24 + 	cairo_solid_pattern_t *solid_mask = (cairo_solid_pattern_t *) mask;
    1.25 + 
    1.26 + 	CGContextSetAlpha (surface->cgContext, solid_mask->color.alpha);
    1.27 + 	rv = _cairo_quartz_surface_paint (surface, op, source, clip);
    1.28 + 	CGContextSetAlpha (surface->cgContext, 1.0);
    1.29 + 
    1.30 + 	return rv;
    1.31 +diff --git a/layout/reftests/bugs/579985-1-ref.html b/layout/reftests/bugs/579985-1-ref.html
    1.32 +new file mode 100644
    1.33 +--- /dev/null
    1.34 ++++ b/layout/reftests/bugs/579985-1-ref.html
    1.35 +@@ -0,0 +1,6 @@
    1.36 ++<!DOCTYPE HTML>
    1.37 ++<html>
    1.38 ++<body>
    1.39 ++<div style="width:100px; height:100px; background:blue; opacity:0.5;">Hello</div>
    1.40 ++</body>
    1.41 ++</html>
    1.42 +diff --git a/layout/reftests/bugs/579985-1.html b/layout/reftests/bugs/579985-1.html
    1.43 +new file mode 100644
    1.44 +--- /dev/null
    1.45 ++++ b/layout/reftests/bugs/579985-1.html
    1.46 +@@ -0,0 +1,16 @@
    1.47 ++<!DOCTYPE HTML>
    1.48 ++<html class="reftest-wait">
    1.49 ++<head>
    1.50 ++<script>
    1.51 ++function doTest() {
    1.52 ++  var d = document.getElementById("d");
    1.53 ++  d.style.opacity = 0.75;
    1.54 ++  document.documentElement.removeAttribute("class");
    1.55 ++}
    1.56 ++window.addEventListener("MozReftestInvalidate", doTest, false);
    1.57 ++</script>
    1.58 ++</head>
    1.59 ++<body>
    1.60 ++<div id="d" style="width:100px; height:100px; background:blue;">Hello</div>
    1.61 ++</body>
    1.62 ++</html>
    1.63 +diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list
    1.64 +--- a/layout/reftests/bugs/reftest.list
    1.65 ++++ b/layout/reftests/bugs/reftest.list
    1.66 +@@ -1499,16 +1499,17 @@ random-if(layersGPUAccelerated) == 56499
    1.67 + == 571347-3.html 571347-3-ref.html
    1.68 + == 572598-1.html 572598-ref.html
    1.69 + == 574898-1.html 574898-ref.html
    1.70 + == 579655-1.html 579655-1-ref.html
    1.71 + == 577838-1.html 577838-1-ref.html
    1.72 + == 577838-2.html 577838-2-ref.html
    1.73 + random-if(layersGPUAccelerated) == 579323-1.html 579323-1-ref.html
    1.74 + == 579349-1.html 579349-1-ref.html
    1.75 ++== 579985-1.html 579985-1-ref.html
    1.76 + == 580160-1.html 580160-1-ref.html
    1.77 + HTTP(..) == 580863-1.html 580863-1-ref.html
    1.78 + random-if(layersGPUAccelerated) == 581317-1.html 581317-1-ref.html
    1.79 + == 581579-1.html 581579-1-ref.html
    1.80 + == 582037-1a.html 582037-1-ref.html
    1.81 + == 582037-1b.html 582037-1-ref.html
    1.82 + == 582037-2a.html 582037-2-ref.html
    1.83 + == 582037-2b.html 582037-2-ref.html

mercurial