Bug 1293772 - Check that the TextureClient is not internally shut down in Lock, Unlock and BorrowDrawTarget. r=jnicol

This commit is contained in:
Nicolas Silva 2016-08-10 14:30:42 +02:00
parent 974151839a
commit 34d30ff986

View File

@ -444,6 +444,9 @@ TextureClient::Lock(OpenMode aMode)
{
MOZ_ASSERT(IsValid());
MOZ_ASSERT(!mIsLocked);
if (!IsValid()) {
return false;
}
if (mIsLocked) {
return mOpenMode == aMode;
}
@ -493,7 +496,7 @@ TextureClient::Unlock()
{
MOZ_ASSERT(IsValid());
MOZ_ASSERT(mIsLocked);
if (!mIsLocked) {
if (!IsValid() || !mIsLocked) {
return;
}
@ -622,7 +625,7 @@ TextureClient::BorrowDrawTarget()
// but we should have a way to get a SourceSurface directly instead.
//MOZ_ASSERT(mOpenMode & OpenMode::OPEN_WRITE);
if (!mIsLocked) {
if (!IsValid() || !mIsLocked) {
return nullptr;
}