Don't assert about borrowed DT refcounts when async painting. (bug 1381393, r=mattwoodrow)

This commit is contained in:
David Anderson
2017-07-25 22:38:33 -07:00
parent c73e753c92
commit 41bfb10f56
5 changed files with 52 additions and 9 deletions

View File

@@ -509,7 +509,7 @@ TextureClient::Lock(OpenMode aMode)
auto format = GetFormat();
if (mIsLocked && CanExposeDrawTarget() &&
aMode == OpenMode::OPEN_READ_WRITE &&
(aMode & OpenMode::OPEN_READ_WRITE) == OpenMode::OPEN_READ_WRITE &&
NS_IsMainThread() &&
// the formats that we apparently expect, in the cairo backend. Any other
// format will trigger an assertion in GfxFormatToCairoFormat.
@@ -557,7 +557,8 @@ TextureClient::Unlock()
mBorrowedDrawTarget->DetachAllSnapshots();
// If this assertion is hit, it means something is holding a strong reference
// to our DrawTarget externally, which is not allowed.
MOZ_ASSERT(mBorrowedDrawTarget->refCount() <= mExpectedDtRefs);
MOZ_ASSERT_IF(!(mOpenMode & OpenMode::OPEN_ASYNC_WRITE),
mBorrowedDrawTarget->refCount() <= mExpectedDtRefs);
mBorrowedDrawTarget = nullptr;
}