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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1007623002: Fix resourceless software draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT_GE Created 5 years, 9 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_common.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 4883dfb27cb75900c4dd03783026fd356c1f2d36..dd797d5b68ed09ac30015992a85dc7d74c9c465d 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -7031,6 +7031,27 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
EXPECT_EQ(2u, render_surface_layer_list.size());
+
+ int count_represents_target_render_surface = 0;
+ int count_represents_contributing_render_surface = 0;
+ int count_represents_itself = 0;
+ auto end = LayerIterator<LayerImpl>::End(&render_surface_layer_list);
+ for (auto it = LayerIterator<LayerImpl>::Begin(&render_surface_layer_list);
+ it != end; ++it) {
+ if (it.represents_target_render_surface())
+ count_represents_target_render_surface++;
+ if (it.represents_contributing_render_surface())
+ count_represents_contributing_render_surface++;
+ if (it.represents_itself())
+ count_represents_itself++;
+ }
+
+ // Two render surfaces.
+ EXPECT_EQ(2, count_represents_target_render_surface);
+ // Second render surface contributes to root render surface.
+ EXPECT_EQ(1, count_represents_contributing_render_surface);
+ // All 4 layers represent itself.
+ EXPECT_EQ(4, count_represents_itself);
}
{
@@ -7041,6 +7062,27 @@ TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
EXPECT_EQ(1u, render_surface_layer_list.size());
+
+ int count_represents_target_render_surface = 0;
+ int count_represents_contributing_render_surface = 0;
+ int count_represents_itself = 0;
+ auto end = LayerIterator<LayerImpl>::End(&render_surface_layer_list);
+ for (auto it = LayerIterator<LayerImpl>::Begin(&render_surface_layer_list);
+ it != end; ++it) {
+ if (it.represents_target_render_surface())
+ count_represents_target_render_surface++;
+ if (it.represents_contributing_render_surface())
+ count_represents_contributing_render_surface++;
+ if (it.represents_itself())
+ count_represents_itself++;
+ }
+
+ // Only root layer has a render surface.
+ EXPECT_EQ(1, count_represents_target_render_surface);
+ // No layer contributes a render surface to root render surface.
+ EXPECT_EQ(0, count_represents_contributing_render_surface);
+ // All 4 layers represent itself.
+ EXPECT_EQ(4, count_represents_itself);
}
}
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698