| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 for (size_t mode_idx = 0; mode_idx < NUM_RASTER_MODES; ++mode_idx) | 129 for (size_t mode_idx = 0; mode_idx < NUM_RASTER_MODES; ++mode_idx) |
| 130 state.tile_versions[mode_idx].SetSolidColorForTesting(true); | 130 state.tile_versions[mode_idx].SetSolidColorForTesting(true); |
| 131 DCHECK(tile->IsReadyToDraw()); | 131 DCHECK(tile->IsReadyToDraw()); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() { | 135 void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() { |
| 136 layer_tree_impl()->UpdateDrawProperties(); | 136 layer_tree_impl()->UpdateDrawProperties(); |
| 137 | 137 |
| 138 if (CanHaveTilings()) { | 138 if (CanHaveTilings()) { |
| 139 DCHECK_EQ(tilings()->num_tilings(), 2u); | 139 DCHECK_EQ(tilings()->num_tilings(), |
| 140 layer_tree_impl()->settings().create_low_res_tiling ? 2u : 1u); |
| 140 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION); | 141 DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION); |
| 141 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); | |
| 142 HighResTiling()->CreateAllTilesForTesting(); | 142 HighResTiling()->CreateAllTilesForTesting(); |
| 143 LowResTiling()->CreateAllTilesForTesting(); | 143 if (layer_tree_impl()->settings().create_low_res_tiling) { |
| 144 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); |
| 145 LowResTiling()->CreateAllTilesForTesting(); |
| 146 } |
| 144 } else { | 147 } else { |
| 145 DCHECK_EQ(tilings()->num_tilings(), 0u); | 148 DCHECK_EQ(tilings()->num_tilings(), 0u); |
| 146 } | 149 } |
| 147 } | 150 } |
| 148 | 151 |
| 149 } // namespace cc | 152 } // namespace cc |
| OLD | NEW |