Bug 1028288: Add two reftests for globalAlpha. One just tests globalAlpha, and one tests scaling and globalAlpha. r=roc
authorJames Kolb <jck1089@gmail.com>
Sat, 02 Aug 2014 16:14:55 +0900
changeset 197470 dfb5303af6f9f16875ee10651fe4cd93bcd6e981
parent 197469 950a3afc2b15226d88209eea5f80fa9bdfe0cc4b
child 197471 9b2e7a87fac5c886ec2f2a09ae8f390d42c381f8
push id47138
push userVYV03354@nifty.ne.jp
push dateSat, 02 Aug 2014 07:15:38 +0000
treeherdermozilla-inbound@dfb5303af6f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1028288
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1028288: Add two reftests for globalAlpha. One just tests globalAlpha, and one tests scaling and globalAlpha. r=roc
layout/reftests/svg/as-image/canvas-drawImage-alpha-1-ref.html
layout/reftests/svg/as-image/canvas-drawImage-alpha-1.html
layout/reftests/svg/as-image/canvas-drawImage-alpha-2-ref.html
layout/reftests/svg/as-image/canvas-drawImage-alpha-2.html
layout/reftests/svg/as-image/reftest.list
layout/reftests/svg/as-image/squaredCircle-transparent.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/canvas-drawImage-alpha-1-ref.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+  <div style="width: 100px; height: 100px; background: orange; position:absolute"></div>
+  <div style="width: 100px; height: 100px; background: lime; opacity: .25; position:absolute"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/canvas-drawImage-alpha-1.html
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <script type="text/javascript">
+      function go() {
+        var canvas = document.getElementById("canvas");
+        var ctx = canvas.getContext("2d");
+        var image = document.getElementById("image");
+
+        // Draw some orange
+        ctx.fillStyle = "orange";
+        ctx.fillRect(0, 0, 100, 100);
+
+        ctx.globalAlpha = 0.25;
+        ctx.drawImage(image, 0, 0);
+      }
+    </script>
+  </head>
+  <body onload="go()">
+    <canvas id="canvas" width="200" height="200"></canvas>
+    <img id="image" src="lime100x100.svg" style="display: none">
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/canvas-drawImage-alpha-2-ref.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+  <embed style="width: 200px; height: 200px;"
+         src="squaredCircle-transparent.svg"/>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/canvas-drawImage-alpha-2.html
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <script type="text/javascript">
+      function go() {
+        var canvas = document.getElementById("canvas");
+        var ctx = canvas.getContext("2d");
+        var image = document.getElementById("image");
+
+        // Draw some orange
+        ctx.fillStyle = "orange";
+        ctx.fillRect(0, 0, 200, 200);
+
+        ctx.globalAlpha = 0.75;
+        ctx.drawImage(image, 0, 0, 200, 200);
+      }
+    </script>
+  </head>
+  <body onload="go()">
+    <canvas id="canvas" width="200" height="200"></canvas>
+    <img id="image" src="squaredCircle-viewBox-100x100.svg" style="display: none">
+  </body>
+</html>
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -40,16 +40,20 @@ skip-if(B2G) == background-image-rect-1s
 skip-if(B2G) == canvas-drawImage-scale-1a.html lime100x100-ref.html
 skip-if(B2G) == canvas-drawImage-scale-1b.html lime100x100-ref.html
 skip-if(B2G) == canvas-drawImage-scale-1c.html lime100x100-ref.html
 
 # Fuzzyness and fails for scaling should be fixed by bug 941467
 fuzzy(1,2) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == canvas-drawImage-scale-2a.html canvas-drawImage-scale-2-ref.html
 fails == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html
 
+fuzzy-if(winWidget&&!d2d,1,10000) fuzzy-if(Android||B2G,1,10000) == canvas-drawImage-alpha-1.html canvas-drawImage-alpha-1-ref.html
+#Same as scale-2a but with globalAlpha:
+fuzzy(1,2) fuzzy-if(winWidget&&!d2d,1,40000) fuzzy-if(Android||B2G,1,40000) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
+
 skip-if(B2G) == canvas-drawImage-slice-1a.html lime100x100-ref.html
 == canvas-drawImage-slice-1b.html lime100x100-ref.html
 
 == canvas-drawImage-origin-clean-1.html lime100x100-ref.html
 
 # Simple <img> tests
 == img-simple-1.html  lime100x100-ref.html
 == img-simple-2.html  lime100x100-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/squaredCircle-transparent.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" >
+  <rect x="0" y="0" height="100" width="100" fill="orange"/>
+  <g style="opacity:.75">
+      <rect x="2" y="2" height="96" width="96"
+            stroke-width="4" stroke="black" fill="yellow"/>
+      <circle cx="50" cy="50" r="46" style="fill: blue"/>
+  </g>
+</svg>