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

Unified Diff: cc/layers/layer_impl.cc

Issue 16925007: Fix scrollbar fade animation scheduling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename fake_time to fake_now Created 7 years, 6 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/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 5781437bbc6828d5c4a664aed4e04999c8c6a483..eb50b61cbe12936bd9d0dfde9ac04e4b7bdef212 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -877,7 +877,7 @@ void LayerImpl::UpdateScrollbarPositions() {
if (scrollbar_animation_controller_ &&
!scrollbar_animation_controller_->IsScrollGestureInProgress()) {
scrollbar_animation_controller_->DidProgrammaticallyUpdateScroll(
- layer_tree_impl()->CurrentFrameTimeTicks());
+ layer_tree_impl_->CurrentPhysicalTimeTicks());
}
// Get the current_offset_.y() value for a sanity-check on scrolling
@@ -985,15 +985,6 @@ void LayerImpl::SetScrollbarOpacity(float opacity) {
vertical_scrollbar_layer_->SetOpacity(opacity);
}
-inline scoped_ptr<ScrollbarAnimationController>
-CreateScrollbarAnimationControllerWithFade(LayerImpl* layer) {
- base::TimeDelta fadeout_delay = base::TimeDelta::FromMilliseconds(300);
- base::TimeDelta fadeout_length = base::TimeDelta::FromMilliseconds(300);
- return ScrollbarAnimationControllerLinearFade::Create(
- layer, fadeout_delay, fadeout_length)
- .PassAs<ScrollbarAnimationController>();
-}
-
void LayerImpl::DidBecomeActive() {
if (!layer_tree_impl_->settings().use_linear_fade_scrollbar_animator)
return;
@@ -1002,8 +993,14 @@ void LayerImpl::DidBecomeActive() {
vertical_scrollbar_layer_;
if (need_scrollbar_animation_controller) {
if (!scrollbar_animation_controller_) {
+ base::TimeDelta fadeout_delay = base::TimeDelta::FromMilliseconds(
+ layer_tree_impl_->settings().scrollbar_linear_fade_delay_ms);
+ base::TimeDelta fadeout_length = base::TimeDelta::FromMilliseconds(
+ layer_tree_impl_->settings().scrollbar_linear_fade_length_ms);
scrollbar_animation_controller_ =
- CreateScrollbarAnimationControllerWithFade(this);
+ ScrollbarAnimationControllerLinearFade::Create(
+ this, fadeout_delay, fadeout_length)
+ .PassAs<ScrollbarAnimationController>();
}
} else {
scrollbar_animation_controller_.reset();
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698