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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 | 690 |
691 gfx::Size LayerTreeImpl::ScrollableSize() const { | 691 gfx::Size LayerTreeImpl::ScrollableSize() const { |
692 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() | 692 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() |
693 ? OuterViewportScrollLayer() | 693 ? OuterViewportScrollLayer() |
694 : InnerViewportScrollLayer(); | 694 : InnerViewportScrollLayer(); |
695 if (!root_scroll_layer || root_scroll_layer->children().empty()) | 695 if (!root_scroll_layer || root_scroll_layer->children().empty()) |
696 return gfx::Size(); | 696 return gfx::Size(); |
697 return root_scroll_layer->children()[0]->bounds(); | 697 return root_scroll_layer->children()[0]->bounds(); |
698 } | 698 } |
699 | 699 |
700 LayerImpl* LayerTreeImpl::LayerById(int id) { | 700 LayerImpl* LayerTreeImpl::LayerById(int id) const { |
701 LayerIdMap::iterator iter = layer_id_map_.find(id); | 701 LayerIdMap::const_iterator iter = layer_id_map_.find(id); |
702 return iter != layer_id_map_.end() ? iter->second : NULL; | 702 return iter != layer_id_map_.end() ? iter->second : NULL; |
703 } | 703 } |
704 | 704 |
705 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { | 705 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
706 DCHECK(!LayerById(layer->id())); | 706 DCHECK(!LayerById(layer->id())); |
707 layer_id_map_[layer->id()] = layer; | 707 layer_id_map_[layer->id()] = layer; |
708 } | 708 } |
709 | 709 |
710 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { | 710 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { |
711 DCHECK(LayerById(layer->id())); | 711 DCHECK(LayerById(layer->id())); |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1621 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
1622 pending_page_scale_animation_ = pending_animation.Pass(); | 1622 pending_page_scale_animation_ = pending_animation.Pass(); |
1623 } | 1623 } |
1624 | 1624 |
1625 scoped_ptr<PendingPageScaleAnimation> | 1625 scoped_ptr<PendingPageScaleAnimation> |
1626 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1626 LayerTreeImpl::TakePendingPageScaleAnimation() { |
1627 return pending_page_scale_animation_.Pass(); | 1627 return pending_page_scale_animation_.Pass(); |
1628 } | 1628 } |
1629 | 1629 |
1630 } // namespace cc | 1630 } // namespace cc |
OLD | NEW |