mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-29 11:57:55 +00:00
Bug 993360 - Don't try to lock a texture if it failed to allocate. r=mattwoodrow
This commit is contained in:
parent
be16634444
commit
aa8364e918
@ -173,6 +173,9 @@ TextureClientD3D11::~TextureClientD3D11()
|
||||
bool
|
||||
TextureClientD3D11::Lock(OpenMode aMode)
|
||||
{
|
||||
if (!mTexture) {
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(!mIsLocked, "The Texture is already locked!");
|
||||
LockD3DTexture(mTexture.get());
|
||||
mIsLocked = true;
|
||||
@ -190,6 +193,7 @@ void
|
||||
TextureClientD3D11::Unlock()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked, "Unlocked called while the texture is not locked!");
|
||||
|
||||
if (mDrawTarget) {
|
||||
// see the comment on TextureClientDrawTarget::GetAsDrawTarget.
|
||||
// This DrawTarget is internal to the TextureClient and is only exposed to the
|
||||
@ -210,6 +214,10 @@ TextureClientD3D11::GetAsDrawTarget()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked, "Calling TextureClient::GetAsDrawTarget without locking :(");
|
||||
|
||||
if (!mTexture) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mDrawTarget) {
|
||||
return mDrawTarget;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user