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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 DebugScopedSetMainThread main(this); | 733 DebugScopedSetMainThread main(this); |
740 DoCommit(); | 734 DoCommit(); |
741 } | 735 } |
742 | 736 |
743 void SingleThreadProxy::ScheduledActionAnimate() { | 737 void SingleThreadProxy::ScheduledActionAnimate() { |
744 TRACE_EVENT0("cc", "ScheduledActionAnimate"); | 738 TRACE_EVENT0("cc", "ScheduledActionAnimate"); |
745 layer_tree_host_impl_->Animate( | 739 layer_tree_host_impl_->Animate( |
746 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); | 740 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
747 } | 741 } |
748 | 742 |
749 void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { | |
750 DebugScopedSetImplThread impl(this); | |
751 layer_tree_host_impl_->UpdateVisibleTiles(); | |
752 } | |
753 | |
754 void SingleThreadProxy::ScheduledActionActivateSyncTree() { | 743 void SingleThreadProxy::ScheduledActionActivateSyncTree() { |
755 DebugScopedSetImplThread impl(this); | 744 DebugScopedSetImplThread impl(this); |
756 layer_tree_host_impl_->ActivateSyncTree(); | 745 layer_tree_host_impl_->ActivateSyncTree(); |
757 } | 746 } |
758 | 747 |
759 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 748 void SingleThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { |
760 DebugScopedSetMainThread main(this); | 749 DebugScopedSetMainThread main(this); |
761 DCHECK(scheduler_on_impl_thread_); | 750 DCHECK(scheduler_on_impl_thread_); |
762 // If possible, create the output surface in a post task. Synchronously | 751 // If possible, create the output surface in a post task. Synchronously |
763 // creating the output surface makes tests more awkward since this differs | 752 // creating the output surface makes tests more awkward since this differs |
(...skipping 26 matching lines...) Expand all Loading... |
790 | 779 |
791 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 780 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
792 return timing_history_.CommitToActivateDurationEstimate(); | 781 return timing_history_.CommitToActivateDurationEstimate(); |
793 } | 782 } |
794 | 783 |
795 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 784 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
796 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 785 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
797 } | 786 } |
798 | 787 |
799 } // namespace cc | 788 } // namespace cc |
OLD | NEW |