Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6535)

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698