Changeset 215153 in webkit
- Timestamp:
- Apr 8, 2017, 4:55:30 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215152 r215153 1 2017-04-08 Simon Fraser <simon.fraser@apple.com> 2 3 Align the timers for throttled rAF to reduce power usage 4 https://bugs.webkit.org/show_bug.cgi?id=170630 5 rdar://problem/31490620 6 7 Reviewed by Chris Dumez. 8 9 Align the timers for all throttled ScriptedAnimationControllers in the process with 10 a resolution of 30ms, which reduces process wake-ups and thus saves power. 11 12 * dom/ScriptedAnimationController.cpp: 13 (WebCore::ScriptedAnimationController::scheduleAnimation): 14 1 15 2017-04-08 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/dom/ScriptedAnimationController.cpp
r215070 r215153 304 304 305 305 Seconds animationInterval = interval(); 306 double scheduleDelay = std::max<double>(animationInterval.value() - (m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0); 307 m_animationTimer.startOneShot(scheduleDelay); 306 307 // FIXME: not ideal to snapshot time both in now() and nowTimestamp(), the latter of which also has reduced resolution. 308 MonotonicTime now = MonotonicTime::now(); 309 310 MonotonicTime fireTime = now + std::max(animationInterval - Seconds(m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0_s); 311 Seconds alignmentInterval = 30_ms; 312 // Snap to the nearest alignmentInterval. 313 Seconds alignment = (fireTime + alignmentInterval / 2) % alignmentInterval; 314 MonotonicTime alignedFireTime = fireTime - alignment; 315 316 m_animationTimer.startOneShot(alignedFireTime - now); 317 308 318 dispatchLoggingEventIfRequired("raf-schedule-animation-timer"); 309 319 #else
Note:
See TracChangeset
for help on using the changeset viewer.