summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 03:25:38 +0000
committerernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 03:25:38 +0000
commit4f5ed1063581ef27dc0e8b9928829889216568e2 (patch)
tree594555e2ff73ca9d0ac7cc16d0f23ad780d4cb69 /cc
parent873a6c08fd956f2b8166308666d9861995bfe278 (diff)
downloadchromium_src-4f5ed1063581ef27dc0e8b9928829889216568e2.zip
chromium_src-4f5ed1063581ef27dc0e8b9928829889216568e2.tar.gz
chromium_src-4f5ed1063581ef27dc0e8b9928829889216568e2.tar.bz2
cc: revert tile size increase for GPU rasterized layers.
It turned out the larger tiles only helped for some pages, but they regressed performance for others. This patch changes the tile size for GPU rasterized layers back to be identical with CPU rasterized layers. The patch is only a partial revert of https://codereview.chromium.org/112263002/ Some changes were not reverted (including the unittest), because they are still relevant (GPU rasterized layers don't have low-resolution tilings). R=enne@chromium.org BUG=325475 Review URL: https://codereview.chromium.org/141633006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/picture_layer_impl.cc4
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc29
-rw-r--r--cc/trees/layer_tree_settings.cc1
-rw-r--r--cc/trees/layer_tree_settings.h1
4 files changed, 6 insertions, 29 deletions
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index cc9a828..c16b115 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -526,10 +526,6 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
layer_tree_impl()->resource_provider()->max_texture_size();
gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size;
- if (should_use_gpu_rasterization()) {
- default_tile_size =
- layer_tree_impl()->settings().default_tile_size_gpu_rasterization;
- }
default_tile_size.SetToMin(gfx::Size(max_texture_size, max_texture_size));
gfx::Size max_untiled_content_size =
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index e2bbfbe..8c6412d 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -1400,45 +1400,28 @@ TEST_F(PictureLayerImplTest, SyncTilingAfterReleaseResource) {
EXPECT_TRUE(active_layer_->tilings()->TilingAtScale(tile_scale));
}
-TEST_F(PictureLayerImplTest, TileSizeForGpuRasterization) {
- gfx::Size default_tile_size_gpu(
- host_impl_.settings().default_tile_size_gpu_rasterization);
- gfx::Size layer_bounds(default_tile_size_gpu.width() + 1,
- default_tile_size_gpu.height() + 1);
+TEST_F(PictureLayerImplTest, TilingGpuRasterization) {
+ gfx::Size default_tile_size(host_impl_.settings().default_tile_size);
+ gfx::Size layer_bounds(default_tile_size.width() * 4,
+ default_tile_size.height() * 4);
float result_scale_x, result_scale_y;
gfx::Size result_bounds;
// Layers without GPU rasterization (default).
SetupDefaultTrees(layer_bounds);
-
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
-
pending_layer_->CalculateContentsScale(
1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds);
+ // Should have a low-res and a high-res tiling.
ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings());
- pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting();
-
- // Tile size should equal default_tile_size.
- Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0];
- EXPECT_EQ(host_impl_.settings().default_tile_size.ToString(),
- tile->content_rect().size().ToString());
-
// Tell the layer to use GPU rasterization.
pending_layer_->SetShouldUseGpuRasterization(true);
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
-
pending_layer_->CalculateContentsScale(
1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds);
+ // Should only have the high-res tiling.
ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings());
-
- pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting();
-
- // Tile size should now equal default_tile_size_gpu.
- Tile* tile_gpu =
- pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0];
- EXPECT_EQ(default_tile_size_gpu.ToString(),
- tile_gpu->content_rect().size().ToString());
}
TEST_F(PictureLayerImplTest, NoTilingIfDoesNotDrawContent) {
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index cf8fba4..0ace95a 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -44,7 +44,6 @@ LayerTreeSettings::LayerTreeSettings()
refresh_rate(60.0),
max_partial_texture_updates(std::numeric_limits<size_t>::max()),
default_tile_size(gfx::Size(256, 256)),
- default_tile_size_gpu_rasterization(gfx::Size(1024, 1024)),
max_untiled_layer_size(gfx::Size(512, 512)),
minimum_occlusion_tracking_size(gfx::Size(160, 160)),
use_pinch_zoom_scrollbars(false),
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index ccd08e1..6c06254 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -55,7 +55,6 @@ class CC_EXPORT LayerTreeSettings {
double refresh_rate;
size_t max_partial_texture_updates;
gfx::Size default_tile_size;
- gfx::Size default_tile_size_gpu_rasterization;
gfx::Size max_untiled_layer_size;
gfx::Size minimum_occlusion_tracking_size;
bool use_pinch_zoom_scrollbars;