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

Side by Side Diff: cc/test/proxy_main_for_test.cc

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/proxy_main_for_test.h" 5 #include "cc/test/proxy_main_for_test.h"
6 6
7 #include "cc/test/threaded_channel_for_test.h" 7 #include "cc/test/threaded_channel_for_test.h"
8 #include "cc/trees/remote_channel_main.h"
8 9
9 namespace cc { 10 namespace cc {
10 11
11 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded( 12 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded(
12 TestHooks* test_hooks, 13 TestHooks* test_hooks,
13 LayerTreeHost* host, 14 LayerTreeHost* host,
14 TaskRunnerProvider* task_runner_provider, 15 TaskRunnerProvider* task_runner_provider,
15 scoped_ptr<BeginFrameSource> external_begin_frame_source) { 16 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
16 scoped_ptr<ProxyMain> proxy_main( 17 scoped_ptr<ProxyMain> proxy_main(
17 new ProxyMainForTest(test_hooks, host, task_runner_provider, 18 new ProxyMainForTest(test_hooks, host, task_runner_provider,
18 std::move(external_begin_frame_source))); 19 std::move(external_begin_frame_source)));
19 proxy_main->SetChannel(ThreadedChannelForTest::Create( 20 proxy_main->SetChannel(ThreadedChannelForTest::Create(
20 test_hooks, proxy_main.get(), task_runner_provider)); 21 test_hooks, proxy_main.get(), task_runner_provider));
21 return proxy_main; 22 return proxy_main;
22 } 23 }
23 24
25 scoped_ptr<ProxyMain> ProxyMainForTest::CreateRemote(
26 TestHooks* test_hooks,
27 RemoteProtoChannel* remote_proto_channel,
28 LayerTreeHost* host,
29 TaskRunnerProvider* task_runner_provider) {
30 scoped_ptr<ProxyMain> proxy_main(
31 new ProxyMainForTest(test_hooks, host, task_runner_provider, nullptr));
32 proxy_main->SetChannel(RemoteChannelMain::Create(
33 remote_proto_channel, proxy_main.get(), task_runner_provider));
34 return proxy_main;
35 }
36
24 ProxyMainForTest::~ProxyMainForTest() {} 37 ProxyMainForTest::~ProxyMainForTest() {}
25 38
26 ProxyMainForTest::ProxyMainForTest( 39 ProxyMainForTest::ProxyMainForTest(
27 TestHooks* test_hooks, 40 TestHooks* test_hooks,
28 LayerTreeHost* host, 41 LayerTreeHost* host,
29 TaskRunnerProvider* task_runner_provider, 42 TaskRunnerProvider* task_runner_provider,
30 scoped_ptr<BeginFrameSource> external_begin_frame_source) 43 scoped_ptr<BeginFrameSource> external_begin_frame_source)
31 : ProxyMain(host, 44 : ProxyMain(host,
32 task_runner_provider, 45 task_runner_provider,
33 std::move(external_begin_frame_source)), 46 std::move(external_begin_frame_source)),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 std::move(main_frame_events)); 108 std::move(main_frame_events));
96 } 109 }
97 110
98 void ProxyMainForTest::BeginMainFrame( 111 void ProxyMainForTest::BeginMainFrame(
99 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { 112 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) {
100 test_hooks_->ReceivedBeginMainFrame(); 113 test_hooks_->ReceivedBeginMainFrame();
101 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); 114 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state));
102 } 115 }
103 116
104 } // namespace cc 117 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698