Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a custom property composited if used by Paint Worklet #25190

Merged
merged 1 commit into from Sep 30, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Aug 21, 2020

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:

  1. Start the animation on compositor.
  2. Ensure the compositor ticks the animation.

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2359370 branch 5 times, most recently from 3fe85cc to 658906e Compare August 28, 2020 19:43
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2359370 branch 5 times, most recently from 3740071 to 628a632 Compare September 3, 2020 21:35
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2359370 branch 5 times, most recently from 90aa037 to 9f5d16e Compare September 16, 2020 01:48
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2359370 branch 4 times, most recently from c53312a to e395b8d Compare September 24, 2020 01:59
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2359370 branch 3 times, most recently from 04b8d30 to 985f444 Compare September 29, 2020 20:50
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:
1. Start the animation on compositor.
2. Ensure the compositor ticks the animation.

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}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 0148712 into master Sep 30, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2359370 branch September 30, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants