| OLD | NEW |
| 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio( | 965 vertical_scrollbar_layer_->SetVisibleToTotalLengthRatio( |
| 966 viewport.height() / scrollable_size.height()); | 966 viewport.height() / scrollable_size.height()); |
| 967 } | 967 } |
| 968 | 968 |
| 969 if (current_offset == last_scroll_offset_) | 969 if (current_offset == last_scroll_offset_) |
| 970 return; | 970 return; |
| 971 last_scroll_offset_ = current_offset; | 971 last_scroll_offset_ = current_offset; |
| 972 | 972 |
| 973 if (scrollbar_animation_controller_) { | 973 if (scrollbar_animation_controller_) { |
| 974 bool should_animate = scrollbar_animation_controller_->DidScrollUpdate( | 974 bool should_animate = scrollbar_animation_controller_->DidScrollUpdate( |
| 975 layer_tree_impl_->CurrentPhysicalTimeTicks()); | 975 layer_tree_impl_->CurrentPhysicalFrameTime()); |
| 976 if (should_animate) | 976 if (should_animate) |
| 977 layer_tree_impl_->StartScrollbarAnimation(); | 977 layer_tree_impl_->StartScrollbarAnimation(); |
| 978 } | 978 } |
| 979 | 979 |
| 980 // Get the current_offset_.y() value for a sanity-check on scrolling | 980 // Get the current_offset_.y() value for a sanity-check on scrolling |
| 981 // benchmark metrics. Specifically, we want to make sure | 981 // benchmark metrics. Specifically, we want to make sure |
| 982 // BasicMouseWheelSmoothScrollGesture has proper scroll curves. | 982 // BasicMouseWheelSmoothScrollGesture has proper scroll curves. |
| 983 if (layer_tree_impl()->IsActiveTree()) { | 983 if (layer_tree_impl()->IsActiveTree()) { |
| 984 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y()); | 984 TRACE_COUNTER_ID1("gpu", "scroll_offset_y", this->id(), current_offset.y()); |
| 985 } | 985 } |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 | 1326 |
| 1327 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1327 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
| 1328 | 1328 |
| 1329 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1329 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
| 1330 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1330 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1331 AsValueInto(state.get()); | 1331 AsValueInto(state.get()); |
| 1332 return state.PassAs<base::Value>(); | 1332 return state.PassAs<base::Value>(); |
| 1333 } | 1333 } |
| 1334 | 1334 |
| 1335 } // namespace cc | 1335 } // namespace cc |
| OLD | NEW |