Composite opacity transforms if element is otherwise composited anyways. |
||
Issue descriptionIn issue 754471 we are experimenting with disabling compositing of 2d transform and opacity animations but we should continue to composite opacity transforms if we already have a compositing layer (e.g. due to will-change: transform or a 3d transform).
,
Mar 23 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4e2700ead18fc989d70978adfacef881b44e8675 commit 4e2700ead18fc989d70978adfacef881b44e8675 Author: Xida Chen <xidachen@chromium.org> Date: Fri Mar 23 23:08:21 2018 Fix a mistake in computing main thread compositable animations At this moment, this is how we check whether an animation is main thread compositable or not: 1. The runtime feature TurnOff2DAndOpacityCompositorAnimationsEnabled is on 2. There is either an opacity or 2d transform animation There is a problem with this logic. When there is an opacity animation on an element and the element has "will-change: transform", we will put this animation as main thread compositable. This is not true, we should categorize it as composited animation because "will-change: transform" will create a layer anyways. This CL fixes this problem. We care about the most common cases: "will-change: transform" and 3D transform. So step 2 in the above becomes: when there is no "will-change: transform" and there is no 3D transform, and there is either opacity or 2D transform, then this is a main thread compositable animation. This CL also added a test to verify that an element with "will-change: transform" + opacity animation will end up having a composited animation even when the runtime feature is on. Bug: 818809 Change-Id: Ifcd027223df96c17447955eb52568d74bb5505ff Reviewed-on: https://chromium-review.googlesource.com/951719 Commit-Queue: Xida Chen <xidachen@chromium.org> Reviewed-by: Robert Flack <flackr@chromium.org> Cr-Commit-Position: refs/heads/master@{#545612} [modify] https://crrev.com/4e2700ead18fc989d70978adfacef881b44e8675/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp [modify] https://crrev.com/4e2700ead18fc989d70978adfacef881b44e8675/third_party/WebKit/Source/core/animation/CompositorAnimations.h [modify] https://crrev.com/4e2700ead18fc989d70978adfacef881b44e8675/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp [add] https://crrev.com/4e2700ead18fc989d70978adfacef881b44e8675/third_party/WebKit/Source/core/animation/test_data/opacity-with-3d-transform.html [add] https://crrev.com/4e2700ead18fc989d70978adfacef881b44e8675/third_party/WebKit/Source/core/animation/test_data/opacity-with-will-change-transform.html
,
Mar 24 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by flackr@chromium.org
, Mar 5 2018