Bug 723484. Fix alpha values for image layers with opacity. r=bas, a=lsblakk
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 20 Mar 2012 20:55:40 +1300
changeset 90501 15924311257a29c8b89021e0612cf070d34b4da7
parent 90500 96b3f9684808dd9be5b3ebefa1a28096c28dc22c
child 90502 ed87206d099a12c8030c19270b6f415d1c38fe4a
push id1005
push userrocallahan@mozilla.com
push dateThu, 22 Mar 2012 01:30:17 +0000
treeherdermozilla-aurora@f11042d416a0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, lsblakk
bugs723484
milestone13.0a2
Bug 723484. Fix alpha values for image layers with opacity. r=bas, a=lsblakk
gfx/layers/d3d9/LayerManagerD3D9Shaders.h
gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
layout/reftests/bugs/723484-1-ref.html
layout/reftests/bugs/723484-1.html
layout/reftests/bugs/reftest.list
--- a/gfx/layers/d3d9/LayerManagerD3D9Shaders.h
+++ b/gfx/layers/d3d9/LayerManagerD3D9Shaders.h
@@ -480,18 +480,18 @@ const BYTE ComponentPass2ShaderPS[] =
 //   s2D           s0       1
 //
 
     ps_2_0
     def c1, 1, 0, 0, 0
     dcl t0.xy
     dcl_2d s0
     texld r0, t0, s0
-    mul r0.xyz, r0, c0.x
     mov r0.w, c1.x
+    mul r0, r0, c0.x
     mov oC0, r0
 
 // approximately 4 instruction slots used (1 texture, 3 arithmetic)
 #endif
 
 const BYTE RGBShaderPS[] =
 {
       0,   2, 255, 255, 254, 255, 
@@ -531,21 +531,21 @@ const BYTE RGBShaderPS[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,  31,   0,   0,   2, 
       0,   0,   0, 128,   0,   0, 
       3, 176,  31,   0,   0,   2, 
       0,   0,   0, 144,   0,   8, 
      15, 160,  66,   0,   0,   3, 
       0,   0,  15, 128,   0,   0, 
     228, 176,   0,   8, 228, 160, 
+      1,   0,   0,   2,   0,   0, 
+      8, 128,   1,   0,   0, 160, 
       5,   0,   0,   3,   0,   0, 
-      7, 128,   0,   0, 228, 128, 
+     15, 128,   0,   0, 228, 128, 
       0,   0,   0, 160,   1,   0, 
-      0,   2,   0,   0,   8, 128, 
-      1,   0,   0, 160,   1,   0, 
       0,   2,   0,   8,  15, 128, 
       0,   0, 228, 128, 255, 255, 
       0,   0
 };
 #if 0
 //
 // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
 //
--- a/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
+++ b/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl
@@ -79,19 +79,19 @@ float4 ComponentPass2Shader(const VS_OUT
 float4 RGBAShader(const VS_OUTPUT aVertex) : COLOR
 {
   return tex2D(s2D, aVertex.vTexCoords) * fLayerOpacity;
 }
 
 float4 RGBShader(const VS_OUTPUT aVertex) : COLOR
 {
   float4 result;
-  result = tex2D(s2D, aVertex.vTexCoords) * fLayerOpacity;
+  result = tex2D(s2D, aVertex.vTexCoords);
   result.a = 1.0;
-  return result;
+  return result * fLayerOpacity;
 }
 
 float4 YCbCrShader(const VS_OUTPUT aVertex) : COLOR
 {
   float4 yuv;
   float4 color;
 
   yuv.r = tex2D(s2DCr, aVertex.vTexCoords).r - 0.5;
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/723484-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>  
+<html>
+<body style="background:yellow;">
+<img style="opacity:0.001" src="repeatable-diagonal-gradient.png">
+</body> 
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/723484-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>  
+<html class="reftest-wait">
+<body style="background:yellow;">
+<img id="i" src="repeatable-diagonal-gradient.png">
+<script>
+function doTest() {
+  document.getElementById("i").style.opacity = 0.001;
+  document.documentElement.removeAttribute("class");
+}
+window.addEventListener("MozReftestInvalidate", doTest, false);
+</script> 
+</body> 
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1688,11 +1688,12 @@ needs-focus != 703186-1.html 703186-2.ht
 == 713856-dynamic.html 713856-ref.html
 == 714519-1-as.html 714519-1-ref.html
 == 714519-1-q.html 714519-1-ref.html
 == 714519-2-as.html 714519-2-ref.html
 == 714519-2-q.html 714519-2-ref.html
 fuzzy-if(d2d,1,19) fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html
 == 720987.html 720987-ref.html
 == 722923-1.html 722923-1-ref.html
+== 723484-1.html 723484-1-ref.html
 == 729143-1.html 729143-1-ref.html
 needs-focus == 731726-1.html 731726-1-ref.html
 == 735481-1.html 735481-1-ref.html