mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Don't flush async paints on the main thread. (bug 1386517, r=mattwoodrow)
This commit is contained in:
parent
46b81d1b6e
commit
6fc9eaab4a
@ -543,22 +543,23 @@ TextureClient::Unlock()
|
||||
}
|
||||
|
||||
if (mBorrowedDrawTarget) {
|
||||
if (mOpenMode & OpenMode::OPEN_WRITE) {
|
||||
mBorrowedDrawTarget->Flush();
|
||||
if (mReadbackSink && !mData->ReadBack(mReadbackSink)) {
|
||||
// Fallback implementation for reading back, because mData does not
|
||||
// have a backend-specific implementation and returned false.
|
||||
RefPtr<SourceSurface> snapshot = mBorrowedDrawTarget->Snapshot();
|
||||
RefPtr<DataSourceSurface> dataSurf = snapshot->GetDataSurface();
|
||||
mReadbackSink->ProcessReadback(dataSurf);
|
||||
if (!(mOpenMode & OpenMode::OPEN_ASYNC_WRITE)) {
|
||||
if (mOpenMode & OpenMode::OPEN_WRITE) {
|
||||
mBorrowedDrawTarget->Flush();
|
||||
if (mReadbackSink && !mData->ReadBack(mReadbackSink)) {
|
||||
// Fallback implementation for reading back, because mData does not
|
||||
// have a backend-specific implementation and returned false.
|
||||
RefPtr<SourceSurface> snapshot = mBorrowedDrawTarget->Snapshot();
|
||||
RefPtr<DataSourceSurface> dataSurf = snapshot->GetDataSurface();
|
||||
mReadbackSink->ProcessReadback(dataSurf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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_IF(!(mOpenMode & OpenMode::OPEN_ASYNC_WRITE),
|
||||
mBorrowedDrawTarget->refCount() <= mExpectedDtRefs);
|
||||
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);
|
||||
}
|
||||
|
||||
mBorrowedDrawTarget = nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user