New issue
Advanced search Search tips

Issue 844641 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 430155



Sign in to add a comment

Animation Worklet - Remove AnimationHost::TickScrollAnimations

Project Member Reported by majidvp@chromium.org, May 18 2018

Issue description

This methods was meant to tick scroll-linked animation which is currently only include 
worklet animations attached to scroll timeline.


However, it seems to be more of less unnecessary with vsync aligned input.

In particular scroll offset is changes due to two different sources:
 a- impl-only scroll animations e.g., smooth scrolling
 b- handling scroll gestures on compositor

We already run worklet animations after each of these anyways so
it appears that |AnimationHost::TickScrollAnimations| is redundant


Here is what happens in each case:

(a) occurs as part of AnimationHost::TickAnimations before we call mutator to produce its update.
(b) occurs due to the following (see calls for InputHandler::ScrollBy)
 b.1- InputHandlerClient::Animate(monotonic_time) for fling and snap driven scrolls
 b.2- InputHandlerProxy::HandleInputEvent 
    b.2.1- InputHandlerClient::DeliverInputForBeginFrame()  for scroll events that are queued => OK since we dispatch queued events at frame begin just before animation to sync align.
    b.2.2- InputHandlerProxy::HandleInputEventWithLatencyInfo() for scroll event that bypass queue and dispatched immediately


b.2.2. is the only case that we have to worry is where we don't queue a GestureScrollUpdate event and scroll immediately.

AFAICT, this is rare but can happen in following situations:
 - we don't have any queuing (e.g., vsync aligned is not enabled) 
 - scroll_update_has_blocking_wheel_source  which happens for first scroll update [1]
 

The above are the only two situations where we may want to re-rerun scroll animations
which is a much smaller set of what we are currently doing.


[1] https://codesearch.chromium.org/chromium/src/ui/events/blink/input_handler_proxy.cc?type=cs&sq=package:chromium&g=0&l=273
  

 
Just had a chat with dtapuska@.

First vsync aligned input is disabled on webview.
And as pointed above there are other cases where we cannot count on input
being vSync aligned so we still need to have AnimationHost::TickScrollAnimations" which gets called on those few cases
re #1: close it then?
Status: WontFix (was: Available)
Yes I think we should close. 

At the moment we have an optimization that skips ticking scroll-linked animations whose scroll offset has not changed. This means calling 
AnimationHost::TickScrollAnimation redundantly will be cheap so 
spending time to reduce the calls does not seem to be productive
given the complexity and all the edge cases.

Sign in to add a comment