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/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
11 | 12 |
12 namespace cc { | 13 namespace cc { |
13 | 14 |
14 ThreadedChannel::ThreadedChannel(ProxyMain* proxy_main, | 15 ThreadedChannel::ThreadedChannel(ProxyMain* proxy_main, |
15 TaskRunnerProvider* task_runner_provider) | 16 TaskRunnerProvider* task_runner_provider) |
16 : task_runner_provider_(task_runner_provider), | 17 : task_runner_provider_(task_runner_provider), |
17 main_thread_only_vars_unsafe_(proxy_main), | 18 main_thread_only_vars_unsafe_(proxy_main), |
18 compositor_thread_vars_unsafe_( | 19 compositor_thread_vars_unsafe_( |
19 main() | 20 main() |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 impl().proxy_main_weak_ptr)); | 208 impl().proxy_main_weak_ptr)); |
208 } | 209 } |
209 | 210 |
210 void ThreadedChannel::DidCommitAndDrawFrame() { | 211 void ThreadedChannel::DidCommitAndDrawFrame() { |
211 DCHECK(IsImplThread()); | 212 DCHECK(IsImplThread()); |
212 MainThreadTaskRunner()->PostTask(FROM_HERE, | 213 MainThreadTaskRunner()->PostTask(FROM_HERE, |
213 base::Bind(&ProxyMain::DidCommitAndDrawFrame, | 214 base::Bind(&ProxyMain::DidCommitAndDrawFrame, |
214 impl().proxy_main_weak_ptr)); | 215 impl().proxy_main_weak_ptr)); |
215 } | 216 } |
216 | 217 |
217 void ThreadedChannel::SetAnimationEvents( | 218 void ThreadedChannel::SetAnimationEvents(scoped_ptr<AnimationEvents> events) { |
218 scoped_ptr<AnimationEventsVector> queue) { | |
219 DCHECK(IsImplThread()); | 219 DCHECK(IsImplThread()); |
220 MainThreadTaskRunner()->PostTask( | 220 MainThreadTaskRunner()->PostTask( |
221 FROM_HERE, base::Bind(&ProxyMain::SetAnimationEvents, | 221 FROM_HERE, base::Bind(&ProxyMain::SetAnimationEvents, |
222 impl().proxy_main_weak_ptr, base::Passed(&queue))); | 222 impl().proxy_main_weak_ptr, base::Passed(&events))); |
223 } | 223 } |
224 | 224 |
225 void ThreadedChannel::DidLoseOutputSurface() { | 225 void ThreadedChannel::DidLoseOutputSurface() { |
226 DCHECK(IsImplThread()); | 226 DCHECK(IsImplThread()); |
227 MainThreadTaskRunner()->PostTask( | 227 MainThreadTaskRunner()->PostTask( |
228 FROM_HERE, | 228 FROM_HERE, |
229 base::Bind(&ProxyMain::DidLoseOutputSurface, impl().proxy_main_weak_ptr)); | 229 base::Bind(&ProxyMain::DidLoseOutputSurface, impl().proxy_main_weak_ptr)); |
230 } | 230 } |
231 | 231 |
232 void ThreadedChannel::RequestNewOutputSurface() { | 232 void ThreadedChannel::RequestNewOutputSurface() { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} | 363 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} |
364 | 364 |
365 scoped_ptr<ThreadedChannel> ThreadedChannel::Create( | 365 scoped_ptr<ThreadedChannel> ThreadedChannel::Create( |
366 ProxyMain* proxy_main, | 366 ProxyMain* proxy_main, |
367 TaskRunnerProvider* task_runner_provider) { | 367 TaskRunnerProvider* task_runner_provider) { |
368 return make_scoped_ptr(new ThreadedChannel(proxy_main, task_runner_provider)); | 368 return make_scoped_ptr(new ThreadedChannel(proxy_main, task_runner_provider)); |
369 } | 369 } |
370 | 370 |
371 } // namespace cc | 371 } // namespace cc |
OLD | NEW |