Skip to content

Commit

Permalink
Revert "Skip static animations on compositor and main" (#44970)
Browse files Browse the repository at this point in the history
This reverts commit 3690cd7872423e81e74dc66f9886e355a7c1b659.

Reason for revert: virtual/threaded-no-composited-antialiasing/animations
tests started failing on multiple builders after this CL.
* https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel
* https://ci.chromium.org/ui/p/chromium/builders/ci/mac11-arm64-rel-tests
* https://ci.chromium.org/ui/p/chromium/builders/ci/mac12-arm64-rel-tests
* https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20Tests

Original change's description:
> Skip static animations on compositor and main
>
> An animation with empty keyframes or with keyframes whose property
> values are identical between frames previously ran as a normal
> animation. As there is no visual change other than at a phase boundary,
> these animations do not need to run on the compositor, and only need
> to be scheduled on the main thread at phase boundaries.
>
> This is the first step in optimizing no-op animations. A follow up
> patch will short-circuit sampling when the property value is constant.
> Another patch will refine the rules for background color compositing
> to only consider dynamic properties.  Finally, metrics will be added
> to track shorthand expansion of CSS properties, which is likely the
> most common source of static properties in CSS animations.
>
> Bug: 40728212
> Change-Id: I1baff2d0d26400f91f12d4cac2141e9bb101b3d0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5328026
> Reviewed-by: Ian Clelland <iclelland@chromium.org>
> Reviewed-by: Robert Flack <flackr@chromium.org>
> Commit-Queue: Kevin Ellis <kevers@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268998}

Bug: 40728212
Change-Id: Idccfa689d7a3b6e6ee9e2b6a5d109c94a4d3870b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5349489
Owners-Override: Michael Ershov <miersh@google.com>
Commit-Queue: Michael Ershov <miersh@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Michael Ershov <miersh@google.com>
Cr-Commit-Position: refs/heads/main@{#1269503}

Co-authored-by: Michael Ershov <miersh@google.com>
  • Loading branch information
chromium-wpt-export-bot and Michael Ershov committed Mar 10, 2024
1 parent d9a5cc2 commit ffdd147
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Expand Up @@ -127,13 +127,6 @@ const midpointOptions = {
delay: -duration/2
};

// Constant-valued animation using the ending keyframe's value.
const referenceOptions = {
easing: 'steps(1, jump-start)',
duration: duration,
delay: -duration/2
}

// Similar to midpointOptions, but to produce the interpolation result
// at -1 instead of the interpolation result at 0.5. This easing curve
// has zero slope at its midpoint of -100% (though does have curvature).
Expand Down Expand Up @@ -176,8 +169,9 @@ async function createTests(tests) {
takeScreenshot();
}

// Create references using a constant-valued animation to avoid rounding and
// anti-aliasing differences between animated and non-animated pathways.
// Create references using an animation with identical keyframes for start
// and end so as to avoid rounding and anti-aliasing differences between
// animated and non-animated pathways.
async function createRefs(tests) {
styleBody();
for (const obj of tests) {
Expand All @@ -187,8 +181,8 @@ async function createRefs(tests) {
initialStyle(div);
finalStyle(div);
var anim = div.animate(
{transform: ['none', test[midIndex]]},
referenceOptions);
{transform: [test[midIndex], test[midIndex]]},
midpointOptions);
await anim.ready;
}

Expand Down
2 changes: 1 addition & 1 deletion dom/events/scrolling/scroll_support.js
Expand Up @@ -120,7 +120,7 @@ function waitForCompositorCommit() {
// deferred running the tests until after paint holding.
async function waitForCompositorReady() {
const animation =
document.body.animate({ opacity: [ 0, 1 ] }, {duration: 1 });
document.body.animate({ opacity: [ 1, 1 ] }, {duration: 1 });
return animation.finished;
}

Expand Down
2 changes: 1 addition & 1 deletion web-animations/testcommon.js
Expand Up @@ -331,7 +331,7 @@ function assert_phase(animation, phase) {
// crbug.com/1378671
async function waitForCompositorReady() {
const animation =
document.body.animate({ opacity: [ 0, 1 ] }, {duration: 1 });
document.body.animate({ opacity: [ 1, 1 ] }, {duration: 1 });
return animation.finished;
}

Expand Down

0 comments on commit ffdd147

Please sign in to comment.