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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 25912003: cc: Stop using magic numbers to detect if we can use partial updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 7c5c1a30bed440ce88c1a1796a02716b6cddf464..73c3a30bcd51e8203e75d82d3a6102617a31e144 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1483,31 +1483,57 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
context->ResetUsedTextures();
break;
case 1:
- // Number of textures should be two for each content layer.
- ASSERT_EQ(4u, context->NumTextures());
+ if (HasImplThread()) {
+ // Number of textures should be two for each content layer.
+ ASSERT_EQ(4u, context->NumTextures());
+ } else {
+ // In single thread we can always do partial updates, so the limit has
+ // no effect.
+ ASSERT_EQ(2u, context->NumTextures());
+ }
// Number of textures used for commit should be one for each content
// layer.
EXPECT_EQ(2u, context->NumUsedTextures());
- // First content textures should not have been used.
- EXPECT_FALSE(context->UsedTexture(context->TextureAt(0)));
- EXPECT_FALSE(context->UsedTexture(context->TextureAt(1)));
- // New textures should have been used.
- EXPECT_TRUE(context->UsedTexture(context->TextureAt(2)));
- EXPECT_TRUE(context->UsedTexture(context->TextureAt(3)));
+ if (HasImplThread()) {
+ // First content textures should not have been used.
+ EXPECT_FALSE(context->UsedTexture(context->TextureAt(0)));
+ EXPECT_FALSE(context->UsedTexture(context->TextureAt(1)));
+ // New textures should have been used.
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(2)));
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(3)));
+ } else {
+ // In single thread we can always do partial updates, so the limit has
+ // no effect.
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(0)));
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(1)));
+ }
context->ResetUsedTextures();
break;
case 2:
- // Number of textures should be two for each content layer.
- ASSERT_EQ(4u, context->NumTextures());
+ if (HasImplThread()) {
+ // Number of textures should be two for each content layer.
+ ASSERT_EQ(4u, context->NumTextures());
+ } else {
+ // In single thread we can always do partial updates, so the limit has
+ // no effect.
+ ASSERT_EQ(2u, context->NumTextures());
+ }
// Number of textures used for commit should be one for each content
// layer.
EXPECT_EQ(2u, context->NumUsedTextures());
- // One content layer does a partial update also.
- EXPECT_TRUE(context->UsedTexture(context->TextureAt(2)));
- EXPECT_FALSE(context->UsedTexture(context->TextureAt(3)));
+ if (HasImplThread()) {
+ // One content layer does a partial update also.
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(2)));
+ EXPECT_FALSE(context->UsedTexture(context->TextureAt(3)));
+ } else {
+ // In single thread we can always do partial updates, so the limit has
+ // no effect.
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(0)));
+ EXPECT_TRUE(context->UsedTexture(context->TextureAt(1)));
+ }
context->ResetUsedTextures();
break;
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698