Bug 628173 - Part 2: Update CanvasLayerD3D10 to match D3D9 style. r=jrmuizel a=blocking-final

This commit is contained in:
Bas Schouten 2011-02-10 21:03:51 +01:00
Родитель a50d7fec39
Коммит 1c14e4c680
2 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<LayerD3D10*>(this);
}
@ -83,6 +84,7 @@ private:
PRPackedBool mNeedsYFlip;
PRPackedBool mIsD2DTexture;
PRPackedBool mUsingSharedTexture;
PRPackedBool mHasAlpha;
};
} /* layers */