| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (scheduler_on_impl_thread_) | 358 if (scheduler_on_impl_thread_) |
| 359 scheduler_on_impl_thread_->SetNeedsManageTiles(); | 359 scheduler_on_impl_thread_->SetNeedsManageTiles(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( | 362 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( |
| 363 const gfx::Rect& damage_rect) { | 363 const gfx::Rect& damage_rect) { |
| 364 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 364 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
| 365 SetNeedsRedrawOnImplThread(); | 365 SetNeedsRedrawOnImplThread(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() { | |
| 369 TRACE_EVENT0("cc", "SingleThreadProxy::DidInitializeVisibleTileOnImplThread"); | |
| 370 if (scheduler_on_impl_thread_) | |
| 371 scheduler_on_impl_thread_->SetNeedsRedraw(); | |
| 372 } | |
| 373 | |
| 374 void SingleThreadProxy::SetNeedsCommitOnImplThread() { | 368 void SingleThreadProxy::SetNeedsCommitOnImplThread() { |
| 375 client_->ScheduleComposite(); | 369 client_->ScheduleComposite(); |
| 376 if (scheduler_on_impl_thread_) | 370 if (scheduler_on_impl_thread_) |
| 377 scheduler_on_impl_thread_->SetNeedsCommit(); | 371 scheduler_on_impl_thread_->SetNeedsCommit(); |
| 378 } | 372 } |
| 379 | 373 |
| 380 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 374 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
| 381 scoped_ptr<AnimationEventsVector> events) { | 375 scoped_ptr<AnimationEventsVector> events) { |
| 382 TRACE_EVENT0( | 376 TRACE_EVENT0( |
| 383 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 377 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 DebugScopedSetMainThread main(this); | 736 DebugScopedSetMainThread main(this); |
| 743 DoCommit(); | 737 DoCommit(); |
| 744 } | 738 } |
| 745 | 739 |
| 746 void SingleThreadProxy::ScheduledActionAnimate() { | 740 void SingleThreadProxy::ScheduledActionAnimate() { |
| 747 TRACE_EVENT0("cc", "ScheduledActionAnimate"); | 741 TRACE_EVENT0("cc", "ScheduledActionAnimate"); |
| 748 layer_tree_host_impl_->Animate( | 742 layer_tree_host_impl_->Animate( |
| 749 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); | 743 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
| 750 } | 744 } |
| 751 | 745 |
| 752 void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { | |
| 753 DebugScopedSetImplThread impl(this); | |
| 754 layer_tree_host_impl_->UpdateVisibleTiles(); | |
| 755 } | |
| 756 | |
| 757 void SingleThreadProxy::ScheduledActionActivateSyncTree() { | 746 void SingleThreadProxy::ScheduledActionActivateSyncTree() { |
| 758 DebugScopedSetImplThread impl(this); | 747 DebugScopedSetImplThread impl(this); |
| 759 layer_tree_host_impl_->ActivateSyncTree(); | 748 layer_tree_host_impl_->ActivateSyncTree(); |
| 760 } | 749 } |
| 761 | 750 |
| 762 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 751 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { |
| 763 DebugScopedSetMainThread main(this); | 752 DebugScopedSetMainThread main(this); |
| 764 DCHECK(scheduler_on_impl_thread_); | 753 DCHECK(scheduler_on_impl_thread_); |
| 765 // If possible, create the output surface in a post task. Synchronously | 754 // If possible, create the output surface in a post task. Synchronously |
| 766 // creating the output surface makes tests more awkward since this differs | 755 // creating the output surface makes tests more awkward since this differs |
| (...skipping 26 matching lines...) Expand all Loading... |
| 793 | 782 |
| 794 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 783 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 795 return timing_history_.CommitToActivateDurationEstimate(); | 784 return timing_history_.CommitToActivateDurationEstimate(); |
| 796 } | 785 } |
| 797 | 786 |
| 798 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 787 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 799 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 788 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 800 } | 789 } |
| 801 | 790 |
| 802 } // namespace cc | 791 } // namespace cc |
| OLD | NEW |