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

Unified Diff: cc/trees/thread_proxy.cc

Issue 423773002: Unified BeginFrame scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working on aura with --enable-begin-frame-scheduling Created 6 years, 4 months 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
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 1145ad48e786ccb1745b6005e51551e702b36362..90ad56c33973bf9c2ccb807ca41487ca0f18af9c 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -93,6 +93,7 @@ ThreadProxy::MainThreadOnly::MainThreadOnly(ThreadProxy* proxy,
animate_requested(false),
commit_requested(false),
commit_request_sent_to_impl_thread(false),
+ begin_frame_requested(false),
started(false),
manage_tiles_pending(false),
can_cancel_commit(true),
@@ -1188,6 +1189,22 @@ void ThreadProxy::DidBeginImplFrameDeadline() {
impl().layer_tree_host_impl->ResetCurrentFrameTimeForNextFrame();
}
+void ThreadProxy::SendBeginFrame(const BeginFrameArgs& args) {
+ DCHECK(IsImplThread());
+ Proxy::MainThreadTaskRunner()->PostTask(
brianderson 2014/08/21 00:14:00 It would be nice if we could send directly Rendere
simonhong 2014/08/21 00:36:49 Is ChromeOS also a target for SingleThreadProxy? I
simonhong 2014/08/26 08:24:48 This also removed.
+ FROM_HERE,
+ base::Bind(&ThreadProxy::SendBeginFrameOnMainThread,
+ main_thread_weak_ptr_,
+ args));
+}
+
+void ThreadProxy::SendBeginFrameOnMainThread(const BeginFrameArgs& args) {
+ DCHECK(IsMainThread());
+ DCHECK(main().begin_frame_requested);
+ main().begin_frame_requested = false;
+ layer_tree_host()->SendBeginFrame(args);
+}
+
void ThreadProxy::ReadyToFinalizeTextureUpdates() {
DCHECK(IsImplThread());
impl().scheduler->NotifyReadyToCommit();
@@ -1336,6 +1353,25 @@ bool ThreadProxy::CommitPendingForTesting() {
return commit_pending_request.commit_pending;
}
+void ThreadProxy::BeginFrameRequested() {
+ DCHECK(IsMainThread());
+ if (main().begin_frame_requested)
+ return;
+
+ main().begin_frame_requested = true;
+
+ TRACE_EVENT0("cc", "ThreadProxy::BeginFrameRequested");
+ Proxy::ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::BeginFrameRequestedOnImplThread,
+ impl_thread_weak_ptr_));
+}
+
+void ThreadProxy::BeginFrameRequestedOnImplThread() const {
+ DCHECK(IsImplThread());
+ impl().scheduler->BeginFrameRequested();
+}
+
void ThreadProxy::CommitPendingOnImplThreadForTesting(
CommitPendingRequest* request) {
DCHECK(IsImplThread());

Powered by Google App Engine
This is Rietveld 408576698