| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 if (scheduler_on_impl_thread_) | 355 if (scheduler_on_impl_thread_) |
| 356 scheduler_on_impl_thread_->SetNeedsManageTiles(); | 356 scheduler_on_impl_thread_->SetNeedsManageTiles(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( | 359 void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( |
| 360 const gfx::Rect& damage_rect) { | 360 const gfx::Rect& damage_rect) { |
| 361 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 361 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
| 362 SetNeedsRedrawOnImplThread(); | 362 SetNeedsRedrawOnImplThread(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() { | |
| 366 TRACE_EVENT0("cc", "SingleThreadProxy::DidInitializeVisibleTileOnImplThread"); | |
| 367 if (scheduler_on_impl_thread_) | |
| 368 scheduler_on_impl_thread_->SetNeedsRedraw(); | |
| 369 } | |
| 370 | |
| 371 void SingleThreadProxy::SetNeedsCommitOnImplThread() { | 365 void SingleThreadProxy::SetNeedsCommitOnImplThread() { |
| 372 client_->ScheduleComposite(); | 366 client_->ScheduleComposite(); |
| 373 if (scheduler_on_impl_thread_) | 367 if (scheduler_on_impl_thread_) |
| 374 scheduler_on_impl_thread_->SetNeedsCommit(); | 368 scheduler_on_impl_thread_->SetNeedsCommit(); |
| 375 } | 369 } |
| 376 | 370 |
| 377 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 371 void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
| 378 scoped_ptr<AnimationEventsVector> events) { | 372 scoped_ptr<AnimationEventsVector> events) { |
| 379 TRACE_EVENT0( | 373 TRACE_EVENT0( |
| 380 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 374 "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 DebugScopedSetMainThread main(this); | 728 DebugScopedSetMainThread main(this); |
| 735 DoCommit(); | 729 DoCommit(); |
| 736 } | 730 } |
| 737 | 731 |
| 738 void SingleThreadProxy::ScheduledActionAnimate() { | 732 void SingleThreadProxy::ScheduledActionAnimate() { |
| 739 TRACE_EVENT0("cc", "ScheduledActionAnimate"); | 733 TRACE_EVENT0("cc", "ScheduledActionAnimate"); |
| 740 layer_tree_host_impl_->Animate( | 734 layer_tree_host_impl_->Animate( |
| 741 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); | 735 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
| 742 } | 736 } |
| 743 | 737 |
| 744 void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { | |
| 745 DebugScopedSetImplThread impl(this); | |
| 746 layer_tree_host_impl_->UpdateVisibleTiles(); | |
| 747 } | |
| 748 | |
| 749 void SingleThreadProxy::ScheduledActionActivateSyncTree() { | 738 void SingleThreadProxy::ScheduledActionActivateSyncTree() { |
| 750 DebugScopedSetImplThread impl(this); | 739 DebugScopedSetImplThread impl(this); |
| 751 layer_tree_host_impl_->ActivateSyncTree(); | 740 layer_tree_host_impl_->ActivateSyncTree(); |
| 752 } | 741 } |
| 753 | 742 |
| 754 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 743 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { |
| 755 DebugScopedSetMainThread main(this); | 744 DebugScopedSetMainThread main(this); |
| 756 DCHECK(scheduler_on_impl_thread_); | 745 DCHECK(scheduler_on_impl_thread_); |
| 757 // If possible, create the output surface in a post task. Synchronously | 746 // If possible, create the output surface in a post task. Synchronously |
| 758 // creating the output surface makes tests more awkward since this differs | 747 // creating the output surface makes tests more awkward since this differs |
| (...skipping 26 matching lines...) Expand all Loading... |
| 785 | 774 |
| 786 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 775 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 787 return timing_history_.CommitToActivateDurationEstimate(); | 776 return timing_history_.CommitToActivateDurationEstimate(); |
| 788 } | 777 } |
| 789 | 778 |
| 790 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 779 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 791 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 780 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 792 } | 781 } |
| 793 | 782 |
| 794 } // namespace cc | 783 } // namespace cc |
| OLD | NEW |