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

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

Issue 2468023002: Don't free non-tile resources on GPU rasterization toggle (Closed)
Patch Set: fix unittest Created 4 years, 1 month 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_impl.h ('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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DCHECK_EQ(layer_list_[i], *it); 117 DCHECK_EQ(layer_list_[i], *it);
118 } 118 }
119 #endif 119 #endif
120 120
121 if (!LayerListIsEmpty()) { 121 if (!LayerListIsEmpty()) {
122 LayerTreeHostCommon::CallFunctionForEveryLayer( 122 LayerTreeHostCommon::CallFunctionForEveryLayer(
123 this, [](LayerImpl* layer) { layer->ReleaseResources(); }); 123 this, [](LayerImpl* layer) { layer->ReleaseResources(); });
124 } 124 }
125 } 125 }
126 126
127 void LayerTreeImpl::RecreateResources() { 127 void LayerTreeImpl::ReleaseTileResources() {
128 if (!LayerListIsEmpty()) { 128 if (!LayerListIsEmpty()) {
129 LayerTreeHostCommon::CallFunctionForEveryLayer( 129 LayerTreeHostCommon::CallFunctionForEveryLayer(
130 this, [](LayerImpl* layer) { layer->RecreateResources(); }); 130 this, [](LayerImpl* layer) { layer->ReleaseTileResources(); });
131 } 131 }
132 } 132 }
133 133
134 void LayerTreeImpl::RecreateTileResources() {
135 if (!LayerListIsEmpty()) {
136 LayerTreeHostCommon::CallFunctionForEveryLayer(
137 this, [](LayerImpl* layer) { layer->RecreateTileResources(); });
138 }
139 }
140
134 bool LayerTreeImpl::IsViewportLayerId(int id) const { 141 bool LayerTreeImpl::IsViewportLayerId(int id) const {
135 if (id == inner_viewport_scroll_layer_id_ || 142 if (id == inner_viewport_scroll_layer_id_ ||
136 id == outer_viewport_scroll_layer_id_) 143 id == outer_viewport_scroll_layer_id_)
137 return true; 144 return true;
138 if (InnerViewportContainerLayer() && 145 if (InnerViewportContainerLayer() &&
139 id == InnerViewportContainerLayer()->id()) 146 id == InnerViewportContainerLayer()->id())
140 return true; 147 return true;
141 if (OuterViewportContainerLayer() && 148 if (OuterViewportContainerLayer() &&
142 id == OuterViewportContainerLayer()->id()) 149 id == OuterViewportContainerLayer()->id())
143 return true; 150 return true;
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 2074
2068 void LayerTreeImpl::ResetAllChangeTracking() { 2075 void LayerTreeImpl::ResetAllChangeTracking() {
2069 layers_that_should_push_properties_.clear(); 2076 layers_that_should_push_properties_.clear();
2070 // Iterate over all layers, including masks. 2077 // Iterate over all layers, including masks.
2071 for (auto& layer : *layers_) 2078 for (auto& layer : *layers_)
2072 layer->ResetChangeTracking(); 2079 layer->ResetChangeTracking();
2073 property_trees_.ResetAllChangeTracking(); 2080 property_trees_.ResetAllChangeTracking();
2074 } 2081 }
2075 2082
2076 } // namespace cc 2083 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698