OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |