Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2016-01-21 16:50:24 +01:00
commit 41fa341197
2 changed files with 8 additions and 19 deletions

View File

@ -403,7 +403,7 @@ CompositorVsyncScheduler::PostCompositeTask(TimeStamp aCompositeTimestamp)
if (mCurrentCompositeTask == nullptr) {
mCurrentCompositeTask = NewRunnableMethod(this,
&CompositorVsyncScheduler::Composite,
aCompositeTimestamp, nullptr, nullptr);
aCompositeTimestamp);
ScheduleTask(mCurrentCompositeTask, 0);
}
}
@ -500,7 +500,7 @@ CompositorVsyncScheduler::CancelCurrentCompositeTask()
}
void
CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp, gfx::DrawTarget* aTarget, const IntRect* aRect)
CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
{
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
{
@ -508,20 +508,13 @@ CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp, gfx::DrawTarget*
mCurrentCompositeTask = nullptr;
}
if (aVsyncTimestamp < mLastCompose) {
// We can sometimes get vsync timestamps that are in the past
// compared to the last compose with force composites.
// In those cases, normalize to now.
aVsyncTimestamp = TimeStamp::Now();
}
DispatchTouchEvents(aVsyncTimestamp);
DispatchVREvents(aVsyncTimestamp);
if (mNeedsComposite || mAsapScheduling) {
mNeedsComposite = 0;
mLastCompose = aVsyncTimestamp;
ComposeToTarget(aTarget, aRect);
ComposeToTarget(nullptr);
mVsyncNotificationsSkipped = 0;
TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
@ -552,10 +545,9 @@ CompositorVsyncScheduler::OnForceComposeToTarget()
void
CompositorVsyncScheduler::ForceComposeToTarget(gfx::DrawTarget* aTarget, const IntRect* aRect)
{
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
OnForceComposeToTarget();
SetNeedsComposite();
Composite(TimeStamp::Now(), aTarget, aRect);
mLastCompose = TimeStamp::Now();
ComposeToTarget(aTarget, aRect);
}
bool
@ -640,9 +632,8 @@ CompositorVsyncScheduler::ScheduleTask(CancelableTask* aTask, int aTime)
void
CompositorVsyncScheduler::ResumeComposition()
{
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
SetNeedsComposite();
Composite(TimeStamp::Now());
mLastCompose = TimeStamp::Now();
ComposeToTarget(nullptr);
}
void

View File

@ -126,9 +126,7 @@ public:
void ScheduleComposition();
void CancelCurrentCompositeTask();
bool NeedsComposite();
void Composite(TimeStamp aVsyncTimestamp,
gfx::DrawTarget* aTarget = nullptr,
const gfx::IntRect* aRect = nullptr);
void Composite(TimeStamp aVsyncTimestamp);
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
const TimeStamp& GetLastComposeTime()