Bug 966679 - Make sure all RefLayers are resolved before calling BeginTransaction. r=nical

This commit is contained in:
Matt Woodrow 2014-02-11 17:00:16 +13:00
parent bf435a520d
commit ce3484f7e9
2 changed files with 12 additions and 21 deletions

View File

@ -433,7 +433,7 @@ CompositorParent::ResumeComposition()
mPaused = false;
Composite();
Composite(nullptr);
// 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);
mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::Composite, nullptr);
if (!initialComposition && delta < minFrameDelta) {
TimeDuration delay = minFrameDelta - delta;
@ -579,16 +579,7 @@ CompositorParent::ScheduleComposition()
}
void
CompositorParent::Composite()
{
if (CanComposite()) {
mLayerManager->BeginTransaction();
}
CompositeInTransaction();
}
void
CompositorParent::CompositeInTransaction()
CompositorParent::Composite(DrawTarget* aTarget)
{
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_START);
PROFILER_LABEL("CompositorParent", "Composite");
@ -603,6 +594,13 @@ CompositorParent::CompositeInTransaction()
}
AutoResolveRefLayers resolve(mCompositionManager);
if (aTarget) {
mLayerManager->BeginTransactionWithDrawTarget(aTarget);
} else {
mLayerManager->BeginTransaction();
}
if (mForceCompositionTask && !mOverrideComposeReadiness) {
if (mCompositionManager->ReadyForCompose()) {
mForceCompositionTask->Cancel();
@ -659,13 +657,7 @@ CompositorParent::ComposeToTarget(DrawTarget* aTarget)
AutoRestore<bool> override(mOverrideComposeReadiness);
mOverrideComposeReadiness = true;
if (!CanComposite()) {
return;
}
mLayerManager->BeginTransactionWithDrawTarget(aTarget);
// Since CanComposite() is true, Composite() must end the layers txn
// we opened above.
CompositeInTransaction();
Composite(aTarget);
}
bool

View File

@ -242,8 +242,7 @@ protected:
bool* aSuccess) MOZ_OVERRIDE;
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
virtual void ScheduleTask(CancelableTask*, int);
void Composite();
void CompositeInTransaction();
void Composite(gfx::DrawTarget* aTarget);
virtual void ComposeToTarget(gfx::DrawTarget* aTarget);
void SetEGLSurfaceSize(int width, int height);