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( |
| 59 std::unique_ptr<LayerTreeMutator> mutator) { |
| 60 ImplThreadTaskRunner()->PostTask( |
| 61 FROM_HERE, |
| 62 base::Bind(&ProxyImpl::InitializeMutatorOnImpl, proxy_impl_weak_ptr_, |
| 63 base::Passed(std::move(mutator)))); |
| 64 } |
| 65 |
57 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { | 66 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { |
58 DCHECK(IsMainThread()); | 67 DCHECK(IsMainThread()); |
59 ImplThreadTaskRunner()->PostTask( | 68 ImplThreadTaskRunner()->PostTask( |
60 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, | 69 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, |
61 proxy_impl_weak_ptr_)); | 70 proxy_impl_weak_ptr_)); |
62 } | 71 } |
63 | 72 |
64 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { | 73 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { |
65 DCHECK(IsMainThread()); | 74 DCHECK(IsMainThread()); |
66 ImplThreadTaskRunner()->PostTask( | 75 ImplThreadTaskRunner()->PostTask( |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 352 |
344 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} | 353 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} |
345 | 354 |
346 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( | 355 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( |
347 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) | 356 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) |
348 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} | 357 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} |
349 | 358 |
350 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} | 359 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} |
351 | 360 |
352 } // namespace cc | 361 } // namespace cc |
OLD | NEW |