diff options
author | Jared Duke <jdduke@chromium.org> | 2015-06-26 09:19:40 -0700 |
---|---|---|
committer | Jared Duke <jdduke@chromium.org> | 2015-06-26 16:20:59 +0000 |
commit | 001e16a3d98c23777eed467cf40f4abb8f93ac1a (patch) | |
tree | 82b1babe7c2b79268287ce30d51f18284e6ff4f7 | |
parent | 300a99c98503a37d3c97507ef570fce7aa8ba976 (diff) | |
download | chromium_src-001e16a3d98c23777eed467cf40f4abb8f93ac1a.zip chromium_src-001e16a3d98c23777eed467cf40f4abb8f93ac1a.tar.gz chromium_src-001e16a3d98c23777eed467cf40f4abb8f93ac1a.tar.bz2 |
Revert "cc: Make tiling interest rect calc based on viewport."
This reverts commit 6d84db54a27c036d77b0e4a26d42c158ee4a6add.
Reason for revert:
This creates perf regression with top-controls and viewport resizes on
Android (creates and deletes extra tiles).
TBR=vmpstr@chromium.org
BUG=502432
Review URL: https://codereview.chromium.org/1217513002.
Cr-Commit-Position: refs/branch-heads/2403@{#407}
Cr-Branched-From: f54b8097a9c45ed4ad308133d49f05325d6c5070-refs/heads/master@{#330231}
22 files changed, 99 insertions, 49 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc index c30ab2f..ae42482 100644 --- a/cc/base/switches.cc +++ b/cc/base/switches.cc @@ -35,6 +35,9 @@ const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; // complete, such as --slow-down-raster-scale-factor=25. const char kSlowDownRasterScaleFactor[] = "slow-down-raster-scale-factor"; +// Max tiles allowed for each tilings interest area. +const char kMaxTilesForInterestArea[] = "max-tiles-for-interest-area"; + // The amount of unused resource memory compositor is allowed to keep around. const char kMaxUnusedResourceMemoryUsagePercentage[] = "max-unused-resource-memory-usage-percentage"; diff --git a/cc/base/switches.h b/cc/base/switches.h index 915d8e2..46fe922 100644 --- a/cc/base/switches.h +++ b/cc/base/switches.h @@ -25,6 +25,7 @@ CC_EXPORT extern const char kTopControlsHideThreshold[]; CC_EXPORT extern const char kTopControlsShowThreshold[]; CC_EXPORT extern const char kSlowDownRasterScaleFactor[]; CC_EXPORT extern const char kCompositeToMailbox[]; +CC_EXPORT extern const char kMaxTilesForInterestArea[]; CC_EXPORT extern const char kMaxUnusedResourceMemoryUsagePercentage[]; CC_EXPORT extern const char kEnablePinchVirtualViewport[]; CC_EXPORT extern const char kDisablePinchVirtualViewport[]; diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc index 22ae8da..1f9a36b8 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.cc +++ b/cc/debug/rasterize_and_record_benchmark_impl.cc @@ -170,8 +170,7 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) { // really matter. const LayerTreeSettings& settings = layer->layer_tree_impl()->settings(); scoped_ptr<PictureLayerTilingSet> tiling_set = PictureLayerTilingSet::Create( - layer->GetTree(), &client, - settings.tiling_interest_area_viewport_multiplier, + layer->GetTree(), &client, settings.max_tiles_for_interest_area, settings.skewport_target_time_in_seconds, settings.skewport_extrapolation_limit_in_content_pixels); diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 1101440..f9f6d97 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -1147,7 +1147,7 @@ scoped_ptr<PictureLayerTilingSet> PictureLayerImpl::CreatePictureLayerTilingSet() { const LayerTreeSettings& settings = layer_tree_impl()->settings(); return PictureLayerTilingSet::Create( - GetTree(), this, settings.tiling_interest_area_viewport_multiplier, + GetTree(), this, settings.max_tiles_for_interest_area, layer_tree_impl()->use_gpu_rasterization() ? settings.gpu_rasterization_skewport_target_time_in_seconds : settings.skewport_target_time_in_seconds, diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc index 7c3bbbb..adb0597 100644 --- a/cc/layers/picture_layer_impl_perftest.cc +++ b/cc/layers/picture_layer_impl_perftest.cc @@ -41,7 +41,7 @@ class PictureLayerImplPerfTest : public testing::Test { public: PictureLayerImplPerfTest() : proxy_(base::ThreadTaskRunnerHandle::Get()), - host_impl_(ImplSidePaintingSettings(10000), + host_impl_(ImplSidePaintingSettings(), &proxy_, &shared_bitmap_manager_, &task_graph_runner_), diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 2bf3696..cc89133 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -2558,8 +2558,8 @@ TEST_F(PictureLayerImplTest, RequiredTilesWithGpuRasterization) { active_layer_->HighResTiling()->UpdateAllRequiredStateForTesting(); - // High res tiling should have 36 tiles (3X12 tile grid). - EXPECT_EQ(36u, active_layer_->HighResTiling()->AllTilesForTesting().size()); + // High res tiling should have 64 tiles (4x16 tile grid). + EXPECT_EQ(64u, active_layer_->HighResTiling()->AllTilesForTesting().size()); // Visible viewport should be covered by 4 tiles. No other // tiles should be required for activation. diff --git a/cc/test/impl_side_painting_settings.h b/cc/test/impl_side_painting_settings.h index ede84db..1ea7e78 100644 --- a/cc/test/impl_side_painting_settings.h +++ b/cc/test/impl_side_painting_settings.h @@ -15,9 +15,9 @@ class ImplSidePaintingSettings : public LayerTreeSettings { impl_side_painting = true; } - explicit ImplSidePaintingSettings(float viewport_multiplier) { + explicit ImplSidePaintingSettings(int interest_rect_tiles) { impl_side_painting = true; - tiling_interest_area_viewport_multiplier = viewport_multiplier; + max_tiles_for_interest_area = interest_rect_tiles; } }; diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc index 58b048b..c585e55 100644 --- a/cc/tiles/picture_layer_tiling.cc +++ b/cc/tiles/picture_layer_tiling.cc @@ -35,12 +35,12 @@ scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( float contents_scale, scoped_refptr<RasterSource> raster_source, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels) { return make_scoped_ptr(new PictureLayerTiling( - tree, contents_scale, raster_source, client, - tiling_interest_area_viewport_multiplier, skewport_target_time_in_seconds, + tree, contents_scale, raster_source, client, max_tiles_for_interest_area, + skewport_target_time_in_seconds, skewport_extrapolation_limit_in_content_pixels)); } @@ -49,11 +49,10 @@ PictureLayerTiling::PictureLayerTiling( float contents_scale, scoped_refptr<RasterSource> raster_source, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels) - : tiling_interest_area_viewport_multiplier_( - tiling_interest_area_viewport_multiplier), + : max_tiles_for_interest_area_(max_tiles_for_interest_area), skewport_target_time_in_seconds_(skewport_target_time_in_seconds), skewport_extrapolation_limit_in_content_pixels_( skewport_extrapolation_limit_in_content_pixels), @@ -573,6 +572,7 @@ bool PictureLayerTiling::ComputeTilePriorityRects( DCHECK_NE(current_frame_time_in_seconds, 0.0); return false; } + gfx::Rect visible_rect_in_content_space = gfx::ScaleToEnclosingRect(viewport_in_layer_space, contents_scale_); @@ -589,9 +589,9 @@ bool PictureLayerTiling::ComputeTilePriorityRects( DCHECK(skewport.Contains(visible_rect_in_content_space)); // Calculate the eventually/live tiles rect. - int64 eventually_rect_area = tiling_interest_area_viewport_multiplier_ * - visible_rect_in_content_space.width() * - visible_rect_in_content_space.height(); + gfx::Size tile_size = tiling_data_.max_texture_size(); + int64 eventually_rect_area = + max_tiles_for_interest_area_ * tile_size.width() * tile_size.height(); gfx::Rect eventually_rect = ExpandRectEquallyToAreaBoundedBy(visible_rect_in_content_space, diff --git a/cc/tiles/picture_layer_tiling.h b/cc/tiles/picture_layer_tiling.h index 8af4c4c..33a8187 100644 --- a/cc/tiles/picture_layer_tiling.h +++ b/cc/tiles/picture_layer_tiling.h @@ -69,7 +69,7 @@ class CC_EXPORT PictureLayerTiling { float contents_scale, scoped_refptr<RasterSource> raster_source, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels); @@ -237,7 +237,7 @@ class CC_EXPORT PictureLayerTiling { float contents_scale, scoped_refptr<RasterSource> raster_source, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels); void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); @@ -324,7 +324,7 @@ class CC_EXPORT PictureLayerTiling { } void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles); - const float tiling_interest_area_viewport_multiplier_; + const size_t max_tiles_for_interest_area_; const float skewport_target_time_in_seconds_; const int skewport_extrapolation_limit_in_content_pixels_; diff --git a/cc/tiles/picture_layer_tiling_perftest.cc b/cc/tiles/picture_layer_tiling_perftest.cc index 3567ecb..0aae512 100644 --- a/cc/tiles/picture_layer_tiling_perftest.cc +++ b/cc/tiles/picture_layer_tiling_perftest.cc @@ -52,7 +52,7 @@ class PictureLayerTilingPerfTest : public testing::Test { gfx::Size(256 * 50, 256 * 50)); picture_layer_tiling_ = PictureLayerTiling::Create( PENDING_TREE, 1.f, pile, &picture_layer_tiling_client_, - defaults.tiling_interest_area_viewport_multiplier, + defaults.max_tiles_for_interest_area, defaults.skewport_target_time_in_seconds, defaults.skewport_extrapolation_limit_in_content_pixels); picture_layer_tiling_->CreateAllTilesForTesting(); diff --git a/cc/tiles/picture_layer_tiling_set.cc b/cc/tiles/picture_layer_tiling_set.cc index 1831539..b794b13 100644 --- a/cc/tiles/picture_layer_tiling_set.cc +++ b/cc/tiles/picture_layer_tiling_set.cc @@ -33,11 +33,11 @@ inline float LargerRatio(float float1, float float2) { scoped_ptr<PictureLayerTilingSet> PictureLayerTilingSet::Create( WhichTree tree, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels) { return make_scoped_ptr(new PictureLayerTilingSet( - tree, client, tiling_interest_area_viewport_multiplier, + tree, client, max_tiles_for_interest_area, skewport_target_time_in_seconds, skewport_extrapolation_limit_in_content_pixels)); } @@ -45,11 +45,10 @@ scoped_ptr<PictureLayerTilingSet> PictureLayerTilingSet::Create( PictureLayerTilingSet::PictureLayerTilingSet( WhichTree tree, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels) - : tiling_interest_area_viewport_multiplier_( - tiling_interest_area_viewport_multiplier), + : max_tiles_for_interest_area_(max_tiles_for_interest_area), skewport_target_time_in_seconds_(skewport_target_time_in_seconds), skewport_extrapolation_limit_in_content_pixels_( skewport_extrapolation_limit_in_content_pixels), @@ -79,8 +78,7 @@ void PictureLayerTilingSet::CopyTilingsAndPropertiesFromPendingTwin( if (!this_tiling) { scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create( tree_, contents_scale, raster_source, client_, - tiling_interest_area_viewport_multiplier_, - skewport_target_time_in_seconds_, + max_tiles_for_interest_area_, skewport_target_time_in_seconds_, skewport_extrapolation_limit_in_content_pixels_); tilings_.push_back(new_tiling.Pass()); this_tiling = tilings_.back(); @@ -265,8 +263,7 @@ PictureLayerTiling* PictureLayerTilingSet::AddTiling( tilings_.push_back(PictureLayerTiling::Create( tree_, contents_scale, raster_source, client_, - tiling_interest_area_viewport_multiplier_, - skewport_target_time_in_seconds_, + max_tiles_for_interest_area_, skewport_target_time_in_seconds_, skewport_extrapolation_limit_in_content_pixels_)); PictureLayerTiling* appended = tilings_.back(); diff --git a/cc/tiles/picture_layer_tiling_set.h b/cc/tiles/picture_layer_tiling_set.h index d1367f8..2347d53 100644 --- a/cc/tiles/picture_layer_tiling_set.h +++ b/cc/tiles/picture_layer_tiling_set.h @@ -40,7 +40,7 @@ class CC_EXPORT PictureLayerTilingSet { static scoped_ptr<PictureLayerTilingSet> Create( WhichTree tree, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content); @@ -176,7 +176,7 @@ class CC_EXPORT PictureLayerTilingSet { explicit PictureLayerTilingSet( WhichTree tree, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time_in_seconds, int skewport_extrapolation_limit_in_content_pixels); @@ -191,7 +191,7 @@ class CC_EXPORT PictureLayerTilingSet { ScopedPtrVector<PictureLayerTiling> tilings_; - const float tiling_interest_area_viewport_multiplier_; + const size_t max_tiles_for_interest_area_; const float skewport_target_time_in_seconds_; const int skewport_extrapolation_limit_in_content_pixels_; WhichTree tree_; diff --git a/cc/tiles/picture_layer_tiling_set_unittest.cc b/cc/tiles/picture_layer_tiling_set_unittest.cc index 2d0a1b2..c04870e 100644 --- a/cc/tiles/picture_layer_tiling_set_unittest.cc +++ b/cc/tiles/picture_layer_tiling_set_unittest.cc @@ -23,7 +23,7 @@ scoped_ptr<PictureLayerTilingSet> CreateTilingSet( PictureLayerTilingClient* client) { LayerTreeSettings defaults; return PictureLayerTilingSet::Create( - ACTIVE_TREE, client, defaults.tiling_interest_area_viewport_multiplier, + ACTIVE_TREE, client, defaults.max_tiles_for_interest_area, defaults.skewport_target_time_in_seconds, defaults.skewport_extrapolation_limit_in_content_pixels); } diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc index 31caf46..e19f930 100644 --- a/cc/tiles/picture_layer_tiling_unittest.cc +++ b/cc/tiles/picture_layer_tiling_unittest.cc @@ -48,7 +48,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { const LayerTreeSettings& settings) { return make_scoped_ptr(new TestablePictureLayerTiling( tree, contents_scale, raster_source, client, - settings.tiling_interest_area_viewport_multiplier, + settings.max_tiles_for_interest_area, settings.skewport_target_time_in_seconds, settings.skewport_extrapolation_limit_in_content_pixels)); } @@ -63,14 +63,14 @@ class TestablePictureLayerTiling : public PictureLayerTiling { float contents_scale, scoped_refptr<RasterSource> raster_source, PictureLayerTilingClient* client, - float tiling_interest_area_viewport_multiplier, + size_t max_tiles_for_interest_area, float skewport_target_time, int skewport_extrapolation_limit) : PictureLayerTiling(tree, contents_scale, raster_source, client, - tiling_interest_area_viewport_multiplier, + max_tiles_for_interest_area, skewport_target_time, skewport_extrapolation_limit) {} }; @@ -549,6 +549,7 @@ TEST(PictureLayerTilingTest, SkewportLimits) { client.SetTileSize(gfx::Size(100, 100)); LayerTreeSettings settings; + settings.max_tiles_for_interest_area = 10000; settings.skewport_extrapolation_limit_in_content_pixels = 75; scoped_refptr<FakePicturePileImpl> pile = @@ -791,7 +792,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { client.SetTileSize(gfx::Size(10, 10)); LayerTreeSettings settings; - settings.tiling_interest_area_viewport_multiplier = 10000; + settings.max_tiles_for_interest_area = 10000; // Tiling at 0.25 scale: this should create 47x47 tiles of size 10x10. // The reason is that each tile has a one pixel border, so tile at (1, 2) @@ -1291,7 +1292,7 @@ TEST_F(PictureLayerTilingIteratorTest, gfx::Size layer_bounds(10000, 10000); client_.SetTileSize(gfx::Size(100, 100)); LayerTreeSettings settings; - settings.tiling_interest_area_viewport_multiplier = 1; + settings.max_tiles_for_interest_area = 1; scoped_refptr<FakePicturePileImpl> pile = FakePicturePileImpl::CreateFilledPileWithDefaultTileSize(layer_bounds); @@ -1748,7 +1749,7 @@ TEST(ComputeTilePriorityRectsTest, BasicMotion) { client.SetTileSize(gfx::Size(100, 100)); LayerTreeSettings settings; - settings.tiling_interest_area_viewport_multiplier = 10000; + settings.max_tiles_for_interest_area = 10000; scoped_refptr<FakePicturePileImpl> pile = FakePicturePileImpl::CreateFilledPileWithDefaultTileSize( @@ -1878,6 +1879,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) { active_client.SetTileSize(gfx::Size(100, 100)); LayerTreeSettings settings; + settings.max_tiles_for_interest_area = 10; scoped_refptr<FakePicturePileImpl> pile = FakePicturePileImpl::CreateFilledPileWithDefaultTileSize( @@ -1945,6 +1947,7 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) { recycle_client.set_twin_tiling(active_tiling.get()); LayerTreeSettings settings; + settings.max_tiles_for_interest_area = 10; pile = FakePicturePileImpl::CreateFilledPileWithDefaultTileSize( gfx::Size(100, 100)); diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 5c7e3c1..bddf29f 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc @@ -30,10 +30,7 @@ namespace { class LowResTilingsSettings : public ImplSidePaintingSettings { public: - LowResTilingsSettings() { - tiling_interest_area_viewport_multiplier = 10000; - create_low_res_tiling = true; - } + LowResTilingsSettings() { create_low_res_tiling = true; } }; class TileManagerTilePriorityQueueTest : public testing::Test { @@ -1180,10 +1177,10 @@ TEST_F(TileManagerTilePriorityQueueTest, client.SetTileSize(gfx::Size(30, 30)); LayerTreeSettings settings; - settings.tiling_interest_area_viewport_multiplier = 10000; + settings.max_tiles_for_interest_area = 10000; scoped_ptr<PictureLayerTilingSet> tiling_set = PictureLayerTilingSet::Create( - ACTIVE_TREE, &client, settings.tiling_interest_area_viewport_multiplier, + ACTIVE_TREE, &client, settings.max_tiles_for_interest_area, settings.skewport_target_time_in_seconds, settings.skewport_extrapolation_limit_in_content_pixels); @@ -1290,9 +1287,10 @@ TEST_F(TileManagerTilePriorityQueueTest, client.SetTileSize(gfx::Size(30, 30)); LayerTreeSettings settings; + settings.max_tiles_for_interest_area = 10000; scoped_ptr<PictureLayerTilingSet> tiling_set = PictureLayerTilingSet::Create( - ACTIVE_TREE, &client, settings.tiling_interest_area_viewport_multiplier, + ACTIVE_TREE, &client, settings.max_tiles_for_interest_area, settings.skewport_target_time_in_seconds, settings.skewport_extrapolation_limit_in_content_pixels); diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index d2c3bda..f7f6f30 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -52,7 +52,8 @@ LayerTreeSettings::LayerTreeSettings() default_tile_grid_size(gfx::Size(256, 256)), minimum_occlusion_tracking_size(gfx::Size(160, 160)), use_pinch_virtual_viewport(false), - tiling_interest_area_viewport_multiplier(9.0f), + // At 256x256 tiles, 128 tiles cover an area of 2048x4096 pixels. + max_tiles_for_interest_area(128), skewport_target_time_in_seconds(1.0f), skewport_extrapolation_limit_in_content_pixels(2000), max_unused_resource_memory_percentage(100), diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 0e1819b..56cfa3a 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -65,7 +65,7 @@ class CC_EXPORT LayerTreeSettings { gfx::Size default_tile_grid_size; gfx::Size minimum_occlusion_tracking_size; bool use_pinch_virtual_viewport; - float tiling_interest_area_viewport_multiplier; + size_t max_tiles_for_interest_area; float skewport_target_time_in_seconds; int skewport_extrapolation_limit_in_content_pixels; size_t max_unused_resource_memory_percentage; diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index f4bfef8..8fb481c 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6540,6 +6540,24 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ZERO_COPY_DESCRIPTION" desc="Description of about:flags option for zero-copy rasterizer."> If enabled, raster threads write directly to GPU memory associated with tiles. </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME" desc="Name of about:flags option for maximum tiles for interest area."> + Maximum tiles for interest area + </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION" desc="Description of about:flags option for maximum tiles for interest area."> + Specify the maximum tiles for interest area. + </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT" desc=""> + 64 + </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL" desc=""> + 128 + </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE" desc=""> + 256 + </message> + <message name="IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI" desc=""> + 512 + </message> <message name="IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME" desc=""> Tab capture upscaling quality. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index b90ed85..6f42c9c 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -215,6 +215,18 @@ const Experiment::Choice kMarkNonSecureAsChoices[] = { switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious} }; +const Experiment::Choice kMaxTilesForInterestAreaChoices[] = { + { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, + { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT, + cc::switches::kMaxTilesForInterestArea, "64"}, + { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL, + cc::switches::kMaxTilesForInterestArea, "128"}, + { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE, + cc::switches::kMaxTilesForInterestArea, "256"}, + { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI, + cc::switches::kMaxTilesForInterestArea, "512"} +}; + const Experiment::Choice kShowSavedCopyChoices[] = { { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, { IDS_FLAGS_ENABLE_SHOW_SAVED_COPY_PRIMARY, @@ -1294,6 +1306,13 @@ const Experiment kExperiments[] = { }, #endif { + "max-tiles-for-interest-area", + IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME, + IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION, + kOsAll, + MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices) + }, + { "enable-offer-store-unmasked-wallet-cards", IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS, IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION, diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 3ef1d9c..9108984 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -190,6 +190,7 @@ std::string DeriveCommandLine(const GURL& start_url, cc::switches::kEnablePinchVirtualViewport, cc::switches::kEnablePropertyTreeVerification, cc::switches::kEnableMainFrameBeforeActivation, + cc::switches::kMaxTilesForInterestArea, cc::switches::kMaxUnusedResourceMemoryUsagePercentage, cc::switches::kShowCompositedLayerBorders, cc::switches::kShowFPSCounter, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index f0f1996..00f3414 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1333,6 +1333,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( cc::switches::kDisableThreadedAnimation, cc::switches::kEnableGpuBenchmarking, cc::switches::kEnableMainFrameBeforeActivation, + cc::switches::kMaxTilesForInterestArea, cc::switches::kMaxUnusedResourceMemoryUsagePercentage, cc::switches::kShowCompositedLayerBorders, cc::switches::kShowFPSCounter, diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index c8400037..8f4cccc6 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -350,6 +350,15 @@ void RenderWidgetCompositor::Initialize() { &settings.initial_debug_state.slow_down_raster_scale_factor); } + if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) { + int max_tiles_for_interest_area; + if (GetSwitchValueAsInt(*cmd, + cc::switches::kMaxTilesForInterestArea, + 1, std::numeric_limits<int>::max(), + &max_tiles_for_interest_area)) + settings.max_tiles_for_interest_area = max_tiles_for_interest_area; + } + if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { int max_unused_resource_memory_percentage; if (GetSwitchValueAsInt( |