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

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

Issue 2100353002: cc: DCHECK that the OutputSurface was released in ~LayerTreeHostImpl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: released-outputsurface: rebase-on-2106273002 Created 4 years, 5 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/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 DCHECK(LayerListIsEmpty()); 93 DCHECK(LayerListIsEmpty());
94 DCHECK(layers_->empty()); 94 DCHECK(layers_->empty());
95 } 95 }
96 96
97 void LayerTreeImpl::Shutdown() { 97 void LayerTreeImpl::Shutdown() {
98 DetachLayers(); 98 DetachLayers();
99 DCHECK(LayerListIsEmpty()); 99 DCHECK(LayerListIsEmpty());
100 } 100 }
101 101
102 void LayerTreeImpl::ReleaseResources() { 102 void LayerTreeImpl::ReleaseResources() {
103 #if DCHECK_IS_ON()
104 // These DCHECKs catch tests that add layers to the tree but fail to build the
105 // layer list afterward.
106 LayerListIterator<LayerImpl> it(root_layer_for_testing_);
107 size_t i = 0;
108 for (; it != LayerListIterator<LayerImpl>(nullptr); ++it, ++i) {
109 DCHECK_LT(i, layer_list_.size());
110 DCHECK_EQ(layer_list_[i], *it);
111 }
112 #endif
113
103 if (!LayerListIsEmpty()) { 114 if (!LayerListIsEmpty()) {
104 LayerTreeHostCommon::CallFunctionForEveryLayer( 115 LayerTreeHostCommon::CallFunctionForEveryLayer(
105 this, [](LayerImpl* layer) { layer->ReleaseResources(); }); 116 this, [](LayerImpl* layer) { layer->ReleaseResources(); });
106 } 117 }
107 } 118 }
108 119
109 void LayerTreeImpl::RecreateResources() { 120 void LayerTreeImpl::RecreateResources() {
110 if (!LayerListIsEmpty()) { 121 if (!LayerListIsEmpty()) {
111 LayerTreeHostCommon::CallFunctionForEveryLayer( 122 LayerTreeHostCommon::CallFunctionForEveryLayer(
112 this, [](LayerImpl* layer) { layer->RecreateResources(); }); 123 this, [](LayerImpl* layer) { layer->RecreateResources(); });
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 2108
2098 void LayerTreeImpl::ResetAllChangeTracking() { 2109 void LayerTreeImpl::ResetAllChangeTracking() {
2099 layers_that_should_push_properties_.clear(); 2110 layers_that_should_push_properties_.clear();
2100 // Iterate over all layers, including masks and replicas. 2111 // Iterate over all layers, including masks and replicas.
2101 for (auto& layer : *layers_) 2112 for (auto& layer : *layers_)
2102 layer->ResetChangeTracking(); 2113 layer->ResetChangeTracking();
2103 property_trees_.ResetAllChangeTracking(); 2114 property_trees_.ResetAllChangeTracking();
2104 } 2115 }
2105 2116
2106 } // namespace cc 2117 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698