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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 ? OuterViewportScrollLayer()->scroll_clip_layer() | 358 ? OuterViewportScrollLayer()->scroll_clip_layer() |
359 : NULL; | 359 : NULL; |
360 } | 360 } |
361 | 361 |
362 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { | 362 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { |
363 DCHECK(IsActiveTree()); | 363 DCHECK(IsActiveTree()); |
364 return LayerById(currently_scrolling_layer_id_); | 364 return LayerById(currently_scrolling_layer_id_); |
365 } | 365 } |
366 | 366 |
367 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { | 367 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
368 DCHECK_IMPLIES(layer, layer != OuterViewportScrollLayer()); | |
369 | |
370 int new_id = layer ? layer->id() : Layer::INVALID_ID; | 368 int new_id = layer ? layer->id() : Layer::INVALID_ID; |
371 if (currently_scrolling_layer_id_ == new_id) | 369 if (currently_scrolling_layer_id_ == new_id) |
372 return; | 370 return; |
373 | 371 |
374 ScrollbarAnimationController* old_animation_controller = | 372 ScrollbarAnimationController* old_animation_controller = |
375 layer_tree_host_impl_->ScrollbarAnimationControllerForId( | 373 layer_tree_host_impl_->ScrollbarAnimationControllerForId( |
376 currently_scrolling_layer_id_); | 374 currently_scrolling_layer_id_); |
377 ScrollbarAnimationController* new_animation_controller = | 375 ScrollbarAnimationController* new_animation_controller = |
378 layer_tree_host_impl_->ScrollbarAnimationControllerForId(new_id); | 376 layer_tree_host_impl_->ScrollbarAnimationControllerForId(new_id); |
379 | 377 |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 const gfx::BoxF& box, | 1891 const gfx::BoxF& box, |
1894 gfx::BoxF* bounds) const { | 1892 gfx::BoxF* bounds) const { |
1895 *bounds = gfx::BoxF(); | 1893 *bounds = gfx::BoxF(); |
1896 return layer_tree_host_impl_->animation_host() | 1894 return layer_tree_host_impl_->animation_host() |
1897 ? layer_tree_host_impl_->animation_host() | 1895 ? layer_tree_host_impl_->animation_host() |
1898 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1896 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1899 : true; | 1897 : true; |
1900 } | 1898 } |
1901 | 1899 |
1902 } // namespace cc | 1900 } // namespace cc |
OLD | NEW |