| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 draw_properties().last_drawn_render_surface_layer_list_id = | 140 draw_properties().last_drawn_render_surface_layer_list_id = |
| 141 is ? layer_tree_impl()->current_render_surface_list_id() | 141 is ? layer_tree_impl()->current_render_surface_list_id() |
| 142 : layer_tree_impl()->current_render_surface_list_id() - 1; | 142 : layer_tree_impl()->current_render_surface_list_id() - 1; |
| 143 } | 143 } |
| 144 | 144 |
| 145 void FakePictureLayerImpl::CreateAllTiles() { | 145 void FakePictureLayerImpl::CreateAllTiles() { |
| 146 for (size_t i = 0; i < num_tilings(); ++i) | 146 for (size_t i = 0; i < num_tilings(); ++i) |
| 147 tilings_->tiling_at(i)->CreateAllTilesForTesting(); | 147 tilings_->tiling_at(i)->CreateAllTilesForTesting(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void FakePictureLayerImpl::SetAllTilesVisible() { | |
| 151 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); | |
| 152 ++tiling_idx) { | |
| 153 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx); | |
| 154 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); | |
| 155 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) { | |
| 156 Tile* tile = tiles[tile_idx]; | |
| 157 TilePriority priority; | |
| 158 priority.resolution = HIGH_RESOLUTION; | |
| 159 priority.priority_bin = TilePriority::NOW; | |
| 160 priority.distance_to_visible = 0.f; | |
| 161 tile->set_priority(priority); | |
| 162 } | |
| 163 } | |
| 164 } | |
| 165 | |
| 166 void FakePictureLayerImpl::ResetAllTilesPriorities() { | |
| 167 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); | |
| 168 ++tiling_idx) { | |
| 169 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx); | |
| 170 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); | |
| 171 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) { | |
| 172 Tile* tile = tiles[tile_idx]; | |
| 173 tile->set_priority(TilePriority()); | |
| 174 } | |
| 175 } | |
| 176 } | |
| 177 | |
| 178 void FakePictureLayerImpl::SetAllTilesReady() { | 150 void FakePictureLayerImpl::SetAllTilesReady() { |
| 179 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); | 151 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); |
| 180 ++tiling_idx) { | 152 ++tiling_idx) { |
| 181 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx); | 153 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx); |
| 182 SetAllTilesReadyInTiling(tiling); | 154 SetAllTilesReadyInTiling(tiling); |
| 183 } | 155 } |
| 184 } | 156 } |
| 185 | 157 |
| 186 void FakePictureLayerImpl::SetAllTilesReadyInTiling( | 158 void FakePictureLayerImpl::SetAllTilesReadyInTiling( |
| 187 PictureLayerTiling* tiling) { | 159 PictureLayerTiling* tiling) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 237 |
| 266 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); | 238 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); |
| 267 } | 239 } |
| 268 | 240 |
| 269 void FakePictureLayerImpl::ReleaseResources() { | 241 void FakePictureLayerImpl::ReleaseResources() { |
| 270 PictureLayerImpl::ReleaseResources(); | 242 PictureLayerImpl::ReleaseResources(); |
| 271 ++release_resources_count_; | 243 ++release_resources_count_; |
| 272 } | 244 } |
| 273 | 245 |
| 274 } // namespace cc | 246 } // namespace cc |
| OLD | NEW |