TextureClientD3D11::~TextureClientD3D11() { if (mActor) { if (mTexture) { KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D10Texture2D>>(mTexture10)); } else if (mTexture10) { KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D11Texture2D>>(mTexture)); } } #ifdef DEBUG // An Azure DrawTarget needs to be locked when it gets nullptr'ed as this is // when it calls EndDraw. This EndDraw should not execute anything so it // shouldn't -really- need the lock but the debug layer chokes on this. if (mDrawTarget) { MOZ_ASSERT(!mIsLocked); MOZ_ASSERT(mTexture || mTexture10); MOZ_ASSERT(mDrawTarget->refCount() == 1); if (mTexture) { LockD3DTexture(mTexture.get()); } else { LockD3DTexture(mTexture10.get()); } mDrawTarget = nullptr; if (mTexture) { UnlockD3DTexture(mTexture.get()); } else { UnlockD3DTexture(mTexture10.get()); } } #endif }
void TextureClientD3D11::FinalizeOnIPDLThread() { if (mActor) { if (mTexture) { KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D11Texture2D>>(mTexture)); } else if (mTexture10) { KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D10Texture2D>>(mTexture10)); } } }