diff --git a/gfx/layers/d3d10/CanvasLayerD3D10.cpp b/gfx/layers/d3d10/CanvasLayerD3D10.cpp index b484df4389ca..d580889fc070 100644 --- a/gfx/layers/d3d10/CanvasLayerD3D10.cpp +++ b/gfx/layers/d3d10/CanvasLayerD3D10.cpp @@ -93,6 +93,8 @@ CanvasLayerD3D10::Initialize(const Data& aData) // XXX for ANGLE, it's already the right-way up. If we start using NV GL-D3D interop // however, we'll need to do the right thing. mNeedsYFlip = PR_FALSE; + mHasAlpha = + mSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA; } } @@ -239,7 +241,7 @@ CanvasLayerD3D10::RenderLayer() ID3D10EffectTechnique *technique; if (mDataIsPremultiplied) { - if (mSurface && mSurface->GetContentType() == gfxASurface::CONTENT_COLOR) { + if (!mHasAlpha) { if (mFilter == gfxPattern::FILTER_NEAREST) { technique = effect()->GetTechniqueByName("RenderRGBLayerPremulPoint"); } else { diff --git a/gfx/layers/d3d10/CanvasLayerD3D10.h b/gfx/layers/d3d10/CanvasLayerD3D10.h index 426119a72e88..6df080a4a25f 100644 --- a/gfx/layers/d3d10/CanvasLayerD3D10.h +++ b/gfx/layers/d3d10/CanvasLayerD3D10.h @@ -51,10 +51,11 @@ class THEBES_API CanvasLayerD3D10 : public CanvasLayer, { public: CanvasLayerD3D10(LayerManagerD3D10 *aManager) - : CanvasLayer(aManager, NULL), - LayerD3D10(aManager), - mDataIsPremultiplied(PR_FALSE), - mNeedsYFlip(PR_FALSE) + : CanvasLayer(aManager, NULL) + , LayerD3D10(aManager) + , mDataIsPremultiplied(PR_FALSE) + , mNeedsYFlip(PR_FALSE) + , mHasAlpha(PR_TRUE) { mImplData = static_cast(this); } @@ -83,6 +84,7 @@ private: PRPackedBool mNeedsYFlip; PRPackedBool mIsD2DTexture; PRPackedBool mUsingSharedTexture; + PRPackedBool mHasAlpha; }; } /* layers */