| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 const Region& LayerTreeImpl::UnoccludedScreenSpaceRegion() const { | 1225 const Region& LayerTreeImpl::UnoccludedScreenSpaceRegion() const { |
| 1226 // If this assert triggers, then the render_surface_list_ is dirty, so the | 1226 // If this assert triggers, then the render_surface_list_ is dirty, so the |
| 1227 // unoccluded_screen_space_region_ is not valid anymore. | 1227 // unoccluded_screen_space_region_ is not valid anymore. |
| 1228 DCHECK(!needs_update_draw_properties_); | 1228 DCHECK(!needs_update_draw_properties_); |
| 1229 return unoccluded_screen_space_region_; | 1229 return unoccluded_screen_space_region_; |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 gfx::SizeF LayerTreeImpl::ScrollableSize() const { | 1232 gfx::SizeF LayerTreeImpl::ScrollableSize() const { |
| 1233 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() | 1233 LayerImpl* root_scroll_layer = nullptr; |
| 1234 ? OuterViewportScrollLayer() | 1234 LayerImpl* root_container_layer = nullptr; |
| 1235 : InnerViewportScrollLayer(); | 1235 if (OuterViewportScrollLayer()) { |
| 1236 if (!root_scroll_layer) | 1236 root_scroll_layer = OuterViewportScrollLayer(); |
| 1237 root_container_layer = OuterViewportContainerLayer(); |
| 1238 } else if (InnerViewportScrollLayer()) { |
| 1239 root_scroll_layer = InnerViewportScrollLayer(); |
| 1240 root_container_layer = InnerViewportContainerLayer(); |
| 1241 } |
| 1242 |
| 1243 if (!root_scroll_layer || !root_container_layer) |
| 1237 return gfx::SizeF(); | 1244 return gfx::SizeF(); |
| 1238 | 1245 |
| 1239 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling(); | 1246 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling(); |
| 1240 gfx::SizeF viewport_size = | 1247 content_size.SetToMax(root_container_layer->BoundsForScrolling()); |
| 1241 root_scroll_layer->scroll_clip_layer()->BoundsForScrolling(); | |
| 1242 | |
| 1243 content_size.SetToMax(viewport_size); | |
| 1244 return content_size; | 1248 return content_size; |
| 1245 } | 1249 } |
| 1246 | 1250 |
| 1247 LayerImpl* LayerTreeImpl::LayerById(int id) const { | 1251 LayerImpl* LayerTreeImpl::LayerById(int id) const { |
| 1248 LayerImplMap::const_iterator iter = layer_id_map_.find(id); | 1252 LayerImplMap::const_iterator iter = layer_id_map_.find(id); |
| 1249 return iter != layer_id_map_.end() ? iter->second : nullptr; | 1253 return iter != layer_id_map_.end() ? iter->second : nullptr; |
| 1250 } | 1254 } |
| 1251 | 1255 |
| 1252 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) { | 1256 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) { |
| 1253 layers_that_should_push_properties_.insert(layer); | 1257 layers_that_should_push_properties_.insert(layer); |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2134 | 2138 |
| 2135 void LayerTreeImpl::ResetAllChangeTracking() { | 2139 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2136 layers_that_should_push_properties_.clear(); | 2140 layers_that_should_push_properties_.clear(); |
| 2137 // Iterate over all layers, including masks. | 2141 // Iterate over all layers, including masks. |
| 2138 for (auto& layer : *layers_) | 2142 for (auto& layer : *layers_) |
| 2139 layer->ResetChangeTracking(); | 2143 layer->ResetChangeTracking(); |
| 2140 property_trees_.ResetAllChangeTracking(); | 2144 property_trees_.ResetAllChangeTracking(); |
| 2141 } | 2145 } |
| 2142 | 2146 |
| 2143 } // namespace cc | 2147 } // namespace cc |
| OLD | NEW |