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