Bug 772726. Part 4: Fix SampleTextTexturesPS(Masked) shaders to premultiply TextColor. r=jrmuizel

--HG--
extra : rebase_source : 76781e7f69db6d47b3ecf8d8c37bac284133c6be
This commit is contained in:
Bas Schouten 2012-07-18 01:02:08 -04:00
parent d5e555eeca
commit c6748c7b62
3 changed files with 907 additions and 873 deletions

View File

@ -301,7 +301,7 @@ float4 SampleMaskShadowVPS( VS_OUTPUT In) : SV_Target
PS_TEXT_OUTPUT SampleTextTexturePS( VS_OUTPUT In) : SV_Target
{
PS_TEXT_OUTPUT output;
output.color = TextColor;
output.color = float4(TextColor.r, TextColor.g, TextColor.b, 1.0);
output.alpha.rgba = tex.Sample(sSampler, In.TexCoord).bgrg * TextColor.a;
return output;
};
@ -312,7 +312,7 @@ PS_TEXT_OUTPUT SampleTextTexturePSMasked( VS_OUTPUT In) : SV_Target
float maskValue = mask.Sample(sMaskSampler, In.MaskTexCoord).a;
output.color = TextColor * maskValue;
output.color = float4(TextColor.r, TextColor.g, TextColor.b, 1.0);
output.alpha.rgba = tex.Sample(sSampler, In.TexCoord).bgrg * TextColor.a * maskValue;
return output;

File diff suppressed because it is too large Load Diff

5
gfx/2d/genshaders.sh Normal file
View File

@ -0,0 +1,5 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
fxc ShadersD2D.fx -nologo -FhShadersD2D.h -Tfx_4_0 -Vn d2deffect