Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1430)

Unified Diff: cc/animation/layer_animation_controller.h

Issue 864003002: cc: Make LayerAnimationController keep state for clearing scroll delta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/animation/layer_animation_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_animation_controller.h
diff --git a/cc/animation/layer_animation_controller.h b/cc/animation/layer_animation_controller.h
index d776ee9cbd7de72e27eca1722cf6dcfd75ca797a..48c3bdcaede9b1d330ec21beb0ae7cc1eafc289a 100644
--- a/cc/animation/layer_animation_controller.h
+++ b/cc/animation/layer_animation_controller.h
@@ -139,6 +139,17 @@ class CC_EXPORT LayerAnimationController
// be computed.
bool MaximumTargetScale(float* max_scale) const;
+ // When a scroll animation is removed on the main thread, its compositor
+ // thread counterpart continues producing scroll deltas until activation.
+ // These scroll deltas need to be cleared at activation, so that the active
+ // layer's scroll offset matches the offset provided by the main thread
+ // rather than a combination of this offset and scroll deltas produced by
+ // the removed animation. This is to provide the illusion of synchronicity to
+ // JS that simultaneously removes an animation and sets the scroll offset.
+ bool scroll_offset_animation_was_interrupted() const {
+ return scroll_offset_animation_was_interrupted_;
+ }
+
bool needs_to_start_animations_for_testing() {
return needs_to_start_animations_;
}
@@ -156,8 +167,7 @@ class CC_EXPORT LayerAnimationController
LayerAnimationController* controller_impl) const;
void RemoveAnimationsCompletedOnMainThread(
LayerAnimationController* controller_impl) const;
- void PushPropertiesToImplThread(
- LayerAnimationController* controller_impl) const;
+ void PushPropertiesToImplThread(LayerAnimationController* controller_impl);
void StartAnimations(base::TimeTicks monotonic_time);
void PromoteStartedAnimations(base::TimeTicks monotonic_time,
@@ -191,8 +201,6 @@ class CC_EXPORT LayerAnimationController
void NotifyObserversAnimationWaitingForDeletion();
- void NotifyObserversScrollOffsetAnimationRemoved();
-
bool HasValueObserver();
bool HasActiveValueObserver();
@@ -216,6 +224,8 @@ class CC_EXPORT LayerAnimationController
// previous attempt at starting animations failed to start all animations.
bool needs_to_start_animations_;
+ bool scroll_offset_animation_was_interrupted_;
+
DISALLOW_COPY_AND_ASSIGN(LayerAnimationController);
};
« no previous file with comments | « no previous file | cc/animation/layer_animation_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698