Bug 1284721 - Flush CanvasRenderingContext2D's DrawTarget before handing it off to the BufferProvider. r=lsalzman

This commit is contained in:
Nicolas Silva 2016-07-08 19:26:48 +02:00
parent ff42b1930a
commit b51ed22a3f
2 changed files with 9 additions and 5 deletions

View File

@ -904,9 +904,6 @@ public:
if (!context || !context->mTarget)
return;
// Since SkiaGL default to store drawing command until flush
// We will have to flush it before present.
context->mTarget->Flush();
context->ReturnTarget();
}

View File

@ -40,6 +40,11 @@ PersistentBufferProviderBasic::ReturnDrawTarget(already_AddRefed<gfx::DrawTarget
{
RefPtr<gfx::DrawTarget> dt(aDT);
MOZ_ASSERT(mDrawTarget == dt);
if (dt) {
// Since SkiaGL default to storing drawing command until flush
// we have to flush it before present.
dt->Flush();
}
return true;
}
@ -205,10 +210,12 @@ PersistentBufferProviderShared::ReturnDrawTarget(already_AddRefed<gfx::DrawTarge
mBack->Unlock();
if (!mBuffer && mFront && !mFront->IsLocked()) {
mBuffer.swap(mFront);
if (mFront != mBack && !mBuffers.Contains(mFront)) {
mBuffers.AppendElement(mFront);
}
// Make mFront point to the now realized back buffer. mFront is what the next
// transaction will pick up and send to the compositor.
mFront = mBack;
return true;