| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/resources/resource_pool.h" | 10 #include "cc/resources/resource_pool.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 for (size_t i = 0; i < tiles.size(); ++i) { | 228 for (size_t i = 0; i < tiles.size(); ++i) { |
| 229 const Tile* tile = tiles[i]; | 229 const Tile* tile = tiles[i]; |
| 230 ASSERT_TRUE(!!tile); | 230 ASSERT_TRUE(!!tile); |
| 231 EXPECT_EQ(tile->picture_pile(), pile); | 231 EXPECT_EQ(tile->picture_pile(), pile); |
| 232 EXPECT_TRUE(tile->content_rect().Intersects(tiling->live_tiles_rect())) | 232 EXPECT_TRUE(tile->content_rect().Intersects(tiling->live_tiles_rect())) |
| 233 << "All tiles must be inside the live tiles rect." | 233 << "All tiles must be inside the live tiles rect." |
| 234 << " Tile rect: " << tile->content_rect().ToString() | 234 << " Tile rect: " << tile->content_rect().ToString() |
| 235 << " Live rect: " << tiling->live_tiles_rect().ToString() | 235 << " Live rect: " << tiling->live_tiles_rect().ToString() |
| 236 << " Scale: " << tiling->contents_scale(); | 236 << " Scale: " << tiling->contents_scale(); |
| 237 } | 237 } |
| 238 | |
| 239 for (PictureLayerTiling::CoverageIterator iter( | |
| 240 tiling, tiling->contents_scale(), tiling->live_tiles_rect()); | |
| 241 iter; | |
| 242 ++iter) { | |
| 243 EXPECT_TRUE(*iter) << "The live tiles rect must be full."; | |
| 244 } | |
| 245 } | 238 } |
| 246 | 239 |
| 247 gfx::Size tile_size_; | 240 gfx::Size tile_size_; |
| 248 | 241 |
| 249 FakePictureLayerTilingClient source_client_; | 242 FakePictureLayerTilingClient source_client_; |
| 250 gfx::Size source_bounds_; | 243 gfx::Size source_bounds_; |
| 251 scoped_ptr<PictureLayerTilingSet> source_; | 244 scoped_ptr<PictureLayerTilingSet> source_; |
| 252 | 245 |
| 253 FakePictureLayerTilingClient target_client_; | 246 FakePictureLayerTilingClient target_client_; |
| 254 gfx::Size target_bounds_; | 247 gfx::Size target_bounds_; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); | 405 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); |
| 413 for (size_t i = 0; i < original_tiles.size(); ++i) { | 406 for (size_t i = 0; i < original_tiles.size(); ++i) { |
| 414 std::vector<Tile*>::iterator find = | 407 std::vector<Tile*>::iterator find = |
| 415 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); | 408 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); |
| 416 EXPECT_TRUE(find == new_tiles.end()); | 409 EXPECT_TRUE(find == new_tiles.end()); |
| 417 } | 410 } |
| 418 } | 411 } |
| 419 | 412 |
| 420 } // namespace | 413 } // namespace |
| 421 } // namespace cc | 414 } // namespace cc |
| OLD | NEW |