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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2946223003: cc: Add UMA to measure the raster duration for pending tree activation. (Closed)
Patch Set: tests Created 3 years, 6 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 | « cc/trees/layer_tree_host_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 51371290d2ffbda966583b28faeb275976a7eda0..d5e34a64d12035af08d0a1bb27d1599aa5a10761 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -8733,12 +8733,15 @@ TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) {
host_impl_->SetHasGpuRasterizationTrigger(false);
host_impl_->CommitComplete();
EXPECT_FALSE(host_impl_->RequiresHighResToDraw());
+ host_impl_->NotifyReadyToActivate();
host_impl_->SetHasGpuRasterizationTrigger(true);
host_impl_->CommitComplete();
EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
+ host_impl_->NotifyReadyToActivate();
host_impl_->SetHasGpuRasterizationTrigger(false);
host_impl_->CommitComplete();
EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
+ host_impl_->NotifyReadyToActivate();
host_impl_->ResetRequiresHighResToDraw();
@@ -8746,6 +8749,7 @@ TEST_F(LayerTreeHostImplTest, RequireHighResAfterGpuRasterizationToggles) {
host_impl_->SetHasGpuRasterizationTrigger(true);
host_impl_->CommitComplete();
EXPECT_TRUE(host_impl_->RequiresHighResToDraw());
+ host_impl_->NotifyReadyToActivate();
}
class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest {
@@ -11842,12 +11846,14 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusTrigger) {
EXPECT_EQ(GpuRasterizationStatus::OFF_VIEWPORT,
host_impl_->gpu_rasterization_status());
EXPECT_FALSE(host_impl_->use_gpu_rasterization());
+ host_impl_->NotifyReadyToActivate();
// Toggle the trigger on.
host_impl_->SetHasGpuRasterizationTrigger(true);
host_impl_->CommitComplete();
EXPECT_EQ(GpuRasterizationStatus::ON, host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
+ host_impl_->NotifyReadyToActivate();
// And off.
host_impl_->SetHasGpuRasterizationTrigger(false);
@@ -11855,6 +11861,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusTrigger) {
EXPECT_EQ(GpuRasterizationStatus::OFF_VIEWPORT,
host_impl_->gpu_rasterization_status());
EXPECT_FALSE(host_impl_->use_gpu_rasterization());
+ host_impl_->NotifyReadyToActivate();
}
// Tests that SetContentIsSuitableForGpuRasterization behaves as expected.
@@ -11875,6 +11882,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusSuitability) {
EXPECT_EQ(GpuRasterizationStatus::MSAA_CONTENT,
host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_msaa());
+ host_impl_->NotifyReadyToActivate();
// Toggle suitability on.
host_impl_->SetContentIsSuitableForGpuRasterization(true);
@@ -11882,6 +11890,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusSuitability) {
EXPECT_EQ(GpuRasterizationStatus::ON, host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
EXPECT_FALSE(host_impl_->use_msaa());
+ host_impl_->NotifyReadyToActivate();
// And off.
host_impl_->SetContentIsSuitableForGpuRasterization(false);
@@ -11890,6 +11899,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusSuitability) {
host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
EXPECT_TRUE(host_impl_->use_msaa());
+ host_impl_->NotifyReadyToActivate();
}
// Tests that SetDeviceScaleFactor correctly impacts GPU rasterization.
@@ -11910,6 +11920,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusDeviceScaleFactor) {
host_impl_->CommitComplete();
EXPECT_EQ(GpuRasterizationStatus::ON, host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
+ host_impl_->NotifyReadyToActivate();
// Set device scale factor to 2, which lowers the required MSAA samples from
// 8 to 4.
@@ -11919,6 +11930,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusDeviceScaleFactor) {
host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
EXPECT_TRUE(host_impl_->use_msaa());
+ host_impl_->NotifyReadyToActivate();
// Set device scale factor back to 1.
host_impl_->active_tree()->SetDeviceScaleFactor(1.0f);
@@ -11926,6 +11938,7 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusDeviceScaleFactor) {
EXPECT_EQ(GpuRasterizationStatus::ON, host_impl_->gpu_rasterization_status());
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
EXPECT_FALSE(host_impl_->use_msaa());
+ host_impl_->NotifyReadyToActivate();
}
// Tests that explicit MSAA sample count correctly impacts GPU rasterization.
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698