void VsyncSource::Display::NotifyRefreshTimerVsyncStatus(bool aEnable) { MOZ_ASSERT(NS_IsMainThread()); mRefreshTimerNeedsVsync = aEnable; UpdateVsyncStatus(); }
void RefreshTimerVsyncDispatcher::RemoveChildRefreshTimer(VsyncObserver* aVsyncObserver) { { // scope lock - called on pbackground thread MutexAutoLock lock(mRefreshTimersLock); MOZ_ASSERT(aVsyncObserver); mChildRefreshTimers.RemoveElement(aVsyncObserver); } UpdateVsyncStatus(); }
void RefreshTimerVsyncDispatcher::SetParentRefreshTimer(VsyncObserver* aVsyncObserver) { MOZ_ASSERT(NS_IsMainThread()); { // lock scope because UpdateVsyncStatus runs on main thread and will deadlock MutexAutoLock lock(mRefreshTimersLock); mParentRefreshTimer = aVsyncObserver; } UpdateVsyncStatus(); }
void RefreshTimerVsyncDispatcher::AddChildRefreshTimer(VsyncObserver* aVsyncObserver) { { // scope lock - called on pbackground thread MutexAutoLock lock(mRefreshTimersLock); MOZ_ASSERT(aVsyncObserver); if (!mChildRefreshTimers.Contains(aVsyncObserver)) { mChildRefreshTimers.AppendElement(aVsyncObserver); } } UpdateVsyncStatus(); }
void VsyncSource::Display::RemoveCompositorVsyncDispatcher(CompositorVsyncDispatcher* aCompositorVsyncDispatcher) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aCompositorVsyncDispatcher); { // Scope lock MutexAutoLock lock(mDispatcherLock); if (mCompositorVsyncDispatchers.Contains(aCompositorVsyncDispatcher)) { mCompositorVsyncDispatchers.RemoveElement(aCompositorVsyncDispatcher); } } UpdateVsyncStatus(); }