Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Issue 2000483003: Rework timeline/frame scheduling logic for SVGImage (Closed)

Created:
4 years, 7 months ago by fs
Modified:
4 years, 7 months ago
Reviewers:
chrishtr, pdr.
CC:
blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rework timeline/frame scheduling logic for SVGImage This CL provides the SVGImage/SVGImageChromeClient complex with the capability of suspending and resuming the frame/animation tick. This gives us the mechanism required to respond to ImageObserver::shouldPauseAnimation, as well as stopping the animation timer from running after the animation has been reset (via Image::resetAnimation.) In the context of the bug referenced this means an animating SVG image will no longer cause wakeups because of (unnecessary) timer activity, saving power (and CPU time.) Implement willRenderImage() for the CrossfadeSubimageObserverProxy of CSSCrossfadeValue so that it will not (falsely) claim that it won't render its images. While doing this, try to make a decent functional split between SVGImage and the associated SVGImageChromeClient by putting all timeline/frame tick related code in the latter, while keeping code related to the actual animation/document lifecycle update in the former. BUG=612540 Committed: https://crrev.com/5ad4faa93d2554ffab7f72a992adbeffa8796f94 Cr-Commit-Position: refs/heads/master@{#396009}

Patch Set 1 #

Patch Set 2 : Undo removal of SVGImageChromeClient::image() #

Patch Set 3 : Touch up some comments #

Patch Set 4 : More comment touchups #

Patch Set 5 : Make initial timeline state be 'running' #

Patch Set 6 : CSSCrossfadeValue needs to reply truthfully to willRenderImage. #

Total comments: 6

Patch Set 7 : Attempt to simplify #

Patch Set 8 : Add unittest #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+326 lines, -36 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCrossfadeValue.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp View 1 2 3 4 5 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.h View 1 2 3 4 5 6 7 5 chunks +10 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 5 6 7 6 chunks +46 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.h View 1 2 3 4 5 6 7 4 chunks +17 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp View 1 2 3 4 5 6 7 5 chunks +40 lines, -16 lines 0 comments Download
A third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp View 1 2 3 4 5 6 7 1 chunk +194 lines, -0 lines 3 comments Download

Messages

Total messages: 20 (5 generated)
fs
4 years, 7 months ago (2016-05-20 17:31:21 UTC) #4
chrishtr
This code needs testing. https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp (right): https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp#newcode86 third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp:86: if (m_animationTimer.isActive()) Why not just ...
4 years, 7 months ago (2016-05-20 18:26:15 UTC) #5
fs
On 2016/05/20 at 18:26:15, chrishtr wrote: > This code needs testing. Trying to concoct a ...
4 years, 7 months ago (2016-05-20 19:23:58 UTC) #6
chrishtr
https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp (right): https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp#newcode86 third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp:86: if (m_animationTimer.isActive()) On 2016/05/20 at 19:23:58, fs wrote: > ...
4 years, 7 months ago (2016-05-20 19:55:18 UTC) #7
fs
https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp (right): https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp#newcode86 third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp:86: if (m_animationTimer.isActive()) On 2016/05/20 at 19:55:18, chrishtr wrote: > ...
4 years, 7 months ago (2016-05-20 20:03:06 UTC) #8
chrishtr
Will wait for the unittest. https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp (right): https://codereview.chromium.org/2000483003/diff/100001/third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp#newcode86 third_party/WebKit/Source/core/svg/graphics/SVGImageChromeClient.cpp:86: if (m_animationTimer.isActive()) On 2016/05/20 ...
4 years, 7 months ago (2016-05-23 20:02:52 UTC) #9
fs
On 2016/05/23 at 20:02:52, chrishtr wrote: > Will wait for the unittest. Didn't have time ...
4 years, 7 months ago (2016-05-23 20:58:34 UTC) #10
fs
On 2016/05/23 at 20:58:34, fs wrote: > On 2016/05/23 at 20:02:52, chrishtr wrote: > > ...
4 years, 7 months ago (2016-05-25 16:01:32 UTC) #11
chrishtr
https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp (right): https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp#newcode160 third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp:160: EXPECT_FALSE(chromeClient.isSuspended()); Why doesn't it pause again?
4 years, 7 months ago (2016-05-25 20:23:47 UTC) #12
fs
https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp (right): https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp#newcode160 third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp:160: EXPECT_FALSE(chromeClient.isSuspended()); On 2016/05/25 at 20:23:47, chrishtr wrote: > Why ...
4 years, 7 months ago (2016-05-25 20:30:16 UTC) #13
chrishtr
https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp (right): https://codereview.chromium.org/2000483003/diff/140001/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp#newcode160 third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp:160: EXPECT_FALSE(chromeClient.isSuspended()); On 2016/05/25 at 20:30:16, fs wrote: > On ...
4 years, 7 months ago (2016-05-25 22:18:13 UTC) #14
chrishtr
lgtm
4 years, 7 months ago (2016-05-25 22:20:33 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2000483003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2000483003/140001
4 years, 7 months ago (2016-05-25 22:21:20 UTC) #17
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 7 months ago (2016-05-25 22:28:53 UTC) #18
commit-bot: I haz the power
4 years, 7 months ago (2016-05-25 22:31:10 UTC) #20
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/5ad4faa93d2554ffab7f72a992adbeffa8796f94
Cr-Commit-Position: refs/heads/master@{#396009}

Powered by Google App Engine
This is Rietveld 408576698