| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/trees/remote_channel_impl.h" | 5 #include "cc/trees/remote_channel_impl.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "cc/animation/animation_events.h" | 10 #include "cc/animation/animation_events.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 324 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
| 325 ImplThreadTaskRunner()->PostTask( | 325 ImplThreadTaskRunner()->PostTask( |
| 326 FROM_HERE, | 326 FROM_HERE, |
| 327 base::Bind(&ProxyImpl::MainFrameWillHappenOnImplForTesting, | 327 base::Bind(&ProxyImpl::MainFrameWillHappenOnImplForTesting, |
| 328 proxy_impl_weak_ptr_, &completion, &main_frame_will_happen)); | 328 proxy_impl_weak_ptr_, &completion, &main_frame_will_happen)); |
| 329 completion.Wait(); | 329 completion.Wait(); |
| 330 } | 330 } |
| 331 return main_frame_will_happen; | 331 return main_frame_will_happen; |
| 332 } | 332 } |
| 333 | 333 |
| 334 void RemoteChannelImpl::DidCompleteSwapBuffers() { | 334 void RemoteChannelImpl::DidCompleteSwapBuffers() {} |
| 335 DCHECK(task_runner_provider_->IsImplThread()); | |
| 336 MainThreadTaskRunner()->PostTask( | |
| 337 FROM_HERE, base::Bind(&RemoteChannelImpl::DidCompleteSwapBuffersOnMain, | |
| 338 impl().remote_channel_weak_ptr)); | |
| 339 } | |
| 340 | 335 |
| 341 void RemoteChannelImpl::SetRendererCapabilitiesMainCopy( | 336 void RemoteChannelImpl::SetRendererCapabilitiesMainCopy( |
| 342 const RendererCapabilities& capabilities) {} | 337 const RendererCapabilities& capabilities) {} |
| 343 | 338 |
| 344 void RemoteChannelImpl::BeginMainFrameNotExpectedSoon() {} | 339 void RemoteChannelImpl::BeginMainFrameNotExpectedSoon() {} |
| 345 | 340 |
| 346 void RemoteChannelImpl::DidCommitAndDrawFrame() {} | 341 void RemoteChannelImpl::DidCommitAndDrawFrame() {} |
| 347 | 342 |
| 348 void RemoteChannelImpl::SetAnimationEvents( | 343 void RemoteChannelImpl::SetAnimationEvents( |
| 349 std::unique_ptr<AnimationEvents> queue) {} | 344 std::unique_ptr<AnimationEvents> queue) {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void RemoteChannelImpl::SendMessageProto( | 391 void RemoteChannelImpl::SendMessageProto( |
| 397 std::unique_ptr<proto::CompositorMessage> proto) { | 392 std::unique_ptr<proto::CompositorMessage> proto) { |
| 398 DCHECK(task_runner_provider_->IsImplThread()); | 393 DCHECK(task_runner_provider_->IsImplThread()); |
| 399 | 394 |
| 400 MainThreadTaskRunner()->PostTask( | 395 MainThreadTaskRunner()->PostTask( |
| 401 FROM_HERE, | 396 FROM_HERE, |
| 402 base::Bind(&RemoteChannelImpl::SendMessageProtoOnMain, | 397 base::Bind(&RemoteChannelImpl::SendMessageProtoOnMain, |
| 403 impl().remote_channel_weak_ptr, base::Passed(&proto))); | 398 impl().remote_channel_weak_ptr, base::Passed(&proto))); |
| 404 } | 399 } |
| 405 | 400 |
| 406 void RemoteChannelImpl::DidCompleteSwapBuffersOnMain() { | |
| 407 DCHECK(task_runner_provider_->IsMainThread()); | |
| 408 main().layer_tree_host->DidCompleteSwapBuffers(); | |
| 409 } | |
| 410 | |
| 411 void RemoteChannelImpl::DidLoseOutputSurfaceOnMain() { | 401 void RemoteChannelImpl::DidLoseOutputSurfaceOnMain() { |
| 412 DCHECK(task_runner_provider_->IsMainThread()); | 402 DCHECK(task_runner_provider_->IsMainThread()); |
| 413 | 403 |
| 414 main().layer_tree_host->DidLoseOutputSurface(); | 404 main().layer_tree_host->DidLoseOutputSurface(); |
| 415 } | 405 } |
| 416 | 406 |
| 417 void RemoteChannelImpl::RequestNewOutputSurfaceOnMain() { | 407 void RemoteChannelImpl::RequestNewOutputSurfaceOnMain() { |
| 418 DCHECK(task_runner_provider_->IsMainThread()); | 408 DCHECK(task_runner_provider_->IsMainThread()); |
| 419 | 409 |
| 420 main().layer_tree_host->RequestNewOutputSurface(); | 410 main().layer_tree_host->RequestNewOutputSurface(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 528 |
| 539 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly( | 529 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly( |
| 540 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr) | 530 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr) |
| 541 : proxy_impl(nullptr), | 531 : proxy_impl(nullptr), |
| 542 proxy_impl_weak_factory(nullptr), | 532 proxy_impl_weak_factory(nullptr), |
| 543 remote_channel_weak_ptr(remote_channel_weak_ptr) {} | 533 remote_channel_weak_ptr(remote_channel_weak_ptr) {} |
| 544 | 534 |
| 545 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {} | 535 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {} |
| 546 | 536 |
| 547 } // namespace cc | 537 } // namespace cc |
| OLD | NEW |