Make a custom property composited if used by Paint Worklet #25190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Paint worklet already works with custom property animation running
on the compositor thread, the requirement is that we need
“will-change: transform” for the paint worklet element. Without
that, the custom property animation will run on the main thread,
such as this example: https://output.jsbin.com/muwiyux/quiet.
This CL makes changes such that a custom property animation will
always be composited as long as it is used by paint worklet, even
if the element doesn't have "will-change: transform".
The change is actually small, there are only two things we need:
For #1, we add a "has_paint_worklet_with_custom_prop_anim" in
the Animation::PreCommit, when it is true, we always composite
the animation.
For #2, we give a special ElementId which is uint64_t::max() to
the paint worklet element, and on the CC side, once we see that
element id, we know that the animation associated with that should
be ticking even if the element id doesn't have anything associated
on the property tree.
Bug: 987969
Change-Id: Ia849640065470e529a2b8d23a4b7b74339831c48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359370
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812056}