mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1284721 - Flush CanvasRenderingContext2D's DrawTarget before handing it off to the BufferProvider. r=lsalzman
This commit is contained in:
parent
ff42b1930a
commit
b51ed22a3f
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user