OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ~ThreadProxyForTest() override {} | 132 ~ThreadProxyForTest() override {} |
133 | 133 |
134 private: | 134 private: |
135 TestHooks* test_hooks_; | 135 TestHooks* test_hooks_; |
136 | 136 |
137 void SetNeedsUpdateLayers() override { | 137 void SetNeedsUpdateLayers() override { |
138 ThreadProxy::SetNeedsUpdateLayers(); | 138 ThreadProxy::SetNeedsUpdateLayers(); |
139 test_hooks_->DidSetNeedsUpdateLayers(); | 139 test_hooks_->DidSetNeedsUpdateLayers(); |
140 } | 140 } |
141 | 141 |
142 void ScheduledActionSendBeginMainFrame() override { | 142 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override { |
143 test_hooks_->ScheduledActionWillSendBeginMainFrame(); | 143 test_hooks_->ScheduledActionWillSendBeginMainFrame(); |
144 ThreadProxy::ScheduledActionSendBeginMainFrame(); | 144 ThreadProxy::ScheduledActionSendBeginMainFrame(args); |
145 test_hooks_->ScheduledActionSendBeginMainFrame(); | 145 test_hooks_->ScheduledActionSendBeginMainFrame(); |
146 } | 146 } |
147 | 147 |
148 DrawResult ScheduledActionDrawAndSwapIfPossible() override { | 148 DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
149 DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); | 149 DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); |
150 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); | 150 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); |
151 return result; | 151 return result; |
152 } | 152 } |
153 | 153 |
154 void ScheduledActionAnimate() override { | 154 void ScheduledActionAnimate() override { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 return make_scoped_ptr(new SingleThreadProxyForTest( | 363 return make_scoped_ptr(new SingleThreadProxyForTest( |
364 test_hooks, host, client, main_task_runner, | 364 test_hooks, host, client, main_task_runner, |
365 external_begin_frame_source.Pass())); | 365 external_begin_frame_source.Pass())); |
366 } | 366 } |
367 | 367 |
368 ~SingleThreadProxyForTest() override {} | 368 ~SingleThreadProxyForTest() override {} |
369 | 369 |
370 private: | 370 private: |
371 TestHooks* test_hooks_; | 371 TestHooks* test_hooks_; |
372 | 372 |
373 void ScheduledActionSendBeginMainFrame() override { | 373 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override { |
374 test_hooks_->ScheduledActionWillSendBeginMainFrame(); | 374 test_hooks_->ScheduledActionWillSendBeginMainFrame(); |
375 SingleThreadProxy::ScheduledActionSendBeginMainFrame(); | 375 SingleThreadProxy::ScheduledActionSendBeginMainFrame(args); |
376 test_hooks_->ScheduledActionSendBeginMainFrame(); | 376 test_hooks_->ScheduledActionSendBeginMainFrame(); |
377 } | 377 } |
378 | 378 |
379 DrawResult ScheduledActionDrawAndSwapIfPossible() override { | 379 DrawResult ScheduledActionDrawAndSwapIfPossible() override { |
380 DrawResult result = | 380 DrawResult result = |
381 SingleThreadProxy::ScheduledActionDrawAndSwapIfPossible(); | 381 SingleThreadProxy::ScheduledActionDrawAndSwapIfPossible(); |
382 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); | 382 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); |
383 return result; | 383 return result; |
384 } | 384 } |
385 | 385 |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 1158 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
1159 // We check for a null proxy here as we sometimes ask for the layer tree host | 1159 // We check for a null proxy here as we sometimes ask for the layer tree host |
1160 // when the proxy does not exist, often for checking settings after a test has | 1160 // when the proxy does not exist, often for checking settings after a test has |
1161 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 1161 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
1162 // elsewhere in this file for other examples. | 1162 // elsewhere in this file for other examples. |
1163 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 1163 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
1164 return layer_tree_host_.get(); | 1164 return layer_tree_host_.get(); |
1165 } | 1165 } |
1166 | 1166 |
1167 } // namespace cc | 1167 } // namespace cc |
OLD | NEW |