mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix stale intermediate surfaces in the D3D9 compositor. (bug 1244821, r=mattwoodrow)
This commit is contained in:
parent
a945fa6da2
commit
0d7177e531
@ -113,7 +113,6 @@ CompositingRenderTargetD3D9::CompositingRenderTargetD3D9(IDirect3DTexture9* aTex
|
||||
const gfx::IntRect& aRect)
|
||||
: CompositingRenderTarget(aRect.TopLeft())
|
||||
, mInitMode(aInit)
|
||||
, mInitialized(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositingRenderTargetD3D9);
|
||||
MOZ_ASSERT(aTexture);
|
||||
@ -122,6 +121,10 @@ CompositingRenderTargetD3D9::CompositingRenderTargetD3D9(IDirect3DTexture9* aTex
|
||||
mTexture->GetSurfaceLevel(0, getter_AddRefs(mSurface));
|
||||
NS_ASSERTION(mSurface, "Couldn't create surface for texture");
|
||||
TextureSourceD3D9::SetSize(aRect.Size());
|
||||
|
||||
if (aInit == INIT_MODE_CLEAR) {
|
||||
ClearOnBind();
|
||||
}
|
||||
}
|
||||
|
||||
CompositingRenderTargetD3D9::CompositingRenderTargetD3D9(IDirect3DSurface9* aSurface,
|
||||
@ -130,11 +133,14 @@ CompositingRenderTargetD3D9::CompositingRenderTargetD3D9(IDirect3DSurface9* aSur
|
||||
: CompositingRenderTarget(aRect.TopLeft())
|
||||
, mSurface(aSurface)
|
||||
, mInitMode(aInit)
|
||||
, mInitialized(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositingRenderTargetD3D9);
|
||||
MOZ_ASSERT(mSurface);
|
||||
TextureSourceD3D9::SetSize(aRect.Size());
|
||||
|
||||
if (aInit == INIT_MODE_CLEAR) {
|
||||
ClearOnBind();
|
||||
}
|
||||
}
|
||||
|
||||
CompositingRenderTargetD3D9::~CompositingRenderTargetD3D9()
|
||||
@ -146,10 +152,9 @@ void
|
||||
CompositingRenderTargetD3D9::BindRenderTarget(IDirect3DDevice9* aDevice)
|
||||
{
|
||||
aDevice->SetRenderTarget(0, mSurface);
|
||||
if (!mInitialized &&
|
||||
mInitMode == INIT_MODE_CLEAR) {
|
||||
mInitialized = true;
|
||||
if (mClearOnBind) {
|
||||
aDevice->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_RGBA(0, 0, 0, 0), 0, 0);
|
||||
mClearOnBind = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,6 @@ private:
|
||||
|
||||
RefPtr<IDirect3DSurface9> mSurface;
|
||||
SurfaceInitMode mInitMode;
|
||||
bool mInitialized;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user