diff --git a/gfx/layers/d3d9/ImageLayerD3D9.cpp b/gfx/layers/d3d9/ImageLayerD3D9.cpp index c1e14e80b9c3..4f56e02800f0 100644 --- a/gfx/layers/d3d9/ImageLayerD3D9.cpp +++ b/gfx/layers/d3d9/ImageLayerD3D9.cpp @@ -184,31 +184,31 @@ static void AllocateTexturesYCbCr(PlanarYCbCrImage *aImage, HRESULT hr; hr = aDevice->CreateTexture(data->mYSize.width, data->mYSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT, + 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, getter_AddRefs(backendData->mYTexture), nullptr); if (!FAILED(hr)) { hr = aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT, + 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, getter_AddRefs(backendData->mCbTexture), nullptr); } if (!FAILED(hr)) { hr = aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_DEFAULT, + 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, getter_AddRefs(backendData->mCrTexture), nullptr); } if (!FAILED(hr)) { hr = aDevice->CreateTexture(data->mYSize.width, data->mYSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_SYSTEMMEM, + 1, 0, D3DFMT_A8, D3DPOOL_SYSTEMMEM, getter_AddRefs(tmpYTexture), nullptr); } if (!FAILED(hr)) { hr = aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_SYSTEMMEM, + 1, 0, D3DFMT_A8, D3DPOOL_SYSTEMMEM, getter_AddRefs(tmpCbTexture), nullptr); } if (!FAILED(hr)) { hr = aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_SYSTEMMEM, + 1, 0, D3DFMT_A8, D3DPOOL_SYSTEMMEM, getter_AddRefs(tmpCrTexture), nullptr); } @@ -227,16 +227,16 @@ static void AllocateTexturesYCbCr(PlanarYCbCrImage *aImage, } else { HRESULT hr; hr = aDevice->CreateTexture(data->mYSize.width, data->mYSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_MANAGED, + 1, 0, D3DFMT_A8, D3DPOOL_MANAGED, getter_AddRefs(backendData->mYTexture), nullptr); if (!FAILED(hr)) { aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_MANAGED, + 1, 0, D3DFMT_A8, D3DPOOL_MANAGED, getter_AddRefs(backendData->mCbTexture), nullptr); } if (!FAILED(hr)) { aDevice->CreateTexture(data->mCbCrSize.width, data->mCbCrSize.height, - 1, 0, D3DFMT_L8, D3DPOOL_MANAGED, + 1, 0, D3DFMT_A8, D3DPOOL_MANAGED, getter_AddRefs(backendData->mCrTexture), nullptr); } diff --git a/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl b/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl index 35e6b16fad34..710edb796022 100644 --- a/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl +++ b/gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl @@ -189,9 +189,9 @@ float4 YCbCrShader(const VS_OUTPUT aVertex) : COLOR float4 yuv; float4 color; - yuv.r = tex2D(s2DCr, aVertex.vTexCoords).r - 0.5; - yuv.g = tex2D(s2DY, aVertex.vTexCoords).r - 0.0625; - yuv.b = tex2D(s2DCb, aVertex.vTexCoords).r - 0.5; + yuv.r = tex2D(s2DCr, aVertex.vTexCoords).a - 0.5; + yuv.g = tex2D(s2DY, aVertex.vTexCoords).a - 0.0625; + yuv.b = tex2D(s2DCb, aVertex.vTexCoords).a - 0.5; color.r = yuv.g * 1.164 + yuv.r * 1.596; color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b; @@ -255,9 +255,9 @@ float4 YCbCrShaderMask(const VS_OUTPUT_MASK aVertex) : COLOR float4 yuv; float4 color; - yuv.r = tex2D(s2DCr, aVertex.vTexCoords).r - 0.5; - yuv.g = tex2D(s2DY, aVertex.vTexCoords).r - 0.0625; - yuv.b = tex2D(s2DCb, aVertex.vTexCoords).r - 0.5; + yuv.r = tex2D(s2DCr, aVertex.vTexCoords).a - 0.5; + yuv.g = tex2D(s2DY, aVertex.vTexCoords).a - 0.0625; + yuv.b = tex2D(s2DCb, aVertex.vTexCoords).a - 0.5; color.r = yuv.g * 1.164 + yuv.r * 1.596; color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b; diff --git a/gfx/layers/d3d9/TextureD3D9.cpp b/gfx/layers/d3d9/TextureD3D9.cpp index 793b17a4bb8c..0c616df26368 100644 --- a/gfx/layers/d3d9/TextureD3D9.cpp +++ b/gfx/layers/d3d9/TextureD3D9.cpp @@ -358,17 +358,17 @@ DeprecatedTextureHostYCbCrD3D9::UpdateImpl(const SurfaceDescriptor& aImage, yuvDeserializer.GetYData(), yuvDeserializer.GetYStride(), size, - D3DFMT_L8, 1); + D3DFMT_A8, 1); mTextures[1] = DataToTexture(mDevice, yuvDeserializer.GetCbData(), yuvDeserializer.GetCbCrStride(), gfxCbCrSize, - D3DFMT_L8, 1); + D3DFMT_A8, 1); mTextures[2] = DataToTexture(mDevice, yuvDeserializer.GetCrData(), yuvDeserializer.GetCbCrStride(), gfxCbCrSize, - D3DFMT_L8, 1); + D3DFMT_A8, 1); } // aTexture should be in SYSTEMMEM, returns a texture in the default