mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1176024 - Have TextureClient::Lock check that it can expose a DrawTarget when it makes sense. r=Bas
This commit is contained in:
parent
408dc1372e
commit
18c1b93404
@ -363,6 +363,15 @@ TextureClient::Lock(OpenMode aMode)
|
||||
mIsLocked = mData->Lock(aMode, mReleaseFenceHandle.IsValid() ? &mReleaseFenceHandle : nullptr);
|
||||
mOpenMode = aMode;
|
||||
|
||||
if (mIsLocked && CanExposeDrawTarget() && (aMode & OpenMode::OPEN_WRITE) && NS_IsMainThread()) {
|
||||
if (!BorrowDrawTarget()) {
|
||||
// Failed to get a DrawTarget, means we won't be able to write into the
|
||||
// texture, might as well fail now.
|
||||
Unlock();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return mIsLocked;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user