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

Side by Side Diff: cc/layers/layer.cc

Issue 1139573004: Reset property tree indices when layer is removed from layer tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (parent_should_know_need_push_properties()) { 247 if (parent_should_know_need_push_properties()) {
248 if (parent_) 248 if (parent_)
249 parent_->RemoveDependentNeedsPushProperties(); 249 parent_->RemoveDependentNeedsPushProperties();
250 if (layer) 250 if (layer)
251 layer->AddDependentNeedsPushProperties(); 251 layer->AddDependentNeedsPushProperties();
252 } 252 }
253 253
254 parent_ = layer; 254 parent_ = layer;
255 SetLayerTreeHost(parent_ ? parent_->layer_tree_host() : nullptr); 255 SetLayerTreeHost(parent_ ? parent_->layer_tree_host() : nullptr);
256 256
257 if (!layer)
258 InvalidatePropertyTreeIndices();
ajuma 2015/05/20 13:54:03 I'm a bit worried about the perf impact of this. I
259
257 if (!layer_tree_host_) 260 if (!layer_tree_host_)
258 return; 261 return;
262
263 layer_tree_host_->property_trees()->needs_rebuild = true;
264
259 const LayerTreeSettings& settings = layer_tree_host_->settings(); 265 const LayerTreeSettings& settings = layer_tree_host_->settings();
260 if (!settings.layer_transforms_should_scale_layer_contents) 266 if (!settings.layer_transforms_should_scale_layer_contents)
261 return; 267 return;
262 268
263 reset_raster_scale_to_unknown(); 269 reset_raster_scale_to_unknown();
264 if (mask_layer_.get()) 270 if (mask_layer_.get())
265 mask_layer_->reset_raster_scale_to_unknown(); 271 mask_layer_->reset_raster_scale_to_unknown();
266 if (replica_layer_.get() && replica_layer_->mask_layer_.get()) 272 if (replica_layer_.get() && replica_layer_->mask_layer_.get())
267 replica_layer_->mask_layer_->reset_raster_scale_to_unknown(); 273 replica_layer_->mask_layer_->reset_raster_scale_to_unknown();
268 } 274 }
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 } 1519 }
1514 1520
1515 void Layer::DidBeginTracing() { 1521 void Layer::DidBeginTracing() {
1516 // We'll be dumping layer trees as part of trace, so make sure 1522 // We'll be dumping layer trees as part of trace, so make sure
1517 // PushPropertiesTo() propagates layer debug info to the impl 1523 // PushPropertiesTo() propagates layer debug info to the impl
1518 // side -- otherwise this won't happen for the the layers that 1524 // side -- otherwise this won't happen for the the layers that
1519 // remain unchanged since tracing started. 1525 // remain unchanged since tracing started.
1520 SetNeedsPushProperties(); 1526 SetNeedsPushProperties();
1521 } 1527 }
1522 1528
1529 void Layer::InvalidatePropertyTreeIndices() {
1530 transform_tree_index_ = -1;
1531 clip_tree_index_ = -1;
1532 opacity_tree_index_ = -1;
1533
1534 for (size_t i = 0; i < children().size(); ++i) {
1535 Layer* child_layer = child_at(i);
1536 child_layer->InvalidatePropertyTreeIndices();
1537 }
1538 }
1539
1523 } // namespace cc 1540 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698