| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "cc/animation/animation.h" | 13 #include "cc/animation/animation.h" |
| 14 #include "cc/animation/animation_host.h" | 14 #include "cc/animation/animation_host.h" |
| 15 #include "cc/animation/element_animations.h" | 15 #include "cc/animation/element_animations.h" |
| 16 #include "cc/animation/timing_function.h" | 16 #include "cc/animation/timing_function.h" |
| 17 #include "cc/base/switches.h" | 17 #include "cc/base/switches.h" |
| 18 #include "cc/blimp/image_serialization_processor.h" | 18 #include "cc/blimp/image_serialization_processor.h" |
| 19 #include "cc/input/input_handler.h" | 19 #include "cc/input/input_handler.h" |
| 20 #include "cc/layers/layer.h" | 20 #include "cc/layers/layer.h" |
| 21 #include "cc/layers/layer_impl.h" | 21 #include "cc/layers/layer_impl.h" |
| 22 #include "cc/proto/compositor_message_to_impl.pb.h" | 22 #include "cc/proto/compositor_message_to_impl.pb.h" |
| 23 #include "cc/test/animation_test_common.h" | 23 #include "cc/test/animation_test_common.h" |
| 24 #include "cc/test/begin_frame_args_test.h" | 24 #include "cc/test/begin_frame_args_test.h" |
| 25 #include "cc/test/fake_external_begin_frame_source.h" | 25 #include "cc/test/fake_external_begin_frame_source.h" |
| 26 #include "cc/test/fake_image_serialization_processor.h" | 26 #include "cc/test/fake_image_serialization_processor.h" |
| 27 #include "cc/test/fake_layer_tree_host_client.h" | 27 #include "cc/test/fake_layer_tree_host_client.h" |
| 28 #include "cc/test/fake_output_surface.h" | 28 #include "cc/test/fake_output_surface.h" |
| 29 #include "cc/test/remote_channel_impl_for_test.h" | |
| 30 #include "cc/test/test_context_provider.h" | 29 #include "cc/test/test_context_provider.h" |
| 31 #include "cc/test/test_gpu_memory_buffer_manager.h" | 30 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 32 #include "cc/test/test_shared_bitmap_manager.h" | 31 #include "cc/test/test_shared_bitmap_manager.h" |
| 33 #include "cc/test/test_task_graph_runner.h" | 32 #include "cc/test/test_task_graph_runner.h" |
| 34 #include "cc/test/threaded_channel_for_test.h" | 33 #include "cc/test/threaded_channel_for_test.h" |
| 35 #include "cc/trees/layer_tree_host_client.h" | 34 #include "cc/trees/layer_tree_host_client.h" |
| 36 #include "cc/trees/layer_tree_host_impl.h" | 35 #include "cc/trees/layer_tree_host_impl.h" |
| 37 #include "cc/trees/layer_tree_host_single_thread_client.h" | 36 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 38 #include "cc/trees/layer_tree_impl.h" | 37 #include "cc/trees/layer_tree_impl.h" |
| 39 #include "cc/trees/proxy_impl.h" | 38 #include "cc/trees/proxy_impl.h" |
| 40 #include "cc/trees/proxy_main.h" | 39 #include "cc/trees/proxy_main.h" |
| 40 #include "cc/trees/remote_channel_impl.h" |
| 41 #include "cc/trees/single_thread_proxy.h" | 41 #include "cc/trees/single_thread_proxy.h" |
| 42 #include "cc/trees/threaded_channel.h" | 42 #include "cc/trees/threaded_channel.h" |
| 43 #include "testing/gmock/include/gmock/gmock.h" | 43 #include "testing/gmock/include/gmock/gmock.h" |
| 44 #include "ui/gfx/geometry/size_conversions.h" | 44 #include "ui/gfx/geometry/size_conversions.h" |
| 45 | 45 |
| 46 namespace cc { | 46 namespace cc { |
| 47 | 47 |
| 48 void CreateVirtualViewportLayers(Layer* root_layer, | 48 void CreateVirtualViewportLayers(Layer* root_layer, |
| 49 scoped_refptr<Layer> outer_scroll_layer, | 49 scoped_refptr<Layer> outer_scroll_layer, |
| 50 const gfx::Size& inner_bounds, | 50 const gfx::Size& inner_bounds, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const gfx::Size& scroll_bounds, | 82 const gfx::Size& scroll_bounds, |
| 83 LayerTreeHost* host) { | 83 LayerTreeHost* host) { |
| 84 scoped_refptr<Layer> outer_viewport_scroll_layer = Layer::Create(); | 84 scoped_refptr<Layer> outer_viewport_scroll_layer = Layer::Create(); |
| 85 | 85 |
| 86 outer_viewport_scroll_layer->SetBounds(scroll_bounds); | 86 outer_viewport_scroll_layer->SetBounds(scroll_bounds); |
| 87 outer_viewport_scroll_layer->SetIsDrawable(true); | 87 outer_viewport_scroll_layer->SetIsDrawable(true); |
| 88 CreateVirtualViewportLayers(root_layer, outer_viewport_scroll_layer, | 88 CreateVirtualViewportLayers(root_layer, outer_viewport_scroll_layer, |
| 89 inner_bounds, outer_bounds, host); | 89 inner_bounds, outer_bounds, host); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Creates a SingleThreadProxy that notifies the supplied |test_hooks| of | |
| 93 // various actions. | |
| 94 class SingleThreadProxyForTest : public SingleThreadProxy { | |
| 95 public: | |
| 96 static std::unique_ptr<Proxy> Create( | |
| 97 TestHooks* test_hooks, | |
| 98 LayerTreeHost* host, | |
| 99 LayerTreeHostSingleThreadClient* client, | |
| 100 TaskRunnerProvider* task_runner_provider) { | |
| 101 return base::WrapUnique(new SingleThreadProxyForTest( | |
| 102 test_hooks, host, client, task_runner_provider)); | |
| 103 } | |
| 104 | |
| 105 ~SingleThreadProxyForTest() override {} | |
| 106 | |
| 107 private: | |
| 108 SingleThreadProxyForTest(TestHooks* test_hooks, | |
| 109 LayerTreeHost* host, | |
| 110 LayerTreeHostSingleThreadClient* client, | |
| 111 TaskRunnerProvider* task_runner_provider) | |
| 112 : SingleThreadProxy(host, client, task_runner_provider), | |
| 113 test_hooks_(test_hooks) {} | |
| 114 | |
| 115 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override { | |
| 116 test_hooks_->ScheduledActionWillSendBeginMainFrame(); | |
| 117 SingleThreadProxy::ScheduledActionSendBeginMainFrame(args); | |
| 118 test_hooks_->ScheduledActionSendBeginMainFrame(); | |
| 119 } | |
| 120 | |
| 121 DrawResult ScheduledActionDrawAndSwapIfPossible() override { | |
| 122 DrawResult result = | |
| 123 SingleThreadProxy::ScheduledActionDrawAndSwapIfPossible(); | |
| 124 test_hooks_->ScheduledActionDrawAndSwapIfPossible(); | |
| 125 return result; | |
| 126 } | |
| 127 | |
| 128 void ScheduledActionCommit() override { | |
| 129 SingleThreadProxy::ScheduledActionCommit(); | |
| 130 test_hooks_->ScheduledActionCommit(); | |
| 131 } | |
| 132 | |
| 133 void ScheduledActionBeginOutputSurfaceCreation() override { | |
| 134 SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation(); | |
| 135 test_hooks_->ScheduledActionBeginOutputSurfaceCreation(); | |
| 136 } | |
| 137 | |
| 138 void ScheduledActionPrepareTiles() override { | |
| 139 SingleThreadProxy::ScheduledActionPrepareTiles(); | |
| 140 test_hooks_->ScheduledActionPrepareTiles(); | |
| 141 } | |
| 142 | |
| 143 void ScheduledActionInvalidateOutputSurface() override { | |
| 144 SingleThreadProxy::ScheduledActionInvalidateOutputSurface(); | |
| 145 test_hooks_->ScheduledActionInvalidateOutputSurface(); | |
| 146 } | |
| 147 | |
| 148 void SendBeginMainFrameNotExpectedSoon() override { | |
| 149 SingleThreadProxy::SendBeginMainFrameNotExpectedSoon(); | |
| 150 test_hooks_->SendBeginMainFrameNotExpectedSoon(); | |
| 151 } | |
| 152 | |
| 153 TestHooks* test_hooks_; | |
| 154 }; | |
| 155 | |
| 156 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. | 92 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. |
| 157 class LayerTreeHostImplForTesting : public LayerTreeHostImpl { | 93 class LayerTreeHostImplForTesting : public LayerTreeHostImpl { |
| 158 public: | 94 public: |
| 159 static std::unique_ptr<LayerTreeHostImplForTesting> Create( | 95 static std::unique_ptr<LayerTreeHostImplForTesting> Create( |
| 160 TestHooks* test_hooks, | 96 TestHooks* test_hooks, |
| 161 const LayerTreeSettings& settings, | 97 const LayerTreeSettings& settings, |
| 162 LayerTreeHostImplClient* host_impl_client, | 98 LayerTreeHostImplClient* host_impl_client, |
| 163 TaskRunnerProvider* task_runner_provider, | 99 TaskRunnerProvider* task_runner_provider, |
| 164 SharedBitmapManager* shared_bitmap_manager, | 100 SharedBitmapManager* shared_bitmap_manager, |
| 165 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 101 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void DidFinishImplFrame() override { | 145 void DidFinishImplFrame() override { |
| 210 LayerTreeHostImpl::DidFinishImplFrame(); | 146 LayerTreeHostImpl::DidFinishImplFrame(); |
| 211 test_hooks_->DidFinishImplFrameOnThread(this); | 147 test_hooks_->DidFinishImplFrameOnThread(this); |
| 212 } | 148 } |
| 213 | 149 |
| 214 void BeginMainFrameAborted(CommitEarlyOutReason reason) override { | 150 void BeginMainFrameAborted(CommitEarlyOutReason reason) override { |
| 215 LayerTreeHostImpl::BeginMainFrameAborted(reason); | 151 LayerTreeHostImpl::BeginMainFrameAborted(reason); |
| 216 test_hooks_->BeginMainFrameAbortedOnThread(this, reason); | 152 test_hooks_->BeginMainFrameAbortedOnThread(this, reason); |
| 217 } | 153 } |
| 218 | 154 |
| 155 void BeginMainFrameCompleted() override { |
| 156 LayerTreeHostImpl::BeginMainFrameCompleted(); |
| 157 test_hooks_->BeginMainFrameCompletedOnThread(this); |
| 158 } |
| 159 |
| 219 void BeginCommit() override { | 160 void BeginCommit() override { |
| 220 LayerTreeHostImpl::BeginCommit(); | 161 LayerTreeHostImpl::BeginCommit(); |
| 221 test_hooks_->BeginCommitOnThread(this); | 162 test_hooks_->BeginCommitOnThread(this); |
| 222 } | 163 } |
| 223 | 164 |
| 224 void CommitComplete() override { | 165 void CommitComplete() override { |
| 225 test_hooks_->WillCommitCompleteOnThread(this); | 166 test_hooks_->WillCommitCompleteOnThread(this); |
| 226 LayerTreeHostImpl::CommitComplete(); | 167 LayerTreeHostImpl::CommitComplete(); |
| 227 test_hooks_->CommitCompleteOnThread(this); | 168 test_hooks_->CommitCompleteOnThread(this); |
| 228 } | 169 } |
| 229 | 170 |
| 230 bool PrepareTiles() override { | 171 bool PrepareTiles() override { |
| 231 test_hooks_->WillPrepareTiles(this); | 172 test_hooks_->WillPrepareTilesOnThread(this); |
| 232 return LayerTreeHostImpl::PrepareTiles(); | 173 return LayerTreeHostImpl::PrepareTiles(); |
| 233 } | 174 } |
| 234 | 175 |
| 235 DrawResult PrepareToDraw(FrameData* frame) override { | 176 DrawResult PrepareToDraw(FrameData* frame) override { |
| 236 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); | 177 DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); |
| 237 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); | 178 return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); |
| 238 } | 179 } |
| 239 | 180 |
| 240 void DrawLayers(FrameData* frame) override { | 181 void DrawLayers(FrameData* frame) override { |
| 241 LayerTreeHostImpl::DrawLayers(frame); | 182 LayerTreeHostImpl::DrawLayers(frame); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 324 } |
| 384 | 325 |
| 385 void DidCompleteSwapBuffers() override { | 326 void DidCompleteSwapBuffers() override { |
| 386 test_hooks_->DidCompleteSwapBuffers(); | 327 test_hooks_->DidCompleteSwapBuffers(); |
| 387 } | 328 } |
| 388 | 329 |
| 389 void DidPostSwapBuffers() override {} | 330 void DidPostSwapBuffers() override {} |
| 390 void DidAbortSwapBuffers() override {} | 331 void DidAbortSwapBuffers() override {} |
| 391 void RequestScheduleComposite() override { test_hooks_->ScheduleComposite(); } | 332 void RequestScheduleComposite() override { test_hooks_->ScheduleComposite(); } |
| 392 void DidCompletePageScaleAnimation() override {} | 333 void DidCompletePageScaleAnimation() override {} |
| 393 void BeginMainFrameNotExpectedSoon() override {} | 334 void BeginMainFrameNotExpectedSoon() override { |
| 335 test_hooks_->BeginMainFrameNotExpectedSoon(); |
| 336 } |
| 394 | 337 |
| 395 private: | 338 private: |
| 396 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) | 339 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) |
| 397 : test_hooks_(test_hooks) {} | 340 : test_hooks_(test_hooks) {} |
| 398 | 341 |
| 399 TestHooks* test_hooks_; | 342 TestHooks* test_hooks_; |
| 400 }; | 343 }; |
| 401 | 344 |
| 402 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. | 345 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. |
| 403 class LayerTreeHostForTesting : public LayerTreeHost { | 346 class LayerTreeHostForTesting : public LayerTreeHost { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 425 | 368 |
| 426 params.animation_host = | 369 params.animation_host = |
| 427 AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 370 AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
| 428 std::unique_ptr<LayerTreeHostForTesting> layer_tree_host( | 371 std::unique_ptr<LayerTreeHostForTesting> layer_tree_host( |
| 429 new LayerTreeHostForTesting(test_hooks, ¶ms, mode)); | 372 new LayerTreeHostForTesting(test_hooks, ¶ms, mode)); |
| 430 std::unique_ptr<TaskRunnerProvider> task_runner_provider = | 373 std::unique_ptr<TaskRunnerProvider> task_runner_provider = |
| 431 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 374 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
| 432 std::unique_ptr<Proxy> proxy; | 375 std::unique_ptr<Proxy> proxy; |
| 433 switch (mode) { | 376 switch (mode) { |
| 434 case CompositorMode::SINGLE_THREADED: | 377 case CompositorMode::SINGLE_THREADED: |
| 435 proxy = SingleThreadProxyForTest::Create(test_hooks, | 378 proxy = SingleThreadProxy::Create(layer_tree_host.get(), client, |
| 436 layer_tree_host.get(), client, | 379 task_runner_provider.get()); |
| 437 task_runner_provider.get()); | |
| 438 break; | 380 break; |
| 439 case CompositorMode::THREADED: | 381 case CompositorMode::THREADED: |
| 440 DCHECK(impl_task_runner.get()); | 382 DCHECK(impl_task_runner.get()); |
| 441 proxy = ProxyMainForTest::CreateThreaded( | 383 proxy = ProxyMain::CreateThreaded(layer_tree_host.get(), |
| 442 test_hooks, layer_tree_host.get(), task_runner_provider.get()); | 384 task_runner_provider.get()); |
| 443 break; | 385 break; |
| 444 case CompositorMode::REMOTE: | 386 case CompositorMode::REMOTE: |
| 445 DCHECK(!external_begin_frame_source); | 387 DCHECK(!external_begin_frame_source); |
| 446 // The Remote LayerTreeHost on the client has the impl task runner. | 388 // The Remote LayerTreeHost on the client has the impl task runner. |
| 447 if (task_runner_provider->HasImplThread()) { | 389 if (task_runner_provider->HasImplThread()) { |
| 448 proxy = RemoteChannelImplForTest::Create( | 390 proxy = base::MakeUnique<RemoteChannelImpl>( |
| 449 test_hooks, layer_tree_host.get(), remote_proto_channel, | 391 layer_tree_host.get(), remote_proto_channel, |
| 450 task_runner_provider.get()); | 392 task_runner_provider.get()); |
| 451 } else { | 393 } else { |
| 452 proxy = ProxyMainForTest::CreateRemote( | 394 proxy = ProxyMain::CreateRemote(remote_proto_channel, |
| 453 test_hooks, remote_proto_channel, layer_tree_host.get(), | 395 layer_tree_host.get(), |
| 454 task_runner_provider.get()); | 396 task_runner_provider.get()); |
| 455 | 397 |
| 456 // The LayerTreeHost on the server will never have an output surface. | 398 // The LayerTreeHost on the server will never have an output surface. |
| 457 // Set output_surface_lost_ to false by default. | 399 // Set output_surface_lost_ to false by default. |
| 458 layer_tree_host->SetOutputSurfaceLostForTesting(false); | 400 layer_tree_host->SetOutputSurfaceLostForTesting(false); |
| 459 } | 401 } |
| 460 break; | 402 break; |
| 461 } | 403 } |
| 462 layer_tree_host->InitializeForTesting( | 404 layer_tree_host->InitializeForTesting( |
| 463 std::move(task_runner_provider), std::move(proxy), | 405 std::move(task_runner_provider), std::move(proxy), |
| 464 std::move(external_begin_frame_source)); | 406 std::move(external_begin_frame_source)); |
| 465 return layer_tree_host; | 407 return layer_tree_host; |
| 466 } | 408 } |
| 467 | 409 |
| 468 std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 410 std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
| 469 LayerTreeHostImplClient* host_impl_client) override { | 411 LayerTreeHostImplClient* host_impl_client) override { |
| 470 return LayerTreeHostImplForTesting::Create( | 412 return LayerTreeHostImplForTesting::Create( |
| 471 test_hooks_, settings(), host_impl_client, task_runner_provider(), | 413 test_hooks_, settings(), host_impl_client, task_runner_provider(), |
| 472 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 414 shared_bitmap_manager(), gpu_memory_buffer_manager(), |
| 473 task_graph_runner(), rendering_stats_instrumentation()); | 415 task_graph_runner(), rendering_stats_instrumentation()); |
| 474 } | 416 } |
| 475 | 417 |
| 476 void SetNeedsCommit() override { | 418 void SetNeedsCommit() override { |
| 477 if (!test_started_) | 419 if (!test_started_) |
| 478 return; | 420 return; |
| 421 test_hooks_->DidSetNeedsCommit(); |
| 479 LayerTreeHost::SetNeedsCommit(); | 422 LayerTreeHost::SetNeedsCommit(); |
| 480 } | 423 } |
| 481 | 424 |
| 482 void SetNeedsUpdateLayers() override { | 425 void SetNeedsUpdateLayers() override { |
| 483 if (!test_started_) | 426 if (!test_started_) |
| 484 return; | 427 return; |
| 428 test_hooks_->DidSetNeedsUpdateLayers(); |
| 485 LayerTreeHost::SetNeedsUpdateLayers(); | 429 LayerTreeHost::SetNeedsUpdateLayers(); |
| 486 } | 430 } |
| 487 | 431 |
| 488 void set_test_started(bool started) { test_started_ = started; } | 432 void set_test_started(bool started) { test_started_ = started; } |
| 489 | 433 |
| 490 private: | 434 private: |
| 491 LayerTreeHostForTesting(TestHooks* test_hooks, | 435 LayerTreeHostForTesting(TestHooks* test_hooks, |
| 492 LayerTreeHost::InitParams* params, | 436 LayerTreeHost::InitParams* params, |
| 493 CompositorMode mode) | 437 CompositorMode mode) |
| 494 : LayerTreeHost(params, mode), | 438 : LayerTreeHost(params, mode), |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 return layer_tree_host_.get(); | 930 return layer_tree_host_.get(); |
| 987 } | 931 } |
| 988 | 932 |
| 989 LayerTreeHost* LayerTreeTest::remote_client_layer_tree_host() { | 933 LayerTreeHost* LayerTreeTest::remote_client_layer_tree_host() { |
| 990 DCHECK(!task_runner_provider() || task_runner_provider()->IsMainThread() || | 934 DCHECK(!task_runner_provider() || task_runner_provider()->IsMainThread() || |
| 991 task_runner_provider()->IsMainThreadBlocked()); | 935 task_runner_provider()->IsMainThreadBlocked()); |
| 992 DCHECK(IsRemoteTest()); | 936 DCHECK(IsRemoteTest()); |
| 993 return remote_client_layer_tree_host_.get(); | 937 return remote_client_layer_tree_host_.get(); |
| 994 } | 938 } |
| 995 | 939 |
| 996 ProxyMainForTest* LayerTreeTest::GetProxyMainForTest() const { | 940 ProxyMain* LayerTreeTest::GetProxyMain() const { |
| 997 DCHECK(HasImplThread()); | 941 DCHECK(HasImplThread()); |
| 998 return static_cast<ProxyMainForTest*>(proxy()); | 942 return static_cast<ProxyMain*>(proxy()); |
| 999 } | |
| 1000 | |
| 1001 ProxyImplForTest* LayerTreeTest::GetProxyImplForTest() const { | |
| 1002 DCHECK(HasImplThread()); | |
| 1003 | |
| 1004 if (IsRemoteTest()) { | |
| 1005 return GetRemoteChannelImplForTest()->proxy_impl_for_test(); | |
| 1006 } | |
| 1007 | |
| 1008 ProxyImplForTest* proxy_impl_for_test = | |
| 1009 GetThreadedChannelForTest()->proxy_impl_for_test(); | |
| 1010 | |
| 1011 // We check for null ProxyImpl since ProxyImpl exists in the ThreadedChannel | |
| 1012 // only after it is initialized. | |
| 1013 DCHECK(proxy_impl_for_test); | |
| 1014 return proxy_impl_for_test; | |
| 1015 } | |
| 1016 | |
| 1017 ThreadedChannelForTest* LayerTreeTest::GetThreadedChannelForTest() const { | |
| 1018 DCHECK(mode_ == CompositorMode::THREADED); | |
| 1019 | |
| 1020 return GetProxyMainForTest()->threaded_channel_for_test(); | |
| 1021 } | |
| 1022 | |
| 1023 RemoteChannelImplForTest* LayerTreeTest::GetRemoteChannelImplForTest() const { | |
| 1024 DCHECK(IsRemoteTest()); | |
| 1025 DCHECK(remote_client_layer_tree_host_); | |
| 1026 | |
| 1027 return static_cast<RemoteChannelImplForTest*>( | |
| 1028 remote_client_layer_tree_host_->proxy()); | |
| 1029 } | 943 } |
| 1030 | 944 |
| 1031 } // namespace cc | 945 } // namespace cc |
| OLD | NEW |