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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 active_tree_->ClearCurrentlyScrollingLayer(); | 1920 active_tree_->ClearCurrentlyScrollingLayer(); |
1921 did_lock_scrolling_layer_ = false; | 1921 did_lock_scrolling_layer_ = false; |
1922 accumulated_root_overscroll_ = gfx::Vector2dF(); | 1922 accumulated_root_overscroll_ = gfx::Vector2dF(); |
1923 current_fling_velocity_ = gfx::Vector2dF(); | 1923 current_fling_velocity_ = gfx::Vector2dF(); |
1924 } | 1924 } |
1925 | 1925 |
1926 void LayerTreeHostImpl::ScrollEnd() { | 1926 void LayerTreeHostImpl::ScrollEnd() { |
1927 if (top_controls_manager_) | 1927 if (top_controls_manager_) |
1928 top_controls_manager_->ScrollEnd(); | 1928 top_controls_manager_->ScrollEnd(); |
1929 ClearCurrentlyScrollingLayer(); | 1929 ClearCurrentlyScrollingLayer(); |
1930 StartScrollbarAnimation(CurrentFrameTimeTicks()); | 1930 StartScrollbarAnimation(); |
1931 } | 1931 } |
1932 | 1932 |
1933 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { | 1933 InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |
1934 if (active_tree_->CurrentlyScrollingLayer()) | 1934 if (active_tree_->CurrentlyScrollingLayer()) |
1935 return ScrollStarted; | 1935 return ScrollStarted; |
1936 | 1936 |
1937 return ScrollIgnored; | 1937 return ScrollIgnored; |
1938 } | 1938 } |
1939 | 1939 |
1940 void LayerTreeHostImpl::NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) { | 1940 void LayerTreeHostImpl::NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 TRACE_EVENT_INSTANT0( | 2192 TRACE_EVENT_INSTANT0( |
2193 "cc", "LayerTreeHostImpl::SetNeedsRedraw due to AnimateScrollbars", | 2193 "cc", "LayerTreeHostImpl::SetNeedsRedraw due to AnimateScrollbars", |
2194 TRACE_EVENT_SCOPE_THREAD); | 2194 TRACE_EVENT_SCOPE_THREAD); |
2195 client_->SetNeedsRedrawOnImplThread(); | 2195 client_->SetNeedsRedrawOnImplThread(); |
2196 } | 2196 } |
2197 | 2197 |
2198 for (size_t i = 0; i < layer->children().size(); ++i) | 2198 for (size_t i = 0; i < layer->children().size(); ++i) |
2199 AnimateScrollbarsRecursive(layer->children()[i], time); | 2199 AnimateScrollbarsRecursive(layer->children()[i], time); |
2200 } | 2200 } |
2201 | 2201 |
2202 void LayerTreeHostImpl::StartScrollbarAnimation(base::TimeTicks time) { | 2202 void LayerTreeHostImpl::StartScrollbarAnimation() { |
2203 TRACE_EVENT0("cc", "LayerTreeHostImpl::StartScrollbarAnimation"); | 2203 TRACE_EVENT0("cc", "LayerTreeHostImpl::StartScrollbarAnimation"); |
2204 StartScrollbarAnimationRecursive(RootLayer(), time); | 2204 StartScrollbarAnimationRecursive(RootLayer(), base::TimeTicks::Now()); |
2205 } | 2205 } |
2206 | 2206 |
2207 void LayerTreeHostImpl::StartScrollbarAnimationRecursive(LayerImpl* layer, | 2207 void LayerTreeHostImpl::StartScrollbarAnimationRecursive(LayerImpl* layer, |
2208 base::TimeTicks time) { | 2208 base::TimeTicks time) { |
2209 if (!layer) | 2209 if (!layer) |
2210 return; | 2210 return; |
2211 | 2211 |
2212 ScrollbarAnimationController* scrollbar_controller = | 2212 ScrollbarAnimationController* scrollbar_controller = |
2213 layer->scrollbar_animation_controller(); | 2213 layer->scrollbar_animation_controller(); |
2214 if (scrollbar_controller && scrollbar_controller->IsAnimating()) { | 2214 if (scrollbar_controller && scrollbar_controller->IsAnimating()) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 } | 2308 } |
2309 | 2309 |
2310 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2310 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2311 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2311 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2312 paint_time_counter_->ClearHistory(); | 2312 paint_time_counter_->ClearHistory(); |
2313 | 2313 |
2314 debug_state_ = debug_state; | 2314 debug_state_ = debug_state; |
2315 } | 2315 } |
2316 | 2316 |
2317 } // namespace cc | 2317 } // namespace cc |
OLD | NEW |