/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
int32_t InputTaskManager::GetPriorityModifierForEventLoopTurn( const MutexAutoLock& aProofOfLock) { // When the state is disabled, the input task that we have is // very likely SuspendInputEventQueue, so here we also use // normal priority as ResumeInputEventQueue, FlushInputEventQueue and // SetInputEventQueueEnabled all uses normal priority, to // ensure the ordering is correct. if (State() == InputTaskManager::STATE_DISABLED) { returnstatic_cast<int32_t>(EventQueuePriority::Normal) - static_cast<int32_t>(EventQueuePriority::InputHigh);
}
void InputTaskManager::InputPriorityController::WillRunTask() { switch (mInputVsyncState) { case InputVsyncState::NoPendingVsync: return; case InputVsyncState::HasPendingVsync:
MOZ_ASSERT(mMaxInputTasksToRun > 0);
--mMaxInputTasksToRun; if (!mMaxInputTasksToRun ||
TimeStamp::Now() - mRunInputStartTime >=
TimeDuration::FromMilliseconds(
StaticPrefs::dom_input_event_queue_duration_max())) {
LeavePendingVsyncState(true);
} return; default:
MOZ_DIAGNOSTIC_ASSERT( false, "Shouldn't run this input task when we suppose to run vsync"); return;
}
}
// static void InputTaskManager::Init() { gInputTaskManager = new InputTaskManager(); }
} // namespace mozilla
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.