Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: fix cc_unittests after rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling(); 1246 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling();
1247 content_size.SetToMax(root_container_layer->BoundsForScrolling()); 1247 content_size.SetToMax(root_container_layer->BoundsForScrolling());
1248 return content_size; 1248 return content_size;
1249 } 1249 }
1250 1250
1251 LayerImpl* LayerTreeImpl::LayerById(int id) const { 1251 LayerImpl* LayerTreeImpl::LayerById(int id) const {
1252 LayerImplMap::const_iterator iter = layer_id_map_.find(id); 1252 LayerImplMap::const_iterator iter = layer_id_map_.find(id);
1253 return iter != layer_id_map_.end() ? iter->second : nullptr; 1253 return iter != layer_id_map_.end() ? iter->second : nullptr;
1254 } 1254 }
1255 1255
1256 using SurfaceIdsList = std::vector<const SurfaceId*>;
1257 void LayerTreeImpl::SetHiddenSurfaceLayerIds(
1258 const SurfaceIdsList* hidden_surface_layer_ids) {
1259 DCHECK(hidden_surface_layer_ids_.empty());
1260 hidden_surface_layer_ids_ = *hidden_surface_layer_ids;
1261 }
1262
1263 const SurfaceIdsList* LayerTreeImpl::HiddenSurfaceLayerIds() const {
1264 return &hidden_surface_layer_ids_;
1265 }
1266
1267 void LayerTreeImpl::ClearHiddenSurfaceLayerIds() {
1268 hidden_surface_layer_ids_.clear();
1269 }
1270
1256 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) { 1271 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) {
1257 layers_that_should_push_properties_.insert(layer); 1272 layers_that_should_push_properties_.insert(layer);
1258 } 1273 }
1259 1274
1260 void LayerTreeImpl::RemoveLayerShouldPushProperties(LayerImpl* layer) { 1275 void LayerTreeImpl::RemoveLayerShouldPushProperties(LayerImpl* layer) {
1261 layers_that_should_push_properties_.erase(layer); 1276 layers_that_should_push_properties_.erase(layer);
1262 } 1277 }
1263 1278
1264 std::unordered_set<LayerImpl*>& 1279 std::unordered_set<LayerImpl*>&
1265 LayerTreeImpl::LayersThatShouldPushProperties() { 1280 LayerTreeImpl::LayersThatShouldPushProperties() {
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 2153
2139 void LayerTreeImpl::ResetAllChangeTracking() { 2154 void LayerTreeImpl::ResetAllChangeTracking() {
2140 layers_that_should_push_properties_.clear(); 2155 layers_that_should_push_properties_.clear();
2141 // Iterate over all layers, including masks. 2156 // Iterate over all layers, including masks.
2142 for (auto& layer : *layers_) 2157 for (auto& layer : *layers_)
2143 layer->ResetChangeTracking(); 2158 layer->ResetChangeTracking();
2144 property_trees_.ResetAllChangeTracking(); 2159 property_trees_.ResetAllChangeTracking();
2145 } 2160 }
2146 2161
2147 } // namespace cc 2162 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698