| OLD | NEW |
| 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 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| 11 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded( | 11 scoped_ptr<ProxyMain> ProxyMainForTest::CreateThreaded( |
| 12 TestHooks* test_hooks, | 12 TestHooks* test_hooks, |
| 13 LayerTreeHost* host, | 13 LayerTreeHost* host, |
| 14 TaskRunnerProvider* task_runner_provider, | 14 TaskRunnerProvider* task_runner_provider) { |
| 15 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | |
| 16 scoped_ptr<ProxyMain> proxy_main( | 15 scoped_ptr<ProxyMain> proxy_main( |
| 17 new ProxyMainForTest(test_hooks, host, task_runner_provider, | 16 new ProxyMainForTest(test_hooks, host, task_runner_provider)); |
| 18 std::move(external_begin_frame_source))); | |
| 19 proxy_main->SetChannel(ThreadedChannelForTest::Create( | 17 proxy_main->SetChannel(ThreadedChannelForTest::Create( |
| 20 test_hooks, proxy_main.get(), task_runner_provider)); | 18 test_hooks, proxy_main.get(), task_runner_provider)); |
| 21 return proxy_main; | 19 return proxy_main; |
| 22 } | 20 } |
| 23 | 21 |
| 24 ProxyMainForTest::~ProxyMainForTest() {} | 22 ProxyMainForTest::~ProxyMainForTest() {} |
| 25 | 23 |
| 26 ProxyMainForTest::ProxyMainForTest( | 24 ProxyMainForTest::ProxyMainForTest(TestHooks* test_hooks, |
| 27 TestHooks* test_hooks, | 25 LayerTreeHost* host, |
| 28 LayerTreeHost* host, | 26 TaskRunnerProvider* task_runner_provider) |
| 29 TaskRunnerProvider* task_runner_provider, | 27 : ProxyMain(host, task_runner_provider), test_hooks_(test_hooks) {} |
| 30 scoped_ptr<BeginFrameSource> external_begin_frame_source) | |
| 31 : ProxyMain(host, | |
| 32 task_runner_provider, | |
| 33 std::move(external_begin_frame_source)), | |
| 34 test_hooks_(test_hooks) {} | |
| 35 | 28 |
| 36 void ProxyMainForTest::SetNeedsUpdateLayers() { | 29 void ProxyMainForTest::SetNeedsUpdateLayers() { |
| 37 ProxyMain::SetNeedsUpdateLayers(); | 30 ProxyMain::SetNeedsUpdateLayers(); |
| 38 test_hooks_->DidSetNeedsUpdateLayers(); | 31 test_hooks_->DidSetNeedsUpdateLayers(); |
| 39 } | 32 } |
| 40 | 33 |
| 41 void ProxyMainForTest::DidCompleteSwapBuffers() { | 34 void ProxyMainForTest::DidCompleteSwapBuffers() { |
| 42 test_hooks_->ReceivedDidCompleteSwapBuffers(); | 35 test_hooks_->ReceivedDidCompleteSwapBuffers(); |
| 43 ProxyMain::DidCompleteSwapBuffers(); | 36 ProxyMain::DidCompleteSwapBuffers(); |
| 44 } | 37 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 std::move(main_frame_events)); | 88 std::move(main_frame_events)); |
| 96 } | 89 } |
| 97 | 90 |
| 98 void ProxyMainForTest::BeginMainFrame( | 91 void ProxyMainForTest::BeginMainFrame( |
| 99 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { | 92 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { |
| 100 test_hooks_->ReceivedBeginMainFrame(); | 93 test_hooks_->ReceivedBeginMainFrame(); |
| 101 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); | 94 ProxyMain::BeginMainFrame(std::move(begin_main_frame_state)); |
| 102 } | 95 } |
| 103 | 96 |
| 104 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |