| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 | 1090 |
| 1091 client.SetTileSize(gfx::Size(30, 30)); | 1091 client.SetTileSize(gfx::Size(30, 30)); |
| 1092 LayerTreeSettings settings; | 1092 LayerTreeSettings settings; |
| 1093 settings.verify_clip_tree_calculations = true; | 1093 settings.verify_clip_tree_calculations = true; |
| 1094 settings.verify_transform_tree_calculations = true; | 1094 settings.verify_transform_tree_calculations = true; |
| 1095 | 1095 |
| 1096 std::unique_ptr<PictureLayerTilingSet> tiling_set = | 1096 std::unique_ptr<PictureLayerTilingSet> tiling_set = |
| 1097 PictureLayerTilingSet::Create( | 1097 PictureLayerTilingSet::Create( |
| 1098 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, | 1098 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, |
| 1099 settings.skewport_target_time_in_seconds, | 1099 settings.skewport_target_time_in_seconds, |
| 1100 settings.skewport_extrapolation_limit_in_screen_pixels); | 1100 settings.skewport_extrapolation_limit_in_screen_pixels, |
| 1101 settings.max_preraster_distance_in_screen_pixels); |
| 1101 | 1102 |
| 1102 scoped_refptr<FakeRasterSource> raster_source = | 1103 scoped_refptr<FakeRasterSource> raster_source = |
| 1103 FakeRasterSource::CreateFilled(layer_bounds); | 1104 FakeRasterSource::CreateFilled(layer_bounds); |
| 1104 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); | 1105 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); |
| 1105 tiling->set_resolution(HIGH_RESOLUTION); | 1106 tiling->set_resolution(HIGH_RESOLUTION); |
| 1106 | 1107 |
| 1107 tiling_set->UpdateTilePriorities(viewport, 1.0f, 1.0, Occlusion(), true); | 1108 tiling_set->UpdateTilePriorities(viewport, 1.0f, 1.0, Occlusion(), true); |
| 1108 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); | 1109 std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); |
| 1109 // Sanity check. | 1110 // Sanity check. |
| 1110 EXPECT_EQ(3364u, all_tiles.size()); | 1111 EXPECT_EQ(3364u, all_tiles.size()); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 | 1203 |
| 1203 client.SetTileSize(gfx::Size(30, 30)); | 1204 client.SetTileSize(gfx::Size(30, 30)); |
| 1204 LayerTreeSettings settings; | 1205 LayerTreeSettings settings; |
| 1205 settings.verify_clip_tree_calculations = true; | 1206 settings.verify_clip_tree_calculations = true; |
| 1206 settings.verify_transform_tree_calculations = true; | 1207 settings.verify_transform_tree_calculations = true; |
| 1207 | 1208 |
| 1208 std::unique_ptr<PictureLayerTilingSet> tiling_set = | 1209 std::unique_ptr<PictureLayerTilingSet> tiling_set = |
| 1209 PictureLayerTilingSet::Create( | 1210 PictureLayerTilingSet::Create( |
| 1210 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, | 1211 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, |
| 1211 settings.skewport_target_time_in_seconds, | 1212 settings.skewport_target_time_in_seconds, |
| 1212 settings.skewport_extrapolation_limit_in_screen_pixels); | 1213 settings.skewport_extrapolation_limit_in_screen_pixels, |
| 1214 settings.max_preraster_distance_in_screen_pixels); |
| 1213 | 1215 |
| 1214 scoped_refptr<FakeRasterSource> raster_source = | 1216 scoped_refptr<FakeRasterSource> raster_source = |
| 1215 FakeRasterSource::CreateFilled(layer_bounds); | 1217 FakeRasterSource::CreateFilled(layer_bounds); |
| 1216 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); | 1218 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); |
| 1217 tiling->set_resolution(HIGH_RESOLUTION); | 1219 tiling->set_resolution(HIGH_RESOLUTION); |
| 1218 | 1220 |
| 1219 tiling_set->UpdateTilePriorities(viewport, 1.0f, 1.0, Occlusion(), true); | 1221 tiling_set->UpdateTilePriorities(viewport, 1.0f, 1.0, Occlusion(), true); |
| 1220 tiling_set->UpdateTilePriorities(moved_viewport, 1.0f, 2.0, Occlusion(), | 1222 tiling_set->UpdateTilePriorities(moved_viewport, 1.0f, 2.0, Occlusion(), |
| 1221 true); | 1223 true); |
| 1222 | 1224 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 gfx::Size layer_bounds(1, 1); | 1361 gfx::Size layer_bounds(1, 1); |
| 1360 | 1362 |
| 1361 scoped_refptr<FakeRasterSource> raster_source = | 1363 scoped_refptr<FakeRasterSource> raster_source = |
| 1362 FakeRasterSource::CreateFilled(layer_bounds); | 1364 FakeRasterSource::CreateFilled(layer_bounds); |
| 1363 | 1365 |
| 1364 FakePictureLayerTilingClient pending_client; | 1366 FakePictureLayerTilingClient pending_client; |
| 1365 pending_client.SetTileSize(gfx::Size(64, 64)); | 1367 pending_client.SetTileSize(gfx::Size(64, 64)); |
| 1366 | 1368 |
| 1367 std::unique_ptr<PictureLayerTilingSet> tiling_set = | 1369 std::unique_ptr<PictureLayerTilingSet> tiling_set = |
| 1368 PictureLayerTilingSet::Create(WhichTree::ACTIVE_TREE, &pending_client, | 1370 PictureLayerTilingSet::Create(WhichTree::ACTIVE_TREE, &pending_client, |
| 1369 1.0f, 1.0f, 1000); | 1371 1.0f, 1.0f, 1000, 1000.f); |
| 1370 pending_client.set_twin_tiling_set(tiling_set.get()); | 1372 pending_client.set_twin_tiling_set(tiling_set.get()); |
| 1371 | 1373 |
| 1372 auto* tiling = tiling_set->AddTiling(1.0f, raster_source); | 1374 auto* tiling = tiling_set->AddTiling(1.0f, raster_source); |
| 1373 | 1375 |
| 1374 tiling->set_resolution(HIGH_RESOLUTION); | 1376 tiling->set_resolution(HIGH_RESOLUTION); |
| 1375 tiling->CreateAllTilesForTesting(); | 1377 tiling->CreateAllTilesForTesting(); |
| 1376 | 1378 |
| 1377 // The tile is (0, 0, 1, 1), create an intersecting and non-intersecting | 1379 // The tile is (0, 0, 1, 1), create an intersecting and non-intersecting |
| 1378 // rectangle to test the advance phase with. The tile size is (64, 64), so | 1380 // rectangle to test the advance phase with. The tile size is (64, 64), so |
| 1379 // both rectangles intersect the tile content size, but only one should | 1381 // both rectangles intersect the tile content size, but only one should |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 } | 1892 } |
| 1891 | 1893 |
| 1892 // Ensures that the tile manager does not attempt to reuse tiles when partial | 1894 // Ensures that the tile manager does not attempt to reuse tiles when partial |
| 1893 // raster is disabled. | 1895 // raster is disabled. |
| 1894 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { | 1896 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { |
| 1895 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); | 1897 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); |
| 1896 } | 1898 } |
| 1897 | 1899 |
| 1898 } // namespace | 1900 } // namespace |
| 1899 } // namespace cc | 1901 } // namespace cc |
| OLD | NEW |