Bug 1271058 - Use Layers effective opacity for determining if it is opaque. r=mstange, a=sylvestre
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 10 May 2016 12:42:57 +1200
changeset 333183 49da7aca28190d9e8a3b4dc7db62ebd5022edfb2
parent 333182 28ba9cceda61248595c8d4c15e23955cc2b5d9bb
child 333184 6f97167428c0e854c819cdac50f15191b7b44ce3
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, sylvestre
bugs1271058
milestone48.0a2
Bug 1271058 - Use Layers effective opacity for determining if it is opaque. r=mstange, a=sylvestre
gfx/layers/Layers.cpp
layout/reftests/transform-3d/1271058-1-ref.html
layout/reftests/transform-3d/1271058-1.html
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -572,17 +572,17 @@ Layer::ApplyPendingUpdatesToSubtree()
     // updates from the manager.
     Manager()->ClearPendingScrollInfoUpdate();
   }
 }
 
 bool
 Layer::IsOpaqueForVisibility()
 {
-  return GetLocalOpacity() == 1.0f &&
+  return GetEffectiveOpacity() == 1.0f &&
          GetEffectiveMixBlendMode() == CompositionOp::OP_OVER;
 }
 
 bool
 Layer::CanUseOpaqueSurface()
 {
   // If the visible content in the layer is opaque, there is no need
   // for an alpha channel.
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform-3d/1271058-1-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<canvas id="canvas" width="200" height="200"></canvas>
+</body>
+<script>
+    var canvas = document.getElementById("canvas");
+    var ctx = canvas.getContext("2d");
+    ctx.fillStyle = "green";
+    ctx.fillRect(0, 0, 200, 200);
+</script>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform-3d/1271058-1.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html><head>
+<style>
+    .preserve {
+        transform-style: preserve-3d;
+    }
+    .leaf {
+        width: 300px;
+        height: 300px;
+        position:absolute;
+        transform: translateZ(0px);
+        background-color: red;
+        top: -220px;
+        left: -20px;
+    }
+</style>
+</head><body>
+
+<canvas id="canvas" width="200" height="200"></canvas>
+<div class="preserve">
+    <div class="preserve" style="opacity:0.0001">
+        <div class="leaf"></div>
+    </div>
+</div>
+
+</body>
+<script>
+    var canvas = document.getElementById("canvas");
+    var ctx = canvas.getContext("2d");
+    ctx.fillStyle = "green";
+    ctx.fillRect(0, 0, 200, 200);
+</script>
+</html>
+