| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 client_->DidPostSwapBuffers(); | 424 client_->DidPostSwapBuffers(); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { | 427 void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
| 428 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 428 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
| 429 if (scheduler_on_impl_thread_) | 429 if (scheduler_on_impl_thread_) |
| 430 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 430 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
| 431 layer_tree_host_->DidCompleteSwapBuffers(); | 431 layer_tree_host_->DidCompleteSwapBuffers(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void SingleThreadProxy::BeginFrame(const BeginFrameArgs& args) { | |
| 435 TRACE_EVENT0("cc", "SingleThreadProxy::BeginFrame"); | |
| 436 if (scheduler_on_impl_thread_) | |
| 437 scheduler_on_impl_thread_->BeginFrame(args); | |
| 438 } | |
| 439 | |
| 440 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 434 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
| 441 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); | 435 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); |
| 442 DCHECK(Proxy::IsMainThread()); | 436 DCHECK(Proxy::IsMainThread()); |
| 443 DCHECK(!layer_tree_host_->output_surface_lost()); | 437 DCHECK(!layer_tree_host_->output_surface_lost()); |
| 444 | 438 |
| 445 BeginFrameArgs begin_frame_args = BeginFrameArgs::Create( | 439 BeginFrameArgs begin_frame_args = BeginFrameArgs::Create( |
| 446 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval()); | 440 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval()); |
| 447 DoCommit(begin_frame_args); | 441 DoCommit(begin_frame_args); |
| 448 | 442 |
| 449 LayerTreeHostImpl::FrameData frame; | 443 LayerTreeHostImpl::FrameData frame; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 DebugScopedSetMainThread main(this); | 544 DebugScopedSetMainThread main(this); |
| 551 next_frame_is_newly_committed_frame_ = false; | 545 next_frame_is_newly_committed_frame_ = false; |
| 552 layer_tree_host_->DidCommitAndDrawFrame(); | 546 layer_tree_host_->DidCommitAndDrawFrame(); |
| 553 } | 547 } |
| 554 } | 548 } |
| 555 | 549 |
| 556 bool SingleThreadProxy::MainFrameWillHappenForTesting() { | 550 bool SingleThreadProxy::MainFrameWillHappenForTesting() { |
| 557 return false; | 551 return false; |
| 558 } | 552 } |
| 559 | 553 |
| 560 void SingleThreadProxy::SetNeedsBeginFrame(bool enable) { | 554 BeginFrameSource* SingleThreadProxy::ExternalBeginFrameSource() { |
| 561 layer_tree_host_impl_->SetNeedsBeginFrame(enable); | 555 return layer_tree_host_impl_.get(); |
| 562 } | 556 } |
| 563 | 557 |
| 564 void SingleThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) { | 558 void SingleThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) { |
| 565 layer_tree_host_impl_->WillBeginImplFrame(args); | 559 layer_tree_host_impl_->WillBeginImplFrame(args); |
| 566 } | 560 } |
| 567 | 561 |
| 568 void SingleThreadProxy::ScheduledActionSendBeginMainFrame() { | 562 void SingleThreadProxy::ScheduledActionSendBeginMainFrame() { |
| 569 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionSendBeginMainFrame"); | 563 TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionSendBeginMainFrame"); |
| 570 // Although this proxy is single-threaded, it's problematic to synchronously | 564 // Although this proxy is single-threaded, it's problematic to synchronously |
| 571 // have BeginMainFrame happen after ScheduledActionSendBeginMainFrame. This | 565 // have BeginMainFrame happen after ScheduledActionSendBeginMainFrame. This |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 | 683 |
| 690 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 684 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 691 return timing_history_.CommitToActivateDurationEstimate(); | 685 return timing_history_.CommitToActivateDurationEstimate(); |
| 692 } | 686 } |
| 693 | 687 |
| 694 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 688 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 695 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 689 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 696 } | 690 } |
| 697 | 691 |
| 698 } // namespace cc | 692 } // namespace cc |
| OLD | NEW |