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()); |