Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a crash by PaintWorklet + custom property animation
https://chromium-review.googlesource.com/c/chromium/src/+/2359370 The above CL made a custom property animation always composited if it is used by paint worklet, even if the element does not have "will-change: transform". The approach is that we give a special ElementId which is uint64_t::max() to the paint worklet element, and then on the CC side, once we see that element id, we know that it is an animation associated with paint worklet and we will always tick that animation. The problem comes when there are two paint worklet elements. The short version of the problem is: CC's animation system doesn't allow two layers with the same ElementId. Longer version: Then these two layers would have the same ElementId when we try to attach a composited layer with that animation. As a result, in the AnimationHost::RegisterAnimationForElement(), we will have two Animation with the same ElementId. Then, the actual crash happens at ElementAnimations::GetPropertyToElementIdMap(), at the first DCHECK. So the solution in this CL is to not DCHECK in certain cases. The DCHECK actually doesn't make sense in this case where there is no composited layer. In fact, the callers of the ElementAnimations::GetPropertyToElementIdMap gives the result to MutatorHostClient::ElementIsAnimatingChanged, and in there it only cares about 4 properties. So for the other properties that it doesn't care, we should not put it in the map. Bug: 1151755 Change-Id: I5479ccae80f3c89db98d27518ef013dded527ece
- Loading branch information