| 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/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/animation/animation_events.h" | 10 #include "cc/animation/animation_events.h" |
| 11 #include "cc/animation/layer_tree_mutator.h" |
| 11 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 14 | 15 |
| 15 ThreadedChannel::ThreadedChannel(ProxyMain* proxy_main, | 16 ThreadedChannel::ThreadedChannel(ProxyMain* proxy_main, |
| 16 TaskRunnerProvider* task_runner_provider) | 17 TaskRunnerProvider* task_runner_provider) |
| 17 : task_runner_provider_(task_runner_provider), | 18 : task_runner_provider_(task_runner_provider), |
| 18 main_thread_only_vars_unsafe_(proxy_main), | 19 main_thread_only_vars_unsafe_(proxy_main), |
| 19 compositor_thread_vars_unsafe_( | 20 compositor_thread_vars_unsafe_( |
| 20 main() | 21 main() |
| (...skipping 25 matching lines...) Expand all Loading... |
| 46 } | 47 } |
| 47 | 48 |
| 48 void ThreadedChannel::InitializeOutputSurfaceOnImpl( | 49 void ThreadedChannel::InitializeOutputSurfaceOnImpl( |
| 49 OutputSurface* output_surface) { | 50 OutputSurface* output_surface) { |
| 50 DCHECK(IsMainThread()); | 51 DCHECK(IsMainThread()); |
| 51 ImplThreadTaskRunner()->PostTask( | 52 ImplThreadTaskRunner()->PostTask( |
| 52 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl, | 53 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl, |
| 53 proxy_impl_weak_ptr_, output_surface)); | 54 proxy_impl_weak_ptr_, output_surface)); |
| 54 } | 55 } |
| 55 | 56 |
| 57 void ThreadedChannel::InitializeMutatorOnImpl(LayerTreeMutator* mutator) { |
| 58 ImplThreadTaskRunner()->PostTask( |
| 59 FROM_HERE, base::Bind(&ProxyImpl::InitializeMutatorOnImpl, |
| 60 proxy_impl_weak_ptr_, mutator)); |
| 61 } |
| 62 |
| 56 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { | 63 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { |
| 57 DCHECK(IsMainThread()); | 64 DCHECK(IsMainThread()); |
| 58 ImplThreadTaskRunner()->PostTask( | 65 ImplThreadTaskRunner()->PostTask( |
| 59 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, | 66 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, |
| 60 proxy_impl_weak_ptr_)); | 67 proxy_impl_weak_ptr_)); |
| 61 } | 68 } |
| 62 | 69 |
| 63 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { | 70 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { |
| 64 DCHECK(IsMainThread()); | 71 DCHECK(IsMainThread()); |
| 65 ImplThreadTaskRunner()->PostTask( | 72 ImplThreadTaskRunner()->PostTask( |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 369 |
| 363 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} | 370 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} |
| 364 | 371 |
| 365 scoped_ptr<ThreadedChannel> ThreadedChannel::Create( | 372 scoped_ptr<ThreadedChannel> ThreadedChannel::Create( |
| 366 ProxyMain* proxy_main, | 373 ProxyMain* proxy_main, |
| 367 TaskRunnerProvider* task_runner_provider) { | 374 TaskRunnerProvider* task_runner_provider) { |
| 368 return make_scoped_ptr(new ThreadedChannel(proxy_main, task_runner_provider)); | 375 return make_scoped_ptr(new ThreadedChannel(proxy_main, task_runner_provider)); |
| 369 } | 376 } |
| 370 | 377 |
| 371 } // namespace cc | 378 } // namespace cc |
| OLD | NEW |