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.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 SMOOTHNESS_TAKES_PRIORITY, | 1339 SMOOTHNESS_TAKES_PRIORITY, |
1340 PictureLayerTiling::NOW_AND_REQUIRED_FOR_ACTIVATION); | 1340 PictureLayerTiling::NOW_AND_REQUIRED_FOR_ACTIVATION); |
1341 EXPECT_FALSE(it); | 1341 EXPECT_FALSE(it); |
1342 | 1342 |
1343 EXPECT_GT(all_tiles_set.size(), 0u); | 1343 EXPECT_GT(all_tiles_set.size(), 0u); |
1344 EXPECT_EQ(all_tiles_set, eviction_tiles); | 1344 EXPECT_EQ(all_tiles_set, eviction_tiles); |
1345 | 1345 |
1346 EXPECT_TRUE(tiling->eviction_tiles_cache_valid()); | 1346 EXPECT_TRUE(tiling->eviction_tiles_cache_valid()); |
1347 tiling->RemoveTileAt(0, 0, nullptr); | 1347 tiling->RemoveTileAt(0, 0, nullptr); |
1348 EXPECT_FALSE(tiling->eviction_tiles_cache_valid()); | 1348 EXPECT_FALSE(tiling->eviction_tiles_cache_valid()); |
| 1349 |
| 1350 it = PictureLayerTiling::TilingEvictionTileIterator( |
| 1351 tiling.get(), SMOOTHNESS_TAKES_PRIORITY, |
| 1352 PictureLayerTiling::NOW_AND_REQUIRED_FOR_ACTIVATION); |
| 1353 EXPECT_TRUE(tiling->eviction_tiles_cache_valid()); |
| 1354 tiling->Reset(); |
| 1355 EXPECT_FALSE(tiling->eviction_tiles_cache_valid()); |
1349 } | 1356 } |
1350 | 1357 |
1351 TEST_F(PictureLayerTilingIteratorTest, TilesExist) { | 1358 TEST_F(PictureLayerTilingIteratorTest, TilesExist) { |
1352 gfx::Size layer_bounds(1099, 801); | 1359 gfx::Size layer_bounds(1099, 801); |
1353 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); | 1360 Initialize(gfx::Size(100, 100), 1.f, layer_bounds); |
1354 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); | 1361 VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds)); |
1355 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); | 1362 VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
1356 | 1363 |
1357 client_.set_tree(ACTIVE_TREE); | 1364 client_.set_tree(ACTIVE_TREE); |
1358 tiling_->ComputeTilePriorityRects( | 1365 tiling_->ComputeTilePriorityRects( |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); | 2173 EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
2167 | 2174 |
2168 // Reset the active tiling. The recycle tiles should be released too. | 2175 // Reset the active tiling. The recycle tiles should be released too. |
2169 active_tiling->Reset(); | 2176 active_tiling->Reset(); |
2170 EXPECT_FALSE(active_tiling->TileAt(0, 0)); | 2177 EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
2171 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); | 2178 EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
2172 } | 2179 } |
2173 | 2180 |
2174 } // namespace | 2181 } // namespace |
2175 } // namespace cc | 2182 } // namespace cc |
OLD | NEW |