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/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 451 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
452 SetNeedsRedrawOnImplThread(); | 452 SetNeedsRedrawOnImplThread(); |
453 } | 453 } |
454 | 454 |
455 void SingleThreadProxy::SetNeedsCommitOnImplThread() { | 455 void SingleThreadProxy::SetNeedsCommitOnImplThread() { |
456 client_->ScheduleComposite(); | 456 client_->ScheduleComposite(); |
457 if (scheduler_on_impl_thread_) | 457 if (scheduler_on_impl_thread_) |
458 scheduler_on_impl_thread_->SetNeedsCommit(); | 458 scheduler_on_impl_thread_->SetNeedsCommit(); |
459 } | 459 } |
460 | 460 |
| 461 void SingleThreadProxy::SetVideoNeedsBeginFrames(bool needs_begin_frames) { |
| 462 TRACE_EVENT1("cc", "SingleThreadProxy::SetVideoNeedsBeginFrames", |
| 463 "needs_begin_frames", needs_begin_frames); |
| 464 // In tests the layer tree is destroyed after the scheduler is. |
| 465 if (scheduler_on_impl_thread_) |
| 466 scheduler_on_impl_thread_->SetVideoNeedsBeginFrames(needs_begin_frames); |
| 467 } |
| 468 |
461 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 469 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
462 scoped_ptr<AnimationEventsVector> events) { | 470 scoped_ptr<AnimationEventsVector> events) { |
463 TRACE_EVENT0( | 471 TRACE_EVENT0( |
464 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 472 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
465 DCHECK(Proxy::IsImplThread()); | 473 DCHECK(Proxy::IsImplThread()); |
466 DebugScopedSetMainThread main(this); | 474 DebugScopedSetMainThread main(this); |
467 layer_tree_host_->SetAnimationEvents(events.Pass()); | 475 layer_tree_host_->SetAnimationEvents(events.Pass()); |
468 } | 476 } |
469 | 477 |
470 bool SingleThreadProxy::ReduceContentsTextureMemoryOnImplThread( | 478 bool SingleThreadProxy::ReduceContentsTextureMemoryOnImplThread( |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 | 948 |
941 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 949 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
942 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 950 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
943 } | 951 } |
944 | 952 |
945 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 953 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
946 layer_tree_host_->SendBeginFramesToChildren(args); | 954 layer_tree_host_->SendBeginFramesToChildren(args); |
947 } | 955 } |
948 | 956 |
949 } // namespace cc | 957 } // namespace cc |
OLD | NEW |