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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 void LayerTreeImpl::UpdateMaxScrollOffset() { | 211 void LayerTreeImpl::UpdateMaxScrollOffset() { |
212 if (!root_scroll_layer_ || !root_scroll_layer_->children().size()) | 212 if (!root_scroll_layer_ || !root_scroll_layer_->children().size()) |
213 return; | 213 return; |
214 | 214 |
215 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - | 215 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - |
216 gfx::RectF(ScrollableViewportSize()).bottom_right(); | 216 gfx::RectF(ScrollableViewportSize()).bottom_right(); |
217 | 217 |
218 // The viewport may be larger than the contents in some cases, such as | 218 // The viewport may be larger than the contents in some cases, such as |
219 // having a vertical scrollbar but no horizontal overflow. | 219 // having a vertical scrollbar but no horizontal overflow. |
220 max_scroll.ClampToMin(gfx::Vector2dF()); | 220 max_scroll.SetToMax(gfx::Vector2dF()); |
221 | 221 |
222 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll)); | 222 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll)); |
223 } | 223 } |
224 | 224 |
225 void LayerTreeImpl::UpdateSolidColorScrollbars() { | 225 void LayerTreeImpl::UpdateSolidColorScrollbars() { |
226 DCHECK(settings().solid_color_scrollbars); | 226 DCHECK(settings().solid_color_scrollbars); |
227 | 227 |
228 LayerImpl* root_scroll = RootScrollLayer(); | 228 LayerImpl* root_scroll = RootScrollLayer(); |
229 DCHECK(root_scroll); | 229 DCHECK(root_scroll); |
230 DCHECK(IsActiveTree()); | 230 DCHECK(IsActiveTree()); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 564 |
565 void LayerTreeImpl::ClearLatencyInfo() { | 565 void LayerTreeImpl::ClearLatencyInfo() { |
566 latency_info_.Clear(); | 566 latency_info_.Clear(); |
567 } | 567 } |
568 | 568 |
569 void LayerTreeImpl::WillModifyTilePriorities() { | 569 void LayerTreeImpl::WillModifyTilePriorities() { |
570 layer_tree_host_impl_->tile_manager()->WillModifyTilePriorities(); | 570 layer_tree_host_impl_->tile_manager()->WillModifyTilePriorities(); |
571 } | 571 } |
572 | 572 |
573 } // namespace cc | 573 } // namespace cc |
OLD | NEW |