mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 1061699 - Only crash debug builds if BorrowDrawTarget is called on an unlocked TextureClient. r=Bas
This commit is contained in:
parent
426b1eaffa
commit
2d36152b7a
@ -688,6 +688,9 @@ BufferTextureClient::BorrowDrawTarget()
|
||||
{
|
||||
MOZ_ASSERT(IsValid());
|
||||
MOZ_ASSERT(mLocked, "BorrowDrawTarget should be called on locked textures only");
|
||||
if (!mLocked) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mDrawTarget) {
|
||||
mDrawTarget->SetTransform(Matrix());
|
||||
|
@ -310,7 +310,7 @@ TextureClientD3D11::BorrowDrawTarget()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked, "Calling TextureClient::BorrowDrawTarget without locking :(");
|
||||
|
||||
if (!mTexture && !mTexture10) {
|
||||
if (!mIsLocked || (!mTexture && !mTexture10)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -664,6 +664,11 @@ gfx::DrawTarget*
|
||||
CairoTextureClientD3D9::BorrowDrawTarget()
|
||||
{
|
||||
MOZ_ASSERT(mIsLocked && mD3D9Surface);
|
||||
if (!mIsLocked || !mD3D9Surface) {
|
||||
NS_WARNING("Calling BorrowDrawTarget on an Unlocked TextureClient");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mDrawTarget) {
|
||||
return mDrawTarget;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ GrallocTextureClientOGL::BorrowDrawTarget()
|
||||
MOZ_ASSERT(IsValid());
|
||||
MOZ_ASSERT(mMappedBuffer, "Calling TextureClient::BorrowDrawTarget without locking :(");
|
||||
|
||||
if (!IsValid() || !IsAllocated()) {
|
||||
if (!IsValid() || !IsAllocated() || !mMappedBuffer) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user