Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 2112973003: cc: Add verify transform tree calculations to LayerTreeSettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "TODO" Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/draw_property_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace cc { 43 namespace cc {
44 namespace { 44 namespace {
45 45
46 class TileManagerTilePriorityQueueTest : public TestLayerTreeHostBase { 46 class TileManagerTilePriorityQueueTest : public TestLayerTreeHostBase {
47 public: 47 public:
48 LayerTreeSettings CreateSettings() override { 48 LayerTreeSettings CreateSettings() override {
49 LayerTreeSettings settings; 49 LayerTreeSettings settings;
50 settings.create_low_res_tiling = true; 50 settings.create_low_res_tiling = true;
51 settings.verify_clip_tree_calculations = true; 51 settings.verify_clip_tree_calculations = true;
52 settings.verify_transform_tree_calculations = true;
52 return settings; 53 return settings;
53 } 54 }
54 55
55 TileManager* tile_manager() { return host_impl()->tile_manager(); } 56 TileManager* tile_manager() { return host_impl()->tile_manager(); }
56 }; 57 };
57 58
58 TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) { 59 TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
59 const gfx::Size layer_bounds(1000, 1000); 60 const gfx::Size layer_bounds(1000, 1000);
60 host_impl()->SetViewportSize(layer_bounds); 61 host_impl()->SetViewportSize(layer_bounds);
61 SetupDefaultTrees(layer_bounds); 62 SetupDefaultTrees(layer_bounds);
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 gfx::Rect viewport(50, 50, 500, 500); 1081 gfx::Rect viewport(50, 50, 500, 500);
1081 gfx::Size layer_bounds(1600, 1600); 1082 gfx::Size layer_bounds(1600, 1600);
1082 1083
1083 const int soon_border_outset = 312; 1084 const int soon_border_outset = 312;
1084 gfx::Rect soon_rect = viewport; 1085 gfx::Rect soon_rect = viewport;
1085 soon_rect.Inset(-soon_border_outset, -soon_border_outset); 1086 soon_rect.Inset(-soon_border_outset, -soon_border_outset);
1086 1087
1087 client.SetTileSize(gfx::Size(30, 30)); 1088 client.SetTileSize(gfx::Size(30, 30));
1088 LayerTreeSettings settings; 1089 LayerTreeSettings settings;
1089 settings.verify_clip_tree_calculations = true; 1090 settings.verify_clip_tree_calculations = true;
1091 settings.verify_transform_tree_calculations = true;
1090 1092
1091 std::unique_ptr<PictureLayerTilingSet> tiling_set = 1093 std::unique_ptr<PictureLayerTilingSet> tiling_set =
1092 PictureLayerTilingSet::Create( 1094 PictureLayerTilingSet::Create(
1093 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, 1095 ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
1094 settings.skewport_target_time_in_seconds, 1096 settings.skewport_target_time_in_seconds,
1095 settings.skewport_extrapolation_limit_in_screen_pixels); 1097 settings.skewport_extrapolation_limit_in_screen_pixels);
1096 1098
1097 scoped_refptr<FakeRasterSource> raster_source = 1099 scoped_refptr<FakeRasterSource> raster_source =
1098 FakeRasterSource::CreateFilled(layer_bounds); 1100 FakeRasterSource::CreateFilled(layer_bounds);
1099 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); 1101 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 RasterTilePriorityQueueMovingViewport) { 1193 RasterTilePriorityQueueMovingViewport) {
1192 FakePictureLayerTilingClient client; 1194 FakePictureLayerTilingClient client;
1193 1195
1194 gfx::Rect viewport(50, 0, 100, 100); 1196 gfx::Rect viewport(50, 0, 100, 100);
1195 gfx::Rect moved_viewport(50, 0, 100, 500); 1197 gfx::Rect moved_viewport(50, 0, 100, 500);
1196 gfx::Size layer_bounds(1000, 1000); 1198 gfx::Size layer_bounds(1000, 1000);
1197 1199
1198 client.SetTileSize(gfx::Size(30, 30)); 1200 client.SetTileSize(gfx::Size(30, 30));
1199 LayerTreeSettings settings; 1201 LayerTreeSettings settings;
1200 settings.verify_clip_tree_calculations = true; 1202 settings.verify_clip_tree_calculations = true;
1203 settings.verify_transform_tree_calculations = true;
1201 1204
1202 std::unique_ptr<PictureLayerTilingSet> tiling_set = 1205 std::unique_ptr<PictureLayerTilingSet> tiling_set =
1203 PictureLayerTilingSet::Create( 1206 PictureLayerTilingSet::Create(
1204 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, 1207 ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
1205 settings.skewport_target_time_in_seconds, 1208 settings.skewport_target_time_in_seconds,
1206 settings.skewport_extrapolation_limit_in_screen_pixels); 1209 settings.skewport_extrapolation_limit_in_screen_pixels);
1207 1210
1208 scoped_refptr<FakeRasterSource> raster_source = 1211 scoped_refptr<FakeRasterSource> raster_source =
1209 FakeRasterSource::CreateFilled(layer_bounds); 1212 FakeRasterSource::CreateFilled(layer_bounds);
1210 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source); 1213 PictureLayerTiling* tiling = tiling_set->AddTiling(1.0f, raster_source);
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 } 1884 }
1882 1885
1883 // Ensures that the tile manager does not attempt to reuse tiles when partial 1886 // Ensures that the tile manager does not attempt to reuse tiles when partial
1884 // raster is disabled. 1887 // raster is disabled.
1885 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1888 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1886 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); 1889 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */);
1887 } 1890 }
1888 1891
1889 } // namespace 1892 } // namespace
1890 } // namespace cc 1893 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/draw_property_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698