OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.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/debug/benchmark_instrumentation.h" | 11 #include "cc/debug/benchmark_instrumentation.h" |
11 #include "cc/debug/devtools_instrumentation.h" | 12 #include "cc/debug/devtools_instrumentation.h" |
12 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
13 #include "cc/output/output_surface.h" | 14 #include "cc/output/output_surface.h" |
14 #include "cc/quads/draw_quad.h" | 15 #include "cc/quads/draw_quad.h" |
15 #include "cc/scheduler/commit_earlyout_reason.h" | 16 #include "cc/scheduler/commit_earlyout_reason.h" |
16 #include "cc/scheduler/compositor_timing_history.h" | 17 #include "cc/scheduler/compositor_timing_history.h" |
17 #include "cc/scheduler/scheduler.h" | 18 #include "cc/scheduler/scheduler.h" |
18 #include "cc/trees/layer_tree_host.h" | 19 #include "cc/trees/layer_tree_host.h" |
19 #include "cc/trees/layer_tree_host_single_thread_client.h" | 20 #include "cc/trees/layer_tree_host_single_thread_client.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 409 |
409 void SingleThreadProxy::SetVideoNeedsBeginFrames(bool needs_begin_frames) { | 410 void SingleThreadProxy::SetVideoNeedsBeginFrames(bool needs_begin_frames) { |
410 TRACE_EVENT1("cc", "SingleThreadProxy::SetVideoNeedsBeginFrames", | 411 TRACE_EVENT1("cc", "SingleThreadProxy::SetVideoNeedsBeginFrames", |
411 "needs_begin_frames", needs_begin_frames); | 412 "needs_begin_frames", needs_begin_frames); |
412 // In tests the layer tree is destroyed after the scheduler is. | 413 // In tests the layer tree is destroyed after the scheduler is. |
413 if (scheduler_on_impl_thread_) | 414 if (scheduler_on_impl_thread_) |
414 scheduler_on_impl_thread_->SetVideoNeedsBeginFrames(needs_begin_frames); | 415 scheduler_on_impl_thread_->SetVideoNeedsBeginFrames(needs_begin_frames); |
415 } | 416 } |
416 | 417 |
417 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 418 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
418 scoped_ptr<AnimationEventsVector> events) { | 419 scoped_ptr<AnimationEvents> events) { |
419 TRACE_EVENT0( | 420 TRACE_EVENT0( |
420 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 421 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
421 DCHECK(task_runner_provider_->IsImplThread()); | 422 DCHECK(task_runner_provider_->IsImplThread()); |
422 DebugScopedSetMainThread main(task_runner_provider_); | 423 DebugScopedSetMainThread main(task_runner_provider_); |
423 layer_tree_host_->SetAnimationEvents(std::move(events)); | 424 layer_tree_host_->SetAnimationEvents(std::move(events)); |
424 } | 425 } |
425 | 426 |
426 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } | 427 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } |
427 | 428 |
428 void SingleThreadProxy::DidActivateSyncTree() { | 429 void SingleThreadProxy::DidActivateSyncTree() { |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 << "DidFinishImplFrame called while not inside an impl frame!"; | 874 << "DidFinishImplFrame called while not inside an impl frame!"; |
874 inside_impl_frame_ = false; | 875 inside_impl_frame_ = false; |
875 #endif | 876 #endif |
876 } | 877 } |
877 | 878 |
878 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 879 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
879 layer_tree_host_->SendBeginFramesToChildren(args); | 880 layer_tree_host_->SendBeginFramesToChildren(args); |
880 } | 881 } |
881 | 882 |
882 } // namespace cc | 883 } // namespace cc |
OLD | NEW |