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