| Index: cc/trees/single_thread_proxy.cc
|
| diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
|
| index 6498f0e0996ce49b310eb9a1c7a5d83bcfbfe4df..ff2ea9004141b4df8e91fc3de8bef8b2fde96f11 100644
|
| --- a/cc/trees/single_thread_proxy.cc
|
| +++ b/cc/trees/single_thread_proxy.cc
|
| @@ -12,6 +12,7 @@
|
| #include "cc/quads/draw_quad.h"
|
| #include "cc/resources/prioritized_resource_manager.h"
|
| #include "cc/resources/resource_update_controller.h"
|
| +#include "cc/scheduler/commit_earlyout_reason.h"
|
| #include "cc/trees/layer_tree_host.h"
|
| #include "cc/trees/layer_tree_host_single_thread_client.h"
|
| #include "cc/trees/layer_tree_impl.h"
|
| @@ -425,13 +426,7 @@ void SingleThreadProxy::DidActivateSyncTree() {
|
| // the pending tree is not actually ready in the SingleThreadProxy.
|
| layer_tree_host_impl_->SetRequiresHighResToDraw();
|
|
|
| - // Since activation could cause tasks to run, post CommitComplete
|
| - // separately so that it runs after these tasks. This is the loose
|
| - // equivalent of blocking commit until activation and also running
|
| - // all tasks posted during commit/activation before CommitComplete.
|
| - MainThreadTaskRunner()->PostTask(
|
| - FROM_HERE, base::Bind(&SingleThreadProxy::CommitComplete,
|
| - weak_factory_.GetWeakPtr()));
|
| + CommitComplete();
|
| }
|
|
|
| timing_history_.DidActivateSyncTree();
|
| @@ -463,6 +458,12 @@ void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() {
|
| scheduler_on_impl_thread_->DidLoseOutputSurface();
|
| }
|
|
|
| +void SingleThreadProxy::CommitVSyncParameters(base::TimeTicks timebase,
|
| + base::TimeDelta interval) {
|
| + if (scheduler_on_impl_thread_)
|
| + scheduler_on_impl_thread_->CommitVSyncParameters(timebase, interval);
|
| +}
|
| +
|
| void SingleThreadProxy::DidSwapBuffersOnImplThread() {
|
| TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersOnImplThread");
|
| if (scheduler_on_impl_thread_)
|
| @@ -671,14 +672,16 @@ void SingleThreadProxy::BeginMainFrame() {
|
|
|
| if (!layer_tree_host_->visible()) {
|
| TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD);
|
| - BeginMainFrameAbortedOnImplThread();
|
| + BeginMainFrameAbortedOnImplThread(
|
| + CommitEarlyOutReason::ABORTED_NOT_VISIBLE);
|
| return;
|
| }
|
|
|
| if (layer_tree_host_->output_surface_lost()) {
|
| TRACE_EVENT_INSTANT0(
|
| "cc", "EarlyOut_OutputSurfaceLost", TRACE_EVENT_SCOPE_THREAD);
|
| - BeginMainFrameAbortedOnImplThread();
|
| + BeginMainFrameAbortedOnImplThread(
|
| + CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST);
|
| return;
|
| }
|
|
|
| @@ -710,22 +713,23 @@ void SingleThreadProxy::DoBeginMainFrame(
|
|
|
| timing_history_.DidBeginMainFrame();
|
|
|
| + // TODO(enne): SingleThreadProxy does not support cancelling commits yet,
|
| + // search for CommitEarlyOutReason::FINISHED_NO_UPDATES inside
|
| + // thread_proxy.cc
|
| if (scheduler_on_impl_thread_) {
|
| scheduler_on_impl_thread_->NotifyBeginMainFrameStarted();
|
| scheduler_on_impl_thread_->NotifyReadyToCommit();
|
| }
|
| }
|
|
|
| -void SingleThreadProxy::BeginMainFrameAbortedOnImplThread() {
|
| +void SingleThreadProxy::BeginMainFrameAbortedOnImplThread(
|
| + CommitEarlyOutReason reason) {
|
| DebugScopedSetImplThread impl(this);
|
| DCHECK(scheduler_on_impl_thread_->CommitPending());
|
| DCHECK(!layer_tree_host_impl_->pending_tree());
|
|
|
| - // TODO(enne): SingleThreadProxy does not support cancelling commits yet so
|
| - // did_handle is always false.
|
| - bool did_handle = false;
|
| - layer_tree_host_impl_->BeginMainFrameAborted(did_handle);
|
| - scheduler_on_impl_thread_->BeginMainFrameAborted(did_handle);
|
| + layer_tree_host_impl_->BeginMainFrameAborted(reason);
|
| + scheduler_on_impl_thread_->BeginMainFrameAborted(reason);
|
| }
|
|
|
| DrawResult SingleThreadProxy::ScheduledActionDrawAndSwapIfPossible() {
|
|
|