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

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

Issue 2334003003: cc : Compute visible rects dynamically (1) (Closed)
Patch Set: comment Created 4 years, 3 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
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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 gfx::Rect viewport(50, 50, 500, 500); 1084 gfx::Rect viewport(50, 50, 500, 500);
1085 gfx::Size layer_bounds(1600, 1600); 1085 gfx::Size layer_bounds(1600, 1600);
1086 1086
1087 const int soon_border_outset = 312; 1087 const int soon_border_outset = 312;
1088 gfx::Rect soon_rect = viewport; 1088 gfx::Rect soon_rect = viewport;
1089 soon_rect.Inset(-soon_border_outset, -soon_border_outset); 1089 soon_rect.Inset(-soon_border_outset, -soon_border_outset);
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_visible_rect_calculations = true;
1094 settings.verify_transform_tree_calculations = true; 1095 settings.verify_transform_tree_calculations = true;
1095 1096
1096 std::unique_ptr<PictureLayerTilingSet> tiling_set = 1097 std::unique_ptr<PictureLayerTilingSet> tiling_set =
1097 PictureLayerTilingSet::Create( 1098 PictureLayerTilingSet::Create(
1098 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, 1099 ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
1099 settings.skewport_target_time_in_seconds, 1100 settings.skewport_target_time_in_seconds,
1100 settings.skewport_extrapolation_limit_in_screen_pixels, 1101 settings.skewport_extrapolation_limit_in_screen_pixels,
1101 settings.max_preraster_distance_in_screen_pixels); 1102 settings.max_preraster_distance_in_screen_pixels);
1102 1103
1103 scoped_refptr<FakeRasterSource> raster_source = 1104 scoped_refptr<FakeRasterSource> raster_source =
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 RasterTilePriorityQueueMovingViewport) { 1198 RasterTilePriorityQueueMovingViewport) {
1198 FakePictureLayerTilingClient client; 1199 FakePictureLayerTilingClient client;
1199 1200
1200 gfx::Rect viewport(50, 0, 100, 100); 1201 gfx::Rect viewport(50, 0, 100, 100);
1201 gfx::Rect moved_viewport(50, 0, 100, 500); 1202 gfx::Rect moved_viewport(50, 0, 100, 500);
1202 gfx::Size layer_bounds(1000, 1000); 1203 gfx::Size layer_bounds(1000, 1000);
1203 1204
1204 client.SetTileSize(gfx::Size(30, 30)); 1205 client.SetTileSize(gfx::Size(30, 30));
1205 LayerTreeSettings settings; 1206 LayerTreeSettings settings;
1206 settings.verify_clip_tree_calculations = true; 1207 settings.verify_clip_tree_calculations = true;
1208 settings.verify_visible_rect_calculations = true;
1207 settings.verify_transform_tree_calculations = true; 1209 settings.verify_transform_tree_calculations = true;
1208 1210
1209 std::unique_ptr<PictureLayerTilingSet> tiling_set = 1211 std::unique_ptr<PictureLayerTilingSet> tiling_set =
1210 PictureLayerTilingSet::Create( 1212 PictureLayerTilingSet::Create(
1211 ACTIVE_TREE, &client, settings.tiling_interest_area_padding, 1213 ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
1212 settings.skewport_target_time_in_seconds, 1214 settings.skewport_target_time_in_seconds,
1213 settings.skewport_extrapolation_limit_in_screen_pixels, 1215 settings.skewport_extrapolation_limit_in_screen_pixels,
1214 settings.max_preraster_distance_in_screen_pixels); 1216 settings.max_preraster_distance_in_screen_pixels);
1215 1217
1216 scoped_refptr<FakeRasterSource> raster_source = 1218 scoped_refptr<FakeRasterSource> raster_source =
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 } 1894 }
1893 1895
1894 // Ensures that the tile manager does not attempt to reuse tiles when partial 1896 // Ensures that the tile manager does not attempt to reuse tiles when partial
1895 // raster is disabled. 1897 // raster is disabled.
1896 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1898 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1897 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */); 1899 RunPartialRasterCheck(TakeHostImpl(), false /* partial_raster_enabled */);
1898 } 1900 }
1899 1901
1900 } // namespace 1902 } // namespace
1901 } // namespace cc 1903 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698