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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1126253005: cc: Add LayerTreeHost::InitParams for LayerTreeHost creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all Created 5 years, 7 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/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 b9d8bc9d12c7ddeb1ee1d385fcad194d2b88ca59..8116ce3ffa5f9471546700e090621b4bbd11306f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2336,9 +2336,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits);
class LayerTreeHostWithProxy : public LayerTreeHost {
public:
LayerTreeHostWithProxy(FakeLayerTreeHostClient* client,
- const LayerTreeSettings& settings,
- scoped_ptr<FakeProxy> proxy)
- : LayerTreeHost(client, NULL, NULL, NULL, settings) {
+ scoped_ptr<FakeProxy> proxy,
+ LayerTreeHost::InitParams* params)
+ : LayerTreeHost(params) {
proxy->SetLayerTreeHost(this);
client->SetLayerTreeHost(this);
InitializeForTesting(proxy.Pass());
@@ -2358,7 +2358,10 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
settings.impl_side_painting = false;
settings.max_partial_texture_updates = 10;
- LayerTreeHostWithProxy host(&client, settings, proxy.Pass());
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.settings = &settings;
+ LayerTreeHostWithProxy host(&client, proxy.Pass(), &params);
EXPECT_EQ(0u, host.MaxPartialTextureUpdates());
}
@@ -2376,7 +2379,10 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
settings.impl_side_painting = false;
settings.max_partial_texture_updates = 10;
- LayerTreeHostWithProxy host(&client, settings, proxy.Pass());
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.settings = &settings;
+ LayerTreeHostWithProxy host(&client, proxy.Pass(), &params);
EXPECT_EQ(5u, host.MaxPartialTextureUpdates());
}
@@ -2394,7 +2400,10 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
settings.impl_side_painting = false;
settings.max_partial_texture_updates = 10;
- LayerTreeHostWithProxy host(&client, settings, proxy.Pass());
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.settings = &settings;
+ LayerTreeHostWithProxy host(&client, proxy.Pass(), &params);
EXPECT_EQ(10u, host.MaxPartialTextureUpdates());
}
@@ -2410,9 +2419,13 @@ TEST(LayerTreeHostTest, PartialUpdatesWithGLRenderer) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
- &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
- base::ThreadTaskRunnerHandle::Get(), nullptr);
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.settings = &settings;
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ scoped_ptr<LayerTreeHost> host =
+ LayerTreeHost::CreateSingleThreaded(&client, &params);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2429,9 +2442,13 @@ TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
- &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
- base::ThreadTaskRunnerHandle::Get(), nullptr);
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.settings = &settings;
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ scoped_ptr<LayerTreeHost> host =
+ LayerTreeHost::CreateSingleThreaded(&client, &params);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2448,9 +2465,13 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
- &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
- base::ThreadTaskRunnerHandle::Get(), nullptr);
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.settings = &settings;
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ scoped_ptr<LayerTreeHost> host =
+ LayerTreeHost::CreateSingleThreaded(&client, &params);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2468,9 +2489,13 @@ TEST(LayerTreeHostTest,
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
- &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
- base::ThreadTaskRunnerHandle::Get(), nullptr);
+ LayerTreeHost::InitParams params;
+ params.client = &client;
+ params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.settings = &settings;
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ scoped_ptr<LayerTreeHost> host =
+ LayerTreeHost::CreateSingleThreaded(&client, &params);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());

Powered by Google App Engine
This is Rietveld 408576698