| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 void SingleThreadProxy::NotifyReadyToDraw() { | 360 void SingleThreadProxy::NotifyReadyToDraw() { |
| 361 } | 361 } |
| 362 | 362 |
| 363 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { | 363 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { |
| 364 client_->ScheduleComposite(); | 364 client_->ScheduleComposite(); |
| 365 if (scheduler_on_impl_thread_) | 365 if (scheduler_on_impl_thread_) |
| 366 scheduler_on_impl_thread_->SetNeedsRedraw(); | 366 scheduler_on_impl_thread_->SetNeedsRedraw(); |
| 367 } | 367 } |
| 368 | 368 |
| 369 void SingleThreadProxy::OutputSurfaceDidRequestDraw() { |
| 370 TRACE_EVENT0("cc", "SingleThreadProxy::OutputSurfaceDidRequestDraw"); |
| 371 if (scheduler_on_impl_thread_) |
| 372 scheduler_on_impl_thread_->OutputSurfaceDidRequestDraw(); |
| 373 } |
| 374 |
| 369 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { | 375 void SingleThreadProxy::SetNeedsAnimateOnImplThread() { |
| 370 client_->ScheduleComposite(); | 376 client_->ScheduleComposite(); |
| 371 if (scheduler_on_impl_thread_) | 377 if (scheduler_on_impl_thread_) |
| 372 scheduler_on_impl_thread_->SetNeedsAnimate(); | 378 scheduler_on_impl_thread_->SetNeedsAnimate(); |
| 373 } | 379 } |
| 374 | 380 |
| 375 void SingleThreadProxy::SetNeedsPrepareTilesOnImplThread() { | 381 void SingleThreadProxy::SetNeedsPrepareTilesOnImplThread() { |
| 376 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsPrepareTilesOnImplThread"); | 382 TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsPrepareTilesOnImplThread"); |
| 377 if (scheduler_on_impl_thread_) | 383 if (scheduler_on_impl_thread_) |
| 378 scheduler_on_impl_thread_->SetNeedsPrepareTiles(); | 384 scheduler_on_impl_thread_->SetNeedsPrepareTiles(); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 777 } |
| 772 } | 778 } |
| 773 | 779 |
| 774 void SingleThreadProxy::ScheduledActionPrepareTiles() { | 780 void SingleThreadProxy::ScheduledActionPrepareTiles() { |
| 775 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); | 781 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionPrepareTiles"); |
| 776 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 782 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 777 DebugScopedSetImplThread impl(this); | 783 DebugScopedSetImplThread impl(this); |
| 778 layer_tree_host_impl_->PrepareTiles(); | 784 layer_tree_host_impl_->PrepareTiles(); |
| 779 } | 785 } |
| 780 | 786 |
| 787 void SingleThreadProxy::ScheduledActionInvalidateOutputSurface() { |
| 788 DCHECK(layer_tree_host_impl_->output_surface()); |
| 789 layer_tree_host_impl_->output_surface()->Invalidate(); |
| 790 } |
| 791 |
| 781 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { | 792 void SingleThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { |
| 782 } | 793 } |
| 783 | 794 |
| 784 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { | 795 base::TimeDelta SingleThreadProxy::DrawDurationEstimate() { |
| 785 return timing_history_.DrawDurationEstimate(); | 796 return timing_history_.DrawDurationEstimate(); |
| 786 } | 797 } |
| 787 | 798 |
| 788 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { | 799 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { |
| 789 return timing_history_.BeginMainFrameToCommitDurationEstimate(); | 800 return timing_history_.BeginMainFrameToCommitDurationEstimate(); |
| 790 } | 801 } |
| 791 | 802 |
| 792 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 803 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 793 return timing_history_.CommitToActivateDurationEstimate(); | 804 return timing_history_.CommitToActivateDurationEstimate(); |
| 794 } | 805 } |
| 795 | 806 |
| 796 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 807 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 797 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 808 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 798 } | 809 } |
| 799 | 810 |
| 800 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 811 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 801 layer_tree_host_->SendBeginFramesToChildren(args); | 812 layer_tree_host_->SendBeginFramesToChildren(args); |
| 802 } | 813 } |
| 803 | 814 |
| 804 } // namespace cc | 815 } // namespace cc |
| OLD | NEW |