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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 client_->SetNeedsCommitOnImplThread(); | 1857 client_->SetNeedsCommitOnImplThread(); |
1858 client_->RenewTreePriority(); | 1858 client_->RenewTreePriority(); |
1859 } | 1859 } |
1860 } | 1860 } |
1861 | 1861 |
1862 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { | 1862 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { |
1863 if (!top_controls_manager_ || !RootScrollLayer()) | 1863 if (!top_controls_manager_ || !RootScrollLayer()) |
1864 return; | 1864 return; |
1865 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); | 1865 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); |
1866 UpdateMaxScrollOffset(); | 1866 UpdateMaxScrollOffset(); |
| 1867 if (RootScrollLayer()->TotalScrollOffset().y() == 0.f) |
| 1868 return; |
1867 RootScrollLayer()->ScrollBy(gfx::ScaleVector2d( | 1869 RootScrollLayer()->ScrollBy(gfx::ScaleVector2d( |
1868 scroll, 1.f / active_tree_->total_page_scale_factor())); | 1870 scroll, 1.f / active_tree_->total_page_scale_factor())); |
1869 } | 1871 } |
1870 | 1872 |
1871 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, | 1873 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, |
1872 base::Time wall_clock_time) { | 1874 base::Time wall_clock_time) { |
1873 if (!settings_.accelerated_animation_enabled || | 1875 if (!settings_.accelerated_animation_enabled || |
1874 animation_registrar_->active_animation_controllers().empty() || | 1876 animation_registrar_->active_animation_controllers().empty() || |
1875 !active_tree_->root_layer()) | 1877 !active_tree_->root_layer()) |
1876 return; | 1878 return; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 } | 2133 } |
2132 | 2134 |
2133 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2135 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2134 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2136 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2135 paint_time_counter_->ClearHistory(); | 2137 paint_time_counter_->ClearHistory(); |
2136 | 2138 |
2137 debug_state_ = debug_state; | 2139 debug_state_ = debug_state; |
2138 } | 2140 } |
2139 | 2141 |
2140 } // namespace cc | 2142 } // namespace cc |
OLD | NEW |