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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 set_needs_update_draw_properties(); | 155 set_needs_update_draw_properties(); |
156 return root_layer_.Pass(); | 156 return root_layer_.Pass(); |
157 } | 157 } |
158 | 158 |
159 static void UpdateClipTreeForBoundsDeltaOnLayer(LayerImpl* layer, | 159 static void UpdateClipTreeForBoundsDeltaOnLayer(LayerImpl* layer, |
160 ClipTree* clip_tree) { | 160 ClipTree* clip_tree) { |
161 if (layer && layer->masks_to_bounds()) { | 161 if (layer && layer->masks_to_bounds()) { |
162 ClipNode* clip_node = clip_tree->Node(layer->clip_tree_index()); | 162 ClipNode* clip_node = clip_tree->Node(layer->clip_tree_index()); |
163 if (clip_node) { | 163 if (clip_node) { |
164 DCHECK_EQ(layer->id(), clip_node->owner_id); | 164 DCHECK_EQ(layer->id(), clip_node->owner_id); |
165 gfx::Size bounds = layer->bounds(); | 165 gfx::SizeF bounds = gfx::SizeF(layer->bounds()); |
166 if (clip_node->data.clip.size() != bounds) { | 166 if (clip_node->data.clip.size() != bounds) { |
167 clip_node->data.clip.set_size(bounds); | 167 clip_node->data.clip.set_size(bounds); |
168 clip_tree->set_needs_update(true); | 168 clip_tree->set_needs_update(true); |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 void LayerTreeImpl::UpdatePropertyTreesForBoundsDelta() { | 174 void LayerTreeImpl::UpdatePropertyTreesForBoundsDelta() { |
175 DCHECK(IsActiveTree()); | 175 DCHECK(IsActiveTree()); |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 // the unoccluded_screen_space_region_ is not valid anymore. | 712 // the unoccluded_screen_space_region_ is not valid anymore. |
713 DCHECK(!needs_update_draw_properties_); | 713 DCHECK(!needs_update_draw_properties_); |
714 return unoccluded_screen_space_region_; | 714 return unoccluded_screen_space_region_; |
715 } | 715 } |
716 | 716 |
717 gfx::SizeF LayerTreeImpl::ScrollableSize() const { | 717 gfx::SizeF LayerTreeImpl::ScrollableSize() const { |
718 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() | 718 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() |
719 ? OuterViewportScrollLayer() | 719 ? OuterViewportScrollLayer() |
720 : InnerViewportScrollLayer(); | 720 : InnerViewportScrollLayer(); |
721 if (!root_scroll_layer || root_scroll_layer->children().empty()) | 721 if (!root_scroll_layer || root_scroll_layer->children().empty()) |
722 return gfx::Size(); | 722 return gfx::SizeF(); |
723 | 723 |
724 gfx::SizeF content_size = | 724 gfx::SizeF content_size = |
725 root_scroll_layer->children()[0]->BoundsForScrolling(); | 725 root_scroll_layer->children()[0]->BoundsForScrolling(); |
726 gfx::SizeF viewport_size = | 726 gfx::SizeF viewport_size = |
727 root_scroll_layer->scroll_clip_layer()->BoundsForScrolling(); | 727 root_scroll_layer->scroll_clip_layer()->BoundsForScrolling(); |
728 | 728 |
729 content_size.SetToMax(viewport_size); | 729 content_size.SetToMax(viewport_size); |
730 return content_size; | 730 return content_size; |
731 } | 731 } |
732 | 732 |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 const gfx::BoxF& box, | 1708 const gfx::BoxF& box, |
1709 gfx::BoxF* bounds) const { | 1709 gfx::BoxF* bounds) const { |
1710 *bounds = gfx::BoxF(); | 1710 *bounds = gfx::BoxF(); |
1711 return layer_tree_host_impl_->animation_host() | 1711 return layer_tree_host_impl_->animation_host() |
1712 ? layer_tree_host_impl_->animation_host() | 1712 ? layer_tree_host_impl_->animation_host() |
1713 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 1713 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
1714 : true; | 1714 : true; |
1715 } | 1715 } |
1716 | 1716 |
1717 } // namespace cc | 1717 } // namespace cc |
OLD | NEW |