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

Unified Diff: cc/layers/layer_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/layers/layer_unittest.cc
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index bae8185053fe6a9123df9667313e584a4cce0bed..7796d927af7ac7267500c57e8f6d5815d13ca701 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -44,10 +44,11 @@ namespace {
class MockLayerTreeHost : public LayerTreeHost {
public:
- explicit MockLayerTreeHost(FakeLayerTreeHostClient* client)
- : LayerTreeHost(client, nullptr, nullptr, nullptr, LayerTreeSettings()) {
- InitializeSingleThreaded(client, base::ThreadTaskRunnerHandle::Get(),
- nullptr);
+ MockLayerTreeHost(LayerTreeHostSingleThreadClient* single_thread_client,
+ LayerTreeHost::InitParams* params)
+ : LayerTreeHost(params) {
+ InitializeSingleThreaded(single_thread_client,
+ base::ThreadTaskRunnerHandle::Get(), nullptr);
}
MOCK_METHOD0(SetNeedsCommit, void());
@@ -68,7 +69,10 @@ class LayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_));
+ LayerTreeHost::InitParams params;
+ params.client = &fake_client_;
+ layer_tree_host_.reset(
+ new StrictMock<MockLayerTreeHost>(&fake_client_, &params));
}
void TearDown() override {
@@ -937,18 +941,16 @@ class LayerTreeHostFactory {
shared_bitmap_manager_(new TestSharedBitmapManager),
gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager) {}
- scoped_ptr<LayerTreeHost> Create() {
- return LayerTreeHost::CreateSingleThreaded(
- &client_, &client_, shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), nullptr, LayerTreeSettings(),
- base::ThreadTaskRunnerHandle::Get(), nullptr);
- }
+ scoped_ptr<LayerTreeHost> Create() { return Create(LayerTreeSettings()); }
scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) {
- return LayerTreeHost::CreateSingleThreaded(
- &client_, &client_, shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), nullptr, settings,
- base::ThreadTaskRunnerHandle::Get(), nullptr);
+ LayerTreeHost::InitParams params;
+ params.client = &client_;
+ params.shared_bitmap_manager = shared_bitmap_manager_.get();
+ params.gpu_memory_buffer_manager = gpu_memory_buffer_manager_.get();
+ params.settings = &settings;
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ return LayerTreeHost::CreateSingleThreaded(&client_, &params);
}
private:

Powered by Google App Engine
This is Rietveld 408576698