Bug 993428 - Fix masks with d3d9 component alpha layers. r=Bas
authorNicolas Silva <nical@mozilla.com>
Wed, 09 Apr 2014 19:17:13 +0200
changeset 196429 51eed87506d273a4b5c30e2a8b7d761462f4d519
parent 196428 3bdbe71f21b2bac51276064354edfcc5d8283e0a
child 196430 ba08bcd1d729a196e92cf41e330f8f464a4a088d
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs993428
milestone31.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 993428 - Fix masks with d3d9 component alpha layers. r=Bas
gfx/layers/d3d9/CompositorD3D9.cpp
--- a/gfx/layers/d3d9/CompositorD3D9.cpp
+++ b/gfx/layers/d3d9/CompositorD3D9.cpp
@@ -428,26 +428,27 @@ CompositorD3D9::DrawQuad(const gfx::Rect
                                            ShaderConstantRect(
                                              textureCoords.x,
                                              textureCoords.y,
                                              textureCoords.width,
                                              textureCoords.height),
                                            1);
 
       SetSamplerForFilter(effectComponentAlpha->mFilter);
-      SetMask(aEffectChain, maskTexture);
 
       maskTexture = mDeviceManager->SetShaderMode(DeviceManagerD3D9::COMPONENTLAYERPASS1, maskType);
+      SetMask(aEffectChain, maskTexture);
       d3d9Device->SetTexture(0, sourceOnBlack->GetD3D9Texture());
       d3d9Device->SetTexture(1, sourceOnWhite->GetD3D9Texture());
       d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
       d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
       d3d9Device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
 
       maskTexture = mDeviceManager->SetShaderMode(DeviceManagerD3D9::COMPONENTLAYERPASS2, maskType);
+      SetMask(aEffectChain, maskTexture);
       d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
       d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
       d3d9Device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
 
       // Restore defaults
       d3d9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
       d3d9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
       d3d9Device->SetTexture(1, nullptr);