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}
Showing
Please register or sign in to comment