| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); | 458 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersCompleteOnImplThread"); |
| 459 if (scheduler_on_impl_thread_) | 459 if (scheduler_on_impl_thread_) |
| 460 scheduler_on_impl_thread_->DidSwapBuffersComplete(); | 460 scheduler_on_impl_thread_->DidSwapBuffersComplete(); |
| 461 layer_tree_host_->DidCompleteSwapBuffers(); | 461 layer_tree_host_->DidCompleteSwapBuffers(); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { | 464 void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { |
| 465 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); | 465 TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); |
| 466 DCHECK(Proxy::IsMainThread()); | 466 DCHECK(Proxy::IsMainThread()); |
| 467 DCHECK(!layer_tree_host_->output_surface_lost()); | 467 DCHECK(!layer_tree_host_->output_surface_lost()); |
| 468 DCHECK(!layer_tree_host_impl_->settings().impl_side_painting) | |
| 469 << "Impl-side painting and synchronous compositing are not supported."; | |
| 470 | 468 |
| 471 { | 469 { |
| 472 BeginFrameArgs begin_frame_args( | 470 BeginFrameArgs begin_frame_args( |
| 473 BeginFrameArgs::Create(frame_begin_time, | 471 BeginFrameArgs::Create(frame_begin_time, |
| 474 base::TimeTicks(), | 472 base::TimeTicks(), |
| 475 BeginFrameArgs::DefaultInterval())); | 473 BeginFrameArgs::DefaultInterval())); |
| 476 DoBeginMainFrame(begin_frame_args); | 474 DoBeginMainFrame(begin_frame_args); |
| 477 DoCommit(); | 475 DoCommit(); |
| 478 | 476 |
| 479 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 477 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) |
| 480 << "Commit should always succeed and transfer promises."; | 478 << "Commit should always succeed and transfer promises."; |
| 481 } | 479 } |
| 482 | 480 |
| 483 { | 481 { |
| 484 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 482 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
| 483 if (layer_tree_host_impl_->settings().impl_side_painting) { |
| 484 DCHECK(layer_tree_host_impl_->settings().use_zero_copy); |
| 485 layer_tree_host_impl_->ActivateSyncTree(); |
| 486 layer_tree_host_impl_->active_tree()->UpdateDrawProperties(); |
| 487 layer_tree_host_impl_->ManageTiles(); |
| 488 layer_tree_host_impl_->tile_manager()->WaitForTasksToFinishRunning(); |
| 489 } |
| 490 |
| 485 LayerTreeHostImpl::FrameData frame; | 491 LayerTreeHostImpl::FrameData frame; |
| 486 DoComposite(frame_begin_time, &frame); | 492 DoComposite(frame_begin_time, &frame); |
| 487 | 493 |
| 488 // DoComposite could abort, but because this is a synchronous composite | 494 // DoComposite could abort, but because this is a synchronous composite |
| 489 // another draw will never be scheduled, so break remaining promises. | 495 // another draw will never be scheduled, so break remaining promises. |
| 490 layer_tree_host_impl_->active_tree()->BreakSwapPromises( | 496 layer_tree_host_impl_->active_tree()->BreakSwapPromises( |
| 491 SwapPromise::SWAP_FAILS); | 497 SwapPromise::SWAP_FAILS); |
| 492 } | 498 } |
| 493 } | 499 } |
| 494 | 500 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 | 780 |
| 775 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { | 781 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { |
| 776 return timing_history_.CommitToActivateDurationEstimate(); | 782 return timing_history_.CommitToActivateDurationEstimate(); |
| 777 } | 783 } |
| 778 | 784 |
| 779 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 785 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 780 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 786 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 781 } | 787 } |
| 782 | 788 |
| 783 } // namespace cc | 789 } // namespace cc |
| OLD | NEW |