зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1435022 - Make the Composite function private and document/clean it. r=sotaro
MozReview-Commit-ID: 3UQKwwC3Fav --HG-- extra : rebase_source : 19737ed1c2ab40d7656257adbac10626ace1d9e7
This commit is contained in:
Родитель
00c2abf4c9
Коммит
7a2ef4343b
|
@ -211,32 +211,39 @@ void
|
|||
CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
|
||||
{
|
||||
MOZ_ASSERT(mVsyncSchedulerOwner);
|
||||
|
||||
{ // scope lock
|
||||
MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
|
||||
mCurrentCompositeTask = nullptr;
|
||||
}
|
||||
|
||||
if ((aVsyncTimestamp < mLastCompose) && !mAsapScheduling) {
|
||||
if (!mAsapScheduling) {
|
||||
// Some early exit conditions if we're not in ASAP mode
|
||||
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, wait until the next vsync;
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mVsyncSchedulerOwner);
|
||||
if (!mAsapScheduling && mVsyncSchedulerOwner->IsPendingComposite()) {
|
||||
// If previous composite is still on going, finish it and does a next
|
||||
// composite in a next vsync.
|
||||
if (mVsyncSchedulerOwner->IsPendingComposite()) {
|
||||
// If previous composite is still on going, finish it and wait for the
|
||||
// next vsync.
|
||||
mVsyncSchedulerOwner->FinishPendingComposite();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DispatchTouchEvents(aVsyncTimestamp);
|
||||
|
||||
if (mNeedsComposite || mAsapScheduling) {
|
||||
mNeedsComposite = 0;
|
||||
mLastCompose = aVsyncTimestamp;
|
||||
|
||||
// Tell the owner to do a composite
|
||||
mVsyncSchedulerOwner->CompositeToTarget(nullptr, nullptr);
|
||||
|
||||
mVsyncNotificationsSkipped = 0;
|
||||
|
||||
TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
|
||||
|
|
|
@ -58,7 +58,6 @@ public:
|
|||
void ScheduleComposition();
|
||||
void CancelCurrentCompositeTask();
|
||||
bool NeedsComposite();
|
||||
void Composite(TimeStamp aVsyncTimestamp);
|
||||
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
|
||||
|
||||
const TimeStamp& GetLastComposeTime()
|
||||
|
@ -87,6 +86,10 @@ private:
|
|||
// such a task already queued. Can be called from any thread.
|
||||
void PostVRTask(TimeStamp aTimestamp);
|
||||
|
||||
// This gets run at vsync time and "does" a composite (which really means
|
||||
// update internal state and call the owner to do the composite).
|
||||
void Composite(TimeStamp aVsyncTimestamp);
|
||||
|
||||
void NotifyCompositeTaskExecuted();
|
||||
void ObserveVsync();
|
||||
void UnobserveVsync();
|
||||
|
|
Загрузка…
Ссылка в новой задаче