Descriptioncc: Make animations tick regardless of drawing.
The compositor should tick and finish animations even if it is not
drawing anything. It can not draw for various reasons:
1) The tab is backgrounded.
2) CanDraw() is false for any of its reasons.
3) PrepareToDraw() fails due to checkerboarding.
4) There is no damage on the screen to draw.
Currently the problems are:
- When backgrounded, the animations are ticked but their states are not updated.
- When CanDraw() is false, we don't draw, and animations just stop ticking.
- If we stop drawing when we damage the screen, we tick animations, but don't
update animation state since this happens in DrawLayers().
To solve these problems, I've moved the animation control more explicitly out
of LayerTreeHostImpl. The proxy already calls Animate(). Now it will also call
UpdateAnimationState(). It always does this after calling Animate() regardless
if drawing or not.
Secondly, the missing UpdateAnimationState() call is added to the OnTimerTick
for background animation ticking.
We enable background ticking only when we change visibility, currently. But
when CanDraw() is false, we don't draw and thus don't tick animations. So
instead we add to LayerTreeHostImpl a UpdateBackgroundAnimateTicking() method.
We call this always after calling Animate() since that can remove animations -
it's something Animate() used to do. And we also call this:
a) After a commit - this could add new animations, or change visibility.
b) After changing CanDraw()'s state.
However, when PrepareToDraw() is false, we do not want to start new animations
so we let animations finish without starting new ones. This is verified by
the LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations test.
This is covered by adding single-thread mode to all the animation unit tests
(except those that call SetNeedsAnimate() which is not legal in single thread
mode). Also by new tests:
LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw.RunSingleThread
LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw.RunMultiThread
LayerTreeHostAnimationTestRunAnimationWhenNotVisible.RunSingleThread
LayerTreeHostAnimationTestRunAnimationWhenNotVisible.RunMultiThread
LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations.RunMultiThread
Added scheduler tests:
SchedulerStateMachineTest.ReportIfNotDrawing
SchedulerStateMachineTest.ReportIfNotDrawingFromAcquiredTextures
R=ajuma@chromium.org
BUG=222915
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192671
Patch Set 1 #
Total comments: 5
Patch Set 2 : preparetodraw #Patch Set 3 : #
Total comments: 2
Patch Set 4 : parameter #
Total comments: 2
Patch Set 5 : #Patch Set 6 : helper functions #Patch Set 7 : helper-in-scheduler #Patch Set 8 : Add scheduler tests #Patch Set 9 : Drop extra statemachine function #
Messages
Total messages: 21 (0 generated)
|