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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1134123005: cc: split UpdateGpuRasterizationStatus() into two parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes per review comments Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index e2df5ef011e68b10252a611923d389b6aad4535c..e4603e72ac6a5c1a8121ce4347c86141c3244404 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -2436,9 +2436,9 @@ TEST_F(PictureLayerImplTest, SyncTilingAfterGpuRasterizationToggles) {
// Gpu rasterization is disabled by default.
EXPECT_FALSE(host_impl_.use_gpu_rasterization());
// Toggling the gpu rasterization clears all tilings on both trees.
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.set_content_is_suitable_for_gpu_rasterization(true);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
+ host_impl_.SetContentIsSuitableForGpuRasterization(true);
+ host_impl_.UpdateTreeResourcesForGpuRasterizationIfNeeded();
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
@@ -2459,16 +2459,15 @@ TEST_F(PictureLayerImplTest, SyncTilingAfterGpuRasterizationToggles) {
// Toggling the gpu rasterization clears all tilings on both trees.
EXPECT_TRUE(host_impl_.use_gpu_rasterization());
- host_impl_.set_has_gpu_rasterization_trigger(false);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(false);
+ host_impl_.UpdateTreeResourcesForGpuRasterizationIfNeeded();
EXPECT_EQ(GpuRasterizationStatus::OFF_VIEWPORT,
host_impl_.gpu_rasterization_status());
EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings());
EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.set_content_is_suitable_for_gpu_rasterization(false);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
+ host_impl_.SetContentIsSuitableForGpuRasterization(false);
EXPECT_EQ(GpuRasterizationStatus::OFF_CONTENT,
host_impl_.gpu_rasterization_status());
}
@@ -2514,8 +2513,7 @@ TEST_F(PictureLayerImplTest, LowResTilingWithoutGpuRasterization) {
gfx::Size layer_bounds(default_tile_size.width() * 4,
default_tile_size.height() * 4);
- host_impl_.set_has_gpu_rasterization_trigger(false);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(false);
SetupDefaultTrees(layer_bounds);
EXPECT_FALSE(host_impl_.use_gpu_rasterization());
@@ -2528,9 +2526,8 @@ TEST_F(PictureLayerImplTest, NoLowResTilingWithGpuRasterization) {
gfx::Size layer_bounds(default_tile_size.width() * 4,
default_tile_size.height() * 4);
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.set_content_is_suitable_for_gpu_rasterization(true);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
+ host_impl_.SetContentIsSuitableForGpuRasterization(true);
SetupDefaultTrees(layer_bounds);
EXPECT_TRUE(host_impl_.use_gpu_rasterization());
@@ -2539,9 +2536,8 @@ TEST_F(PictureLayerImplTest, NoLowResTilingWithGpuRasterization) {
}
TEST_F(PictureLayerImplTest, RequiredTilesWithGpuRasterization) {
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.set_content_is_suitable_for_gpu_rasterization(true);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
+ host_impl_.SetContentIsSuitableForGpuRasterization(true);
gfx::Size viewport_size(1000, 1000);
host_impl_.SetViewportSize(viewport_size);
@@ -2841,9 +2837,9 @@ TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForGpuRasterization) {
gfx::Size viewport_size(1000, 1000);
SetupDefaultTrees(layer_bounds);
host_impl_.SetViewportSize(viewport_size);
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.set_content_is_suitable_for_gpu_rasterization(true);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
+ host_impl_.SetContentIsSuitableForGpuRasterization(true);
+ host_impl_.UpdateTreeResourcesForGpuRasterizationIfNeeded();
danakj 2015/05/13 20:21:57 is this needed?
Stephen White 2015/05/13 20:38:35 Yes. The EXPECT_BOTH_EQ(HighResTiling()->contents_
float contents_scale = 1.f;
float device_scale = 1.3f;
@@ -5028,9 +5024,8 @@ TEST_F(TileSizeTest, TileSizes) {
host_impl_.SetViewportSize(gfx::Size(1000, 1000));
gfx::Size result;
- host_impl_.set_content_is_suitable_for_gpu_rasterization(true);
- host_impl_.set_has_gpu_rasterization_trigger(false);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetContentIsSuitableForGpuRasterization(true);
+ host_impl_.SetHasGpuRasterizationTrigger(false);
EXPECT_EQ(host_impl_.gpu_rasterization_status(),
GpuRasterizationStatus::OFF_VIEWPORT);
@@ -5051,8 +5046,7 @@ TEST_F(TileSizeTest, TileSizes) {
// Gpu-rasterization uses 25% viewport-height tiles.
// The +2's below are for border texels.
- host_impl_.set_has_gpu_rasterization_trigger(true);
- host_impl_.UpdateGpuRasterizationStatus();
+ host_impl_.SetHasGpuRasterizationTrigger(true);
EXPECT_EQ(host_impl_.gpu_rasterization_status(), GpuRasterizationStatus::ON);
host_impl_.SetViewportSize(gfx::Size(2000, 2000));
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698