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

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

Issue 793573006: Refactoring for merging ManagedTileState into Tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename HasResources to HasResource Created 6 years 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
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 #include "cc/test/fake_picture_layer_impl.h" 5 #include "cc/test/fake_picture_layer_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "cc/resources/tile.h" 8 #include "cc/resources/tile.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void FakePictureLayerImpl::SetAllTilesReadyInTiling( 162 void FakePictureLayerImpl::SetAllTilesReadyInTiling(
163 PictureLayerTiling* tiling) { 163 PictureLayerTiling* tiling) {
164 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); 164 std::vector<Tile*> tiles = tiling->AllTilesForTesting();
165 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) { 165 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) {
166 Tile* tile = tiles[tile_idx]; 166 Tile* tile = tiles[tile_idx];
167 SetTileReady(tile); 167 SetTileReady(tile);
168 } 168 }
169 } 169 }
170 170
171 void FakePictureLayerImpl::SetTileReady(Tile* tile) { 171 void FakePictureLayerImpl::SetTileReady(Tile* tile) {
172 ManagedTileState& state = tile->managed_state(); 172 TileDrawInfo& draw_info = tile->draw_info();
173 state.draw_info.SetSolidColorForTesting(true); 173 draw_info.SetSolidColorForTesting(true);
174 DCHECK(tile->IsReadyToDraw()); 174 DCHECK(tile->IsReadyToDraw());
175 } 175 }
176 176
177 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() { 177 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() {
178 layer_tree_impl()->UpdateDrawProperties(); 178 layer_tree_impl()->UpdateDrawProperties();
179 179
180 if (CanHaveTilings()) { 180 if (CanHaveTilings()) {
181 DCHECK_EQ(tilings()->num_tilings(), 181 DCHECK_EQ(tilings()->num_tilings(),
182 layer_tree_impl()->settings().create_low_res_tiling ? 2u : 1u); 182 layer_tree_impl()->settings().create_low_res_tiling ? 2u : 1u);
183 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION); 183 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return CountTilesRequired( 260 return CountTilesRequired(
261 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); 261 &PictureLayerTiling::IsTileRequiredForDrawIfVisible);
262 } 262 }
263 263
264 void FakePictureLayerImpl::ReleaseResources() { 264 void FakePictureLayerImpl::ReleaseResources() {
265 PictureLayerImpl::ReleaseResources(); 265 PictureLayerImpl::ReleaseResources();
266 ++release_resources_count_; 266 ++release_resources_count_;
267 } 267 }
268 268
269 } // namespace cc 269 } // namespace cc
OLDNEW
« cc/resources/tile.h ('K') | « cc/resources/tiling_set_eviction_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698