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

Unified Diff: cc/resources/tile_manager_perftest.cc

Issue 684273003: cc: Fix picture layer impl not to create a tiling with invalid size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a local variable Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager_perftest.cc
diff --git a/cc/resources/tile_manager_perftest.cc b/cc/resources/tile_manager_perftest.cc
index ba130bfb6f409eff99c443efe1828c202a57b184..43c10312cfbecc9a35c48a9ccc2dc38f8dc08f08 100644
--- a/cc/resources/tile_manager_perftest.cc
+++ b/cc/resources/tile_manager_perftest.cc
@@ -112,7 +112,6 @@ class TileManagerPerfTest : public testing::Test {
}
virtual void SetUp() override {
- picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile();
InitializeRenderer();
SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
}
@@ -123,12 +122,10 @@ class TileManagerPerfTest : public testing::Test {
}
void SetupDefaultTrees(const gfx::Size& layer_bounds) {
- gfx::Size tile_size(100, 100);
-
scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ FakePicturePileImpl::CreateFilledPile(kDefaultTileSize, layer_bounds);
scoped_refptr<FakePicturePileImpl> active_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ FakePicturePileImpl::CreateFilledPile(kDefaultTileSize, layer_bounds);
SetupTrees(pending_pile, active_pile);
}
@@ -360,10 +357,12 @@ class TileManagerPerfTest : public testing::Test {
int next_id = id_ + 1;
// Create the rest of the layers as children of the root layer.
+ scoped_refptr<FakePicturePileImpl> pile =
+ FakePicturePileImpl::CreateFilledPile(kDefaultTileSize, layer_bounds);
while (static_cast<int>(layers.size()) < layer_count) {
scoped_ptr<FakePictureLayerImpl> layer =
- FakePictureLayerImpl::CreateWithPile(
- host_impl_.pending_tree(), next_id, picture_pile_);
+ FakePictureLayerImpl::CreateWithPile(host_impl_.pending_tree(),
+ next_id, pile);
layer->SetBounds(layer_bounds);
layers.push_back(layer.get());
pending_root_layer_->AddChild(layer.Pass());
@@ -432,10 +431,13 @@ class TileManagerPerfTest : public testing::Test {
FakePictureLayerImpl* pending_root_layer_;
FakePictureLayerImpl* active_root_layer_;
LapTimer timer_;
- scoped_refptr<FakePicturePileImpl> picture_pile_;
LayerTreeSettings settings_;
+
+ static const gfx::Size kDefaultTileSize;
};
+const gfx::Size TileManagerPerfTest::kDefaultTileSize(100, 100);
+
TEST_F(TileManagerPerfTest, ManageTiles) {
RunManageTilesTest("2_100", 2, 100);
RunManageTilesTest("2_500", 2, 500);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698