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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 23978008: Suppress scrollbar animation if the scroll gesture does not scroll (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostImpl unit tests Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/scrollbar_animation_controller.h" 10 #include "cc/animation/scrollbar_animation_controller.h"
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 vertical_scrollbar_layer_->SetCurrentPos(current_offset.y()); 968 vertical_scrollbar_layer_->SetCurrentPos(current_offset.y());
969 vertical_scrollbar_layer_->SetMaximum(max_scroll_offset_.y()); 969 vertical_scrollbar_layer_->SetMaximum(max_scroll_offset_.y());
970 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio( 970 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio(
971 viewport.height() / scrollable_size.height()); 971 viewport.height() / scrollable_size.height());
972 } 972 }
973 973
974 if (current_offset == last_scroll_offset_) 974 if (current_offset == last_scroll_offset_)
975 return; 975 return;
976 last_scroll_offset_ = current_offset; 976 last_scroll_offset_ = current_offset;
977 977
978 if (scrollbar_animation_controller_ && 978 if (scrollbar_animation_controller_) {
979 !scrollbar_animation_controller_->IsScrollGestureInProgress()) { 979 scrollbar_animation_controller_->DidScrollUpdate(
980 scrollbar_animation_controller_->DidProgrammaticallyUpdateScroll(
981 layer_tree_impl_->CurrentPhysicalTimeTicks()); 980 layer_tree_impl_->CurrentPhysicalTimeTicks());
982 } 981 }
983 982
984 // Get the current_offset_.y() value for a sanity-check on scrolling 983 // Get the current_offset_.y() value for a sanity-check on scrolling
985 // benchmark metrics. Specifically, we want to make sure 984 // benchmark metrics. Specifically, we want to make sure
986 // BasicMouseWheelSmoothScrollGesture has proper scroll curves. 985 // BasicMouseWheelSmoothScrollGesture has proper scroll curves.
987 if (layer_tree_impl()->IsActiveTree()) { 986 if (layer_tree_impl()->IsActiveTree()) {
988 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y()); 987 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y());
989 } 988 }
990 } 989 }
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 1306
1308 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } 1307 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; }
1309 1308
1310 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1309 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1311 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1310 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1312 AsValueInto(state.get()); 1311 AsValueInto(state.get());
1313 return state.PassAs<base::Value>(); 1312 return state.PassAs<base::Value>();
1314 } 1313 }
1315 1314
1316 } // namespace cc 1315 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698