Chromium Code Reviews
DescriptionDon't restart the ImageQualityController timer unless it is already half over.
Restarting the timer every time an image continues to animate is very expensive,
because there is no way to actuually cancel the existing timer. Instead, the timer
is neutered, so that when it fires it will do nothing. This results in a flood
of no-op timer callbacks in the referenced bug scenario.
Instead, only restart the timer if the current frame time is more than half
of the timer time later than the frame time at the start of the timer.
To accomplish that, record the current frame time in WebViewImpl, so that it
can be compared with a future frame time.
We do this plumbing to avoid making lots of calls to query the system time,
which is expensive. The compositor has a similar optimization; see
https://code.google.com/p/chromium/codesearch#chromium/src/cc/layers/picture_layer_impl.cc&sq=package:chromium&l=452
for example.
BUG=605701
Committed: https://crrev.com/f79f4d6a1c52efbe06e30ace1ce882ac1d53aa40
Cr-Commit-Position: refs/heads/master@{#389394}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : #Patch Set 7 : #
Total comments: 5
Patch Set 8 : #Patch Set 9 : #Patch Set 10 : #Patch Set 11 : #Patch Set 12 : #Messages
Total messages: 37 (21 generated)
|