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

Unified Diff: cc/tiles/tile_manager_perftest.cc

Issue 1362663002: cc: Remove PicturePile and PicturePileImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: cc/tiles/tile_manager_perftest.cc
diff --git a/cc/tiles/tile_manager_perftest.cc b/cc/tiles/tile_manager_perftest.cc
index 1542233bc1c80d0a612d69e222c920395c70acfa..24888901515cb40c929eb33037c4d9b4f21086f8 100644
--- a/cc/tiles/tile_manager_perftest.cc
+++ b/cc/tiles/tile_manager_perftest.cc
@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "cc/debug/lap_timer.h"
#include "cc/raster/raster_buffer.h"
#include "cc/test/begin_frame_args_test.h"
+#include "cc/test/fake_display_list_raster_source.h"
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/fake_picture_layer_impl.h"
-#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/fake_tile_manager.h"
#include "cc/test/fake_tile_manager_client.h"
#include "cc/test/test_shared_bitmap_manager.h"
@@ -125,12 +126,12 @@ class TileManagerPerfTest : public testing::Test {
}
void SetupDefaultTrees(const gfx::Size& layer_bounds) {
- scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateFilledPile(kDefaultTileSize, layer_bounds);
- scoped_refptr<FakePicturePileImpl> active_pile =
- FakePicturePileImpl::CreateFilledPile(kDefaultTileSize, layer_bounds);
+ scoped_refptr<FakeDisplayListRasterSource> pending_raster_source =
+ FakeDisplayListRasterSource::CreateFilled(layer_bounds);
+ scoped_refptr<FakeDisplayListRasterSource> active_raster_source =
+ FakeDisplayListRasterSource::CreateFilled(layer_bounds);
- SetupTrees(pending_pile, active_pile);
+ SetupTrees(pending_raster_source, active_raster_source);
}
void ActivateTree() {
@@ -148,21 +149,22 @@ class TileManagerPerfTest : public testing::Test {
active_root_layer_->set_fixed_tile_size(tile_size);
}
- void SetupTrees(scoped_refptr<PicturePileImpl> pending_pile,
- scoped_refptr<PicturePileImpl> active_pile) {
- SetupPendingTree(active_pile);
+ void SetupTrees(scoped_refptr<RasterSource> pending_raster_source,
+ scoped_refptr<RasterSource> active_raster_source) {
+ SetupPendingTree(active_raster_source);
ActivateTree();
- SetupPendingTree(pending_pile);
+ SetupPendingTree(pending_raster_source);
}
- void SetupPendingTree(scoped_refptr<PicturePileImpl> pile) {
+ void SetupPendingTree(scoped_refptr<RasterSource> raster_source) {
host_impl_.CreatePendingTree();
LayerTreeImpl* pending_tree = host_impl_.pending_tree();
// Clear recycled tree.
pending_tree->DetachLayerTree();
scoped_ptr<FakePictureLayerImpl> pending_layer =
- FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_, pile);
+ FakePictureLayerImpl::CreateWithRasterSource(pending_tree, id_,
+ raster_source);
pending_layer->SetDrawsContent(true);
pending_layer->SetHasRenderSurface(true);
pending_tree->SetRootLayer(pending_layer.Pass());
@@ -344,12 +346,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);
+ scoped_refptr<FakeDisplayListRasterSource> raster_source =
+ FakeDisplayListRasterSource::CreateFilled(layer_bounds);
while (static_cast<int>(layers.size()) < layer_count) {
scoped_ptr<FakePictureLayerImpl> layer =
FakePictureLayerImpl::CreateWithRasterSource(
- host_impl_.pending_tree(), next_id, pile);
+ host_impl_.pending_tree(), next_id, raster_source);
layer->SetBounds(layer_bounds);
layer->SetDrawsContent(true);
layers.push_back(layer.get());
@@ -417,12 +419,8 @@ class TileManagerPerfTest : public testing::Test {
FakePictureLayerImpl* active_root_layer_;
LapTimer timer_;
LayerTreeSettings settings_;
-
- static const gfx::Size kDefaultTileSize;
};
-const gfx::Size TileManagerPerfTest::kDefaultTileSize(100, 100);
-
TEST_F(TileManagerPerfTest, PrepareTiles) {
RunPrepareTilesTest("2_100", 2, 100);
RunPrepareTilesTest("2_500", 2, 500);

Powered by Google App Engine
This is Rietveld 408576698