From e58d379984c2d07b92d889cfc305df331c00d842 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 11 Feb 2014 17:58:01 +1300 Subject: [PATCH] Bug 966679 - Follow-up to fix bustage on gcc 4.4, split Compose() into separate functions. CLOSED TREE --- gfx/layers/ipc/CompositorParent.cpp | 22 ++++++++++++++-------- gfx/layers/ipc/CompositorParent.h | 5 +++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 20eeb1f1ca6c..431d53fb511a 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -318,7 +318,7 @@ CompositorParent::RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot, // do better if AutoOpenSurface uses Moz2D directly. RefPtr target = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(opener.Get(), size); - ComposeToTarget(target); + ForceComposeToTarget(target); *aOutSnapshot = aInSnapshot; return true; } @@ -330,7 +330,7 @@ CompositorParent::RecvFlushRendering() // and do it immediately instead. if (mCurrentCompositeTask) { mCurrentCompositeTask->Cancel(); - ComposeToTarget(nullptr); + ForceComposeToTarget(nullptr); } return true; } @@ -433,7 +433,7 @@ CompositorParent::ResumeComposition() mPaused = false; - Composite(nullptr); + Composite(); // if anyone's waiting to make sure that composition really got resumed, tell them lock.NotifyAll(); @@ -565,7 +565,7 @@ CompositorParent::ScheduleComposition() mExpectedComposeTime = TimeStamp::Now() + minFrameDelta; #endif - mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::Composite, nullptr); + mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::Composite); if (!initialComposition && delta < minFrameDelta) { TimeDuration delay = minFrameDelta - delta; @@ -579,7 +579,13 @@ CompositorParent::ScheduleComposition() } void -CompositorParent::Composite(DrawTarget* aTarget) +CompositorParent::Composite() +{ + CompositeToTarget(nullptr); +} + +void +CompositorParent::CompositeToTarget(DrawTarget* aTarget) { profiler_tracing("Paint", "Composite", TRACING_INTERVAL_START); PROFILER_LABEL("CompositorParent", "Composite"); @@ -651,13 +657,13 @@ CompositorParent::Composite(DrawTarget* aTarget) } void -CompositorParent::ComposeToTarget(DrawTarget* aTarget) +CompositorParent::ForceComposeToTarget(DrawTarget* aTarget) { - PROFILER_LABEL("CompositorParent", "ComposeToTarget"); + PROFILER_LABEL("CompositorParent", "ForceComposeToTarget"); AutoRestore override(mOverrideComposeReadiness); mOverrideComposeReadiness = true; - Composite(aTarget); + CompositeToTarget(aTarget); } bool diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h index 6c45bb0b455f..259f522ad624 100644 --- a/gfx/layers/ipc/CompositorParent.h +++ b/gfx/layers/ipc/CompositorParent.h @@ -243,8 +243,9 @@ protected: bool* aSuccess) MOZ_OVERRIDE; virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE; virtual void ScheduleTask(CancelableTask*, int); - void Composite(gfx::DrawTarget* aTarget); - virtual void ComposeToTarget(gfx::DrawTarget* aTarget); + void Composite(); + void CompositeToTarget(gfx::DrawTarget* aTarget); + void ForceComposeToTarget(gfx::DrawTarget* aTarget); void SetEGLSurfaceSize(int width, int height);