mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +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
|
bool
|
||||||
TextureClientD3D11::Lock(OpenMode aMode)
|
TextureClientD3D11::Lock(OpenMode aMode)
|
||||||
{
|
{
|
||||||
|
if (!mTexture) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
MOZ_ASSERT(!mIsLocked, "The Texture is already locked!");
|
MOZ_ASSERT(!mIsLocked, "The Texture is already locked!");
|
||||||
LockD3DTexture(mTexture.get());
|
LockD3DTexture(mTexture.get());
|
||||||
mIsLocked = true;
|
mIsLocked = true;
|
||||||
@ -190,6 +193,7 @@ void
|
|||||||
TextureClientD3D11::Unlock()
|
TextureClientD3D11::Unlock()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mIsLocked, "Unlocked called while the texture is not locked!");
|
MOZ_ASSERT(mIsLocked, "Unlocked called while the texture is not locked!");
|
||||||
|
|
||||||
if (mDrawTarget) {
|
if (mDrawTarget) {
|
||||||
// see the comment on TextureClientDrawTarget::GetAsDrawTarget.
|
// see the comment on TextureClientDrawTarget::GetAsDrawTarget.
|
||||||
// This DrawTarget is internal to the TextureClient and is only exposed to the
|
// 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 :(");
|
MOZ_ASSERT(mIsLocked, "Calling TextureClient::GetAsDrawTarget without locking :(");
|
||||||
|
|
||||||
|
if (!mTexture) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (mDrawTarget) {
|
if (mDrawTarget) {
|
||||||
return mDrawTarget;
|
return mDrawTarget;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user