| 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/trees/threaded_channel.h" | 5 #include "cc/trees/threaded_channel.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.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 "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "cc/animation/animation_events.h" | 11 #include "cc/animation/animation_events.h" |
| 12 #include "cc/animation/layer_tree_mutator.h" |
| 12 #include "cc/trees/layer_tree_host.h" | 13 #include "cc/trees/layer_tree_host.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 std::unique_ptr<ThreadedChannel> ThreadedChannel::Create( | 17 std::unique_ptr<ThreadedChannel> ThreadedChannel::Create( |
| 17 ProxyMain* proxy_main, | 18 ProxyMain* proxy_main, |
| 18 TaskRunnerProvider* task_runner_provider) { | 19 TaskRunnerProvider* task_runner_provider) { |
| 19 return base::WrapUnique( | 20 return base::WrapUnique( |
| 20 new ThreadedChannel(proxy_main, task_runner_provider)); | 21 new ThreadedChannel(proxy_main, task_runner_provider)); |
| 21 } | 22 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 } | 48 } |
| 48 | 49 |
| 49 void ThreadedChannel::InitializeOutputSurfaceOnImpl( | 50 void ThreadedChannel::InitializeOutputSurfaceOnImpl( |
| 50 OutputSurface* output_surface) { | 51 OutputSurface* output_surface) { |
| 51 DCHECK(IsMainThread()); | 52 DCHECK(IsMainThread()); |
| 52 ImplThreadTaskRunner()->PostTask( | 53 ImplThreadTaskRunner()->PostTask( |
| 53 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl, | 54 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl, |
| 54 proxy_impl_weak_ptr_, output_surface)); | 55 proxy_impl_weak_ptr_, output_surface)); |
| 55 } | 56 } |
| 56 | 57 |
| 58 void ThreadedChannel::InitializeMutatorOnImpl(LayerTreeMutator* mutator) { |
| 59 ImplThreadTaskRunner()->PostTask( |
| 60 FROM_HERE, base::Bind(&ProxyImpl::InitializeMutatorOnImpl, |
| 61 proxy_impl_weak_ptr_, mutator)); |
| 62 } |
| 63 |
| 57 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { | 64 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { |
| 58 DCHECK(IsMainThread()); | 65 DCHECK(IsMainThread()); |
| 59 ImplThreadTaskRunner()->PostTask( | 66 ImplThreadTaskRunner()->PostTask( |
| 60 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, | 67 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, |
| 61 proxy_impl_weak_ptr_)); | 68 proxy_impl_weak_ptr_)); |
| 62 } | 69 } |
| 63 | 70 |
| 64 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { | 71 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { |
| 65 DCHECK(IsMainThread()); | 72 DCHECK(IsMainThread()); |
| 66 ImplThreadTaskRunner()->PostTask( | 73 ImplThreadTaskRunner()->PostTask( |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 361 |
| 355 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} | 362 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} |
| 356 | 363 |
| 357 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( | 364 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( |
| 358 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) | 365 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) |
| 359 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} | 366 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} |
| 360 | 367 |
| 361 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} | 368 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} |
| 362 | 369 |
| 363 } // namespace cc | 370 } // namespace cc |
| OLD | NEW |