Bug 967505 - Fix a crash with the D2D debug layer. r=Bas

This commit is contained in:
Nicolas Silva 2014-02-10 11:21:11 +01:00
Родитель 29cb706c84
Коммит 9e9d5be4ae
1 изменённых файлов: 15 добавлений и 1 удалений

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

@ -150,7 +150,21 @@ TextureClientD3D11::TextureClientD3D11(gfx::SurfaceFormat aFormat, TextureFlags
{}
TextureClientD3D11::~TextureClientD3D11()
{}
{
#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);
MOZ_ASSERT(mDrawTarget->refcount() == 1);
LockD3DTexture(mTexture.get());
mDrawTarget = nullptr;
UnlockD3DTexture(mTexture.get());
}
#endif
}
bool
TextureClientD3D11::Lock(OpenMode aMode)