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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 640873002: cc: Move RequiresHighResToDraw from tree to lthi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 // All tiles shared (no invalidation). 1746 // All tiles shared (no invalidation).
1747 CreateHighLowResAndSetAllTilesVisible(); 1747 CreateHighLowResAndSetAllTilesVisible();
1748 1748
1749 // Verify active tree not ready. 1749 // Verify active tree not ready.
1750 Tile* some_active_tile = 1750 Tile* some_active_tile =
1751 active_layer_->HighResTiling()->AllTilesForTesting()[0]; 1751 active_layer_->HighResTiling()->AllTilesForTesting()[0];
1752 EXPECT_FALSE(some_active_tile->IsReadyToDraw()); 1752 EXPECT_FALSE(some_active_tile->IsReadyToDraw());
1753 1753
1754 // When high res are required, even if the active tree is not ready, 1754 // When high res are required, even if the active tree is not ready,
1755 // the high res tiles must be ready. 1755 // the high res tiles must be ready.
1756 host_impl_.active_tree()->SetRequiresHighResToDraw(); 1756 host_impl_.SetRequiresHighResToDraw();
1757 pending_layer_->MarkVisibleResourcesAsRequired(); 1757 pending_layer_->MarkVisibleResourcesAsRequired();
1758 AssertAllTilesRequired(pending_layer_->HighResTiling()); 1758 AssertAllTilesRequired(pending_layer_->HighResTiling());
1759 AssertNoTilesRequired(pending_layer_->LowResTiling()); 1759 AssertNoTilesRequired(pending_layer_->LowResTiling());
1760 } 1760 }
1761 1761
1762 TEST_F(PictureLayerImplTest, NothingRequiredIfAllHighResTilesShared) { 1762 TEST_F(PictureLayerImplTest, NothingRequiredIfAllHighResTilesShared) {
1763 gfx::Size layer_bounds(400, 400); 1763 gfx::Size layer_bounds(400, 400);
1764 gfx::Size tile_size(100, 100); 1764 gfx::Size tile_size(100, 100);
1765 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size); 1765 SetupDefaultTreesWithFixedTileSize(layer_bounds, tile_size);
1766 1766
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after
4370 SetupPendingTree(pending_pile2); 4370 SetupPendingTree(pending_pile2);
4371 ActivateTree(); 4371 ActivateTree();
4372 4372
4373 // We've switched to a solid color, so we should end up with no tilings. 4373 // We've switched to a solid color, so we should end up with no tilings.
4374 ASSERT_TRUE(active_layer_->tilings()); 4374 ASSERT_TRUE(active_layer_->tilings());
4375 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); 4375 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings());
4376 } 4376 }
4377 4377
4378 } // namespace 4378 } // namespace
4379 } // namespace cc 4379 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698