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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 ? OuterViewportScrollLayer()->scroll_clip_layer() | 258 ? OuterViewportScrollLayer()->scroll_clip_layer() |
259 : NULL; | 259 : NULL; |
260 } | 260 } |
261 | 261 |
262 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { | 262 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { |
263 DCHECK(IsActiveTree()); | 263 DCHECK(IsActiveTree()); |
264 return LayerById(currently_scrolling_layer_id_); | 264 return LayerById(currently_scrolling_layer_id_); |
265 } | 265 } |
266 | 266 |
267 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { | 267 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
| 268 DCHECK_IMPLIES(layer, layer != OuterViewportScrollLayer()); |
| 269 |
268 int new_id = layer ? layer->id() : Layer::INVALID_ID; | 270 int new_id = layer ? layer->id() : Layer::INVALID_ID; |
269 if (currently_scrolling_layer_id_ == new_id) | 271 if (currently_scrolling_layer_id_ == new_id) |
270 return; | 272 return; |
271 | 273 |
272 if (CurrentlyScrollingLayer() && | 274 if (CurrentlyScrollingLayer() && |
273 CurrentlyScrollingLayer()->scrollbar_animation_controller()) | 275 CurrentlyScrollingLayer()->scrollbar_animation_controller()) |
274 CurrentlyScrollingLayer()->scrollbar_animation_controller()->DidScrollEnd(); | 276 CurrentlyScrollingLayer()->scrollbar_animation_controller()->DidScrollEnd(); |
275 currently_scrolling_layer_id_ = new_id; | 277 currently_scrolling_layer_id_ = new_id; |
276 if (layer && layer->scrollbar_animation_controller()) | 278 if (layer && layer->scrollbar_animation_controller()) |
277 layer->scrollbar_animation_controller()->DidScrollBegin(); | 279 layer->scrollbar_animation_controller()->DidScrollBegin(); |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 const gfx::BoxF& box, | 1710 const gfx::BoxF& box, |
1709 gfx::BoxF* bounds) const { | 1711 gfx::BoxF* bounds) const { |
1710 *bounds = gfx::BoxF(); | 1712 *bounds = gfx::BoxF(); |
1711 return layer_tree_host_impl_->animation_host() | 1713 return layer_tree_host_impl_->animation_host() |
1712 ? layer_tree_host_impl_->animation_host() | 1714 ? layer_tree_host_impl_->animation_host() |
1713 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1715 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1714 : true; | 1716 : true; |
1715 } | 1717 } |
1716 | 1718 |
1717 } // namespace cc | 1719 } // namespace cc |
OLD | NEW |