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

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

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: hide mask layer also 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling(); 1209 gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling();
1210 content_size.SetToMax(root_container_layer->BoundsForScrolling()); 1210 content_size.SetToMax(root_container_layer->BoundsForScrolling());
1211 return content_size; 1211 return content_size;
1212 } 1212 }
1213 1213
1214 LayerImpl* LayerTreeImpl::LayerById(int id) const { 1214 LayerImpl* LayerTreeImpl::LayerById(int id) const {
1215 LayerImplMap::const_iterator iter = layer_id_map_.find(id); 1215 LayerImplMap::const_iterator iter = layer_id_map_.find(id);
1216 return iter != layer_id_map_.end() ? iter->second : nullptr; 1216 return iter != layer_id_map_.end() ? iter->second : nullptr;
1217 } 1217 }
1218 1218
1219 using SurfaceIdsList = std::vector<const SurfaceId*>;
enne (OOO) 2017/05/19 22:27:05 I think this should be SurfaceId and not SurfaceId
jaydasika 2017/05/23 00:25:14 Done.
1220 void LayerTreeImpl::SetHiddenSurfaceLayerIds(
1221 const SurfaceIdsList* hidden_surface_layer_ids) {
enne (OOO) 2017/05/19 22:27:05 Maybe pass by const ref here?
jaydasika 2017/05/23 00:25:14 Done.
1222 DCHECK(hidden_surface_layer_ids_.empty());
1223 hidden_surface_layer_ids_ = *hidden_surface_layer_ids;
1224 }
1225
1226 const SurfaceIdsList* LayerTreeImpl::HiddenSurfaceLayerIds() const {
enne (OOO) 2017/05/19 22:27:05 Maybe a const ref and not a pointer, if it's never
jaydasika 2017/05/23 00:25:14 Done.
1227 return &hidden_surface_layer_ids_;
1228 }
1229
1230 void LayerTreeImpl::ClearHiddenSurfaceLayerIds() {
1231 hidden_surface_layer_ids_.clear();
1232 }
1233
1219 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) { 1234 void LayerTreeImpl::AddLayerShouldPushProperties(LayerImpl* layer) {
1220 layers_that_should_push_properties_.insert(layer); 1235 layers_that_should_push_properties_.insert(layer);
1221 } 1236 }
1222 1237
1223 void LayerTreeImpl::RemoveLayerShouldPushProperties(LayerImpl* layer) { 1238 void LayerTreeImpl::RemoveLayerShouldPushProperties(LayerImpl* layer) {
1224 layers_that_should_push_properties_.erase(layer); 1239 layers_that_should_push_properties_.erase(layer);
1225 } 1240 }
1226 1241
1227 std::unordered_set<LayerImpl*>& 1242 std::unordered_set<LayerImpl*>&
1228 LayerTreeImpl::LayersThatShouldPushProperties() { 1243 LayerTreeImpl::LayersThatShouldPushProperties() {
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2116
2102 void LayerTreeImpl::ResetAllChangeTracking() { 2117 void LayerTreeImpl::ResetAllChangeTracking() {
2103 layers_that_should_push_properties_.clear(); 2118 layers_that_should_push_properties_.clear();
2104 // Iterate over all layers, including masks. 2119 // Iterate over all layers, including masks.
2105 for (auto& layer : *layers_) 2120 for (auto& layer : *layers_)
2106 layer->ResetChangeTracking(); 2121 layer->ResetChangeTracking();
2107 property_trees_.ResetAllChangeTracking(); 2122 property_trees_.ResetAllChangeTracking();
2108 } 2123 }
2109 2124
2110 } // namespace cc 2125 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698