Loading libs/nativedisplay/AChoreographer.cpp +12 −3 Original line number Original line Diff line number Diff line Loading @@ -185,9 +185,18 @@ void Choreographer::unregisterRefreshRateCallback(AChoreographer_refreshRateCall } } void Choreographer::scheduleCallbacks() { void Choreographer::scheduleCallbacks() { const nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); nsecs_t dueTime; { AutoMutex _{mLock}; AutoMutex _{mLock}; nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); // If there are no pending callbacks then don't schedule a vsync if (mFrameCallbacks.top().dueTime <= now) { if (mFrameCallbacks.empty()) { return; } dueTime = mFrameCallbacks.top().dueTime; } if (dueTime <= now) { ALOGV("choreographer %p ~ scheduling vsync", this); ALOGV("choreographer %p ~ scheduling vsync", this); scheduleVsync(); scheduleVsync(); return; return; Loading Loading
libs/nativedisplay/AChoreographer.cpp +12 −3 Original line number Original line Diff line number Diff line Loading @@ -185,9 +185,18 @@ void Choreographer::unregisterRefreshRateCallback(AChoreographer_refreshRateCall } } void Choreographer::scheduleCallbacks() { void Choreographer::scheduleCallbacks() { const nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); nsecs_t dueTime; { AutoMutex _{mLock}; AutoMutex _{mLock}; nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); // If there are no pending callbacks then don't schedule a vsync if (mFrameCallbacks.top().dueTime <= now) { if (mFrameCallbacks.empty()) { return; } dueTime = mFrameCallbacks.top().dueTime; } if (dueTime <= now) { ALOGV("choreographer %p ~ scheduling vsync", this); ALOGV("choreographer %p ~ scheduling vsync", this); scheduleVsync(); scheduleVsync(); return; return; Loading