Bug 170630 - Align the timers for throttled rAF to reduce power usage
Summary: Align the timers for throttled rAF to reduce power usage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-07 17:24 PDT by Simon Fraser (smfr)
Modified: 2017-04-11 01:26 PDT (History)
11 users (show)

See Also:


Attachments
Patch (2.32 KB, patch)
2017-04-07 17:26 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2017-04-07 17:24:24 PDT
Align the timers for throttled rAF to reduce power usage
Comment 1 Simon Fraser (smfr) 2017-04-07 17:26:19 PDT
Created attachment 306553 [details]
Patch
Comment 2 Chris Dumez 2017-04-08 16:04:43 PDT
Comment on attachment 306553 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306553&action=review

r=me

> Source/WebCore/dom/ScriptedAnimationController.cpp:313
> +    Seconds alignment = (fireTime + alignmentInterval / 2).secondsSinceEpoch() % alignmentInterval;

MonotonicTime has % operator, so I don't think we need .secondsSinceEpoch(), do we?
Comment 3 Jon Lee 2017-04-10 00:09:01 PDT
rdar://problem/31490620
Comment 4 Carlos Garcia Campos 2017-04-11 01:11:28 PDT
This landed in r215153, but I guess you forgot to close the bug. This broke RAF animations in GTK+ port, there must be something wrong in the aligned fire time calculation, because we are getting negative delays.
Comment 5 Carlos Garcia Campos 2017-04-11 01:21:04 PDT
Ah, wait, I think the problem is that in mac port, the timer is only used when throttling. Anyway, I'll close this bug and open a new one.
Comment 6 Carlos Garcia Campos 2017-04-11 01:22:07 PDT
Comment on attachment 306553 [details]
Patch

Committed r215153: <http://trac.webkit.org/changeset/215153>