зеркало из https://github.com/mozilla/gecko-dev.git
bug 1268638 - Cleanup better in failure cases. - r=jrmuizel
MozReview-Commit-ID: 661wHH47xr6
This commit is contained in:
Родитель
a16d416c5a
Коммит
720e4fde9b
|
@ -475,8 +475,10 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size)
|
|||
{
|
||||
ScopedBindFramebuffer autoFB(mGL);
|
||||
|
||||
if (mRead && SharedSurf())
|
||||
const bool readNeedsUnlock = (mRead && SharedSurf());
|
||||
if (readNeedsUnlock) {
|
||||
SharedSurf()->UnlockProd();
|
||||
}
|
||||
|
||||
surf->LockProd();
|
||||
|
||||
|
@ -507,7 +509,9 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size)
|
|||
|
||||
if (!drawOk || !readOk) {
|
||||
surf->UnlockProd();
|
||||
|
||||
if (readNeedsUnlock) {
|
||||
SharedSurf()->LockProd();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -550,8 +554,10 @@ GLScreenBuffer::Swap(const gfx::IntSize& size)
|
|||
// attachment to framebuffer succeeds in Attach() call.
|
||||
newBack->Surf()->ProducerAcquire();
|
||||
|
||||
if (!Attach(newBack->Surf(), size))
|
||||
if (!Attach(newBack->Surf(), size)) {
|
||||
newBack->Surf()->ProducerRelease();
|
||||
return false;
|
||||
}
|
||||
// Attach was successful.
|
||||
|
||||
mFront = mBack;
|
||||
|
|
Загрузка…
Ссылка в новой задаче