RESOLVED FIXED 193343
Animation and other code is too aggressive about invalidating layer composition
https://bugs.webkit.org/show_bug.cgi?id=193343
Summary Animation and other code is too aggressive about invalidating layer composition
Simon Fraser (smfr)
Reported 2019-01-10 18:55:27 PST
Animation and other code is too aggressive about invalidating layer composition
Attachments
Patch (8.22 KB, patch)
2019-01-10 18:55 PST, Simon Fraser (smfr)
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.75 MB, application/zip)
2019-01-10 19:57 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.35 MB, application/zip)
2019-01-10 20:07 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.88 MB, application/zip)
2019-01-10 20:40 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (2.25 MB, application/zip)
2019-01-10 20:44 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews205 for win-future (12.82 MB, application/zip)
2019-01-10 21:49 PST, EWS Watchlist
no flags
Patch (12.48 KB, patch)
2019-01-11 13:18 PST, Simon Fraser (smfr)
graouts: review+
Patch (13.54 KB, patch)
2019-01-11 18:51 PST, Simon Fraser (smfr)
no flags
Patch (15.92 KB, patch)
2019-01-11 18:56 PST, Simon Fraser (smfr)
graouts: review+
Testcase (1.17 KB, text/html)
2019-01-11 18:57 PST, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2019-01-10 18:55:48 PST
EWS Watchlist
Comment 2 2019-01-10 18:58:10 PST Comment hidden (obsolete)
EWS Watchlist
Comment 3 2019-01-10 19:57:44 PST Comment hidden (obsolete)
EWS Watchlist
Comment 4 2019-01-10 19:57:46 PST Comment hidden (obsolete)
EWS Watchlist
Comment 5 2019-01-10 20:07:47 PST Comment hidden (obsolete)
EWS Watchlist
Comment 6 2019-01-10 20:07:49 PST Comment hidden (obsolete)
Simon Fraser (smfr)
Comment 7 2019-01-10 20:13:48 PST
I guess we need some of these.
Simon Fraser (smfr)
Comment 8 2019-01-10 20:28:05 PST
> New failing tests: > legacy-animation-engine/compositing/visible-rect/animated-from-none.html > legacy-animation-engine/compositing/animation/animation-compositing.html > legacy-animation-engine/compositing/visible-rect/animated.html > legacy-animation-engine/compositing/layer-creation/translate-animation- > overlap.html > legacy-animation-engine/compositing/contents-scale/animating.html > legacy-animation-engine/compositing/backing/backing-store-attachment-empty- > keyframe.html > legacy-animation-engine/compositing/layer-creation/scale-rotation-animation- > overlap.html > legacy-animation-engine/compositing/layer-creation/overlap-animation.html > css3/filters/reference-filter-update-on-attribute-change.html > css3/filters/effect-reference-delete.html > legacy-animation-engine/compositing/layer-creation/overlap-animation- > container.html > legacy-animation-engine/compositing/layer-creation/overlap-animation- > clipping.html Most of these tests seem to dump layers in response to an animationStart event, and that timing changes with this patch. The tests look OK when run manually; I think we'll just create the layers later.
Simon Fraser (smfr)
Comment 9 2019-01-10 20:29:32 PST
EWS Watchlist
Comment 10 2019-01-10 20:40:00 PST Comment hidden (obsolete)
EWS Watchlist
Comment 11 2019-01-10 20:40:02 PST Comment hidden (obsolete)
EWS Watchlist
Comment 12 2019-01-10 20:44:51 PST Comment hidden (obsolete)
EWS Watchlist
Comment 13 2019-01-10 20:44:53 PST
Created attachment 358870 [details] Archive of layout-test-results from ews113 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 14 2019-01-10 21:49:39 PST Comment hidden (obsolete)
EWS Watchlist
Comment 15 2019-01-10 21:49:51 PST Comment hidden (obsolete)
Simon Fraser (smfr)
Comment 16 2019-01-11 11:01:29 PST
This patch breaks accelerated animations, because we don't do a compositing update after the animation starts (AnimationState New -> StartWaitTimer), so end up running the animation in software.
Simon Fraser (smfr)
Comment 17 2019-01-11 12:31:43 PST
We need to have already created the composing layer before: * frame #0: 0x0000000108bf98d4 WebCore`WebCore::KeyframeAnimation::startAnimation(this=0x0000000122dc95b0, timeOffset=0) at KeyframeAnimation.cpp:288 frame #1: 0x0000000108baa805 WebCore`WebCore::AnimationBase::updateStateMachine(this=0x0000000122dc95b0, input=StyleAvailable, param=-1) at AnimationBase.cpp:276 frame #2: 0x0000000108bb3378 WebCore`WebCore::AnimationBase::styleAvailable(this=0x0000000122dc95b0) at AnimationBase.h:207 frame #3: 0x0000000108bb1c6d WebCore`WebCore::CSSAnimationControllerPrivate::styleAvailable(this=0x0000000122d996e0) at CSSAnimationController.cpp:529 frame #4: 0x0000000108bb1b7c WebCore`WebCore::CSSAnimationControllerPrivate::endAnimationUpdate(this=0x0000000122d996e0) at CSSAnimationController.cpp:458 frame #5: 0x0000000108bc26f8 WebCore`WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock(this=0x00007ffeefbfcbf0) at CSSAnimationController.cpp:65 frame #6: 0x0000000108bafb35 WebCore`WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock(this=0x00007ffeefbfcbf0) at CSSAnimationController.cpp:64 frame #7: 0x0000000108badebd WebCore`WebCore::CSSAnimationControllerPrivate::animationTimerFired(this=0x0000000122d996e0) at CSSAnimationController.cpp:293
Simon Fraser (smfr)
Comment 18 2019-01-11 12:44:34 PST
This is a delicate dance about doing compositing updates at the right time. We have to do a compositing update when the animation is in StartWaitStyleAvailable, not before!
Simon Fraser (smfr)
Comment 19 2019-01-11 13:18:43 PST
EWS Watchlist
Comment 20 2019-01-11 13:21:41 PST
Attachment 358933 [details] did not pass style-queue: ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 21 2019-01-11 18:51:27 PST
Simon Fraser (smfr)
Comment 22 2019-01-11 18:56:16 PST
Simon Fraser (smfr)
Comment 23 2019-01-11 18:57:14 PST
This patch sequence tidies up the legacy animation code path so that only animation changes that start/stop accelerated animations trigger recompositeLayer. The Web Animations code path is fixed by the first patch.
Simon Fraser (smfr)
Comment 24 2019-01-11 18:57:30 PST
Created attachment 358973 [details] Testcase
Antti Koivisto
Comment 25 2019-01-12 00:20:16 PST
Comment on attachment 358933 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358933&action=review > Source/WebCore/animation/KeyframeEffect.cpp:63 > - element->invalidateStyleAndLayerComposition(); > + element->invalidateStyle(); Are there any clients left for invalidateStyleAndLayerComposition after this? Can we remove the whole concept?
Simon Fraser (smfr)
Comment 26 2019-01-12 10:53:32 PST
Yes, there are clients: things related to composited iframes, plugins etc.
Simon Fraser (smfr)
Comment 27 2019-01-14 22:08:01 PST
Comment on attachment 358970 [details] Patch I moved this patch to bug 193435.
Simon Fraser (smfr)
Comment 28 2019-01-15 08:44:20 PST
Comment on attachment 358972 [details] Patch I moved this patch to bug 193450.
Simon Fraser (smfr)
Comment 29 2019-01-15 17:58:50 PST
Main patch landed in r239965, other patches landed via other bugs.
Note You need to log in before you can comment on or make changes to this bug.