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

Side by Side Diff: cc/test/fake_picture_layer_impl.h

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/layers/texture_layer_impl_unittest.cc ('k') | cc/test/fake_picture_layer_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 // Add the given tiling as a "used" tiling during AppendQuads. This ensures 134 // Add the given tiling as a "used" tiling during AppendQuads. This ensures
135 // that future calls to UpdateTiles don't delete the tiling. 135 // that future calls to UpdateTiles don't delete the tiling.
136 void MarkAllTilingsUsed() { 136 void MarkAllTilingsUsed() {
137 last_append_quads_tilings_.clear(); 137 last_append_quads_tilings_.clear();
138 for (size_t i = 0; i < tilings_->num_tilings(); ++i) 138 for (size_t i = 0; i < tilings_->num_tilings(); ++i)
139 last_append_quads_tilings_.push_back(tilings_->tiling_at(i)); 139 last_append_quads_tilings_.push_back(tilings_->tiling_at(i));
140 } 140 }
141 141
142 size_t release_resources_count() const { return release_resources_count_; } 142 size_t release_resources_count() const { return release_resources_count_; }
143 void reset_release_resources_count() { release_resources_count_ = 0; } 143 size_t release_tile_resources_count() const {
144 return release_tile_resources_count_;
145 }
144 146
145 void ReleaseResources() override; 147 void ReleaseResources() override;
148 void ReleaseTileResources() override;
146 149
147 bool only_used_low_res_last_append_quads() const { 150 bool only_used_low_res_last_append_quads() const {
148 return only_used_low_res_last_append_quads_; 151 return only_used_low_res_last_append_quads_;
149 } 152 }
150 153
151 protected: 154 protected:
152 FakePictureLayerImpl(LayerTreeImpl* tree_impl, 155 FakePictureLayerImpl(LayerTreeImpl* tree_impl,
153 int id, 156 int id,
154 scoped_refptr<RasterSource> raster_source, 157 scoped_refptr<RasterSource> raster_source,
155 bool is_mask); 158 bool is_mask);
156 FakePictureLayerImpl(LayerTreeImpl* tree_impl, 159 FakePictureLayerImpl(LayerTreeImpl* tree_impl,
157 int id, 160 int id,
158 scoped_refptr<RasterSource> raster_source, 161 scoped_refptr<RasterSource> raster_source,
159 bool is_mask, 162 bool is_mask,
160 const gfx::Size& layer_bounds); 163 const gfx::Size& layer_bounds);
161 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); 164 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask);
162 165
163 private: 166 private:
164 gfx::Size fixed_tile_size_; 167 gfx::Size fixed_tile_size_;
165 168
166 size_t append_quads_count_; 169 size_t append_quads_count_ = 0;
167 size_t did_become_active_call_count_; 170 size_t did_become_active_call_count_ = 0;
168 bool has_valid_tile_priorities_; 171 bool has_valid_tile_priorities_ = false;
169 bool use_set_valid_tile_priorities_flag_; 172 bool use_set_valid_tile_priorities_flag_ = false;
170 size_t release_resources_count_; 173 size_t release_resources_count_ = 0;
174 size_t release_tile_resources_count_ = 0;
171 }; 175 };
172 176
173 } // namespace cc 177 } // namespace cc
174 178
175 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 179 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl_unittest.cc ('k') | cc/test/fake_picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698