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

Unified Diff: cc/trees/thread_proxy.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove unnecessary whitespace delta Created 6 years, 8 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index e84937b41915d5f81f7f8cf2d9fffe14e6e130eb..cac9bc6f94bceb2034e60448a4415b633a496dde 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -433,9 +433,18 @@ void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() {
impl().scheduler->DidLoseOutputSurface();
}
-void ThreadProxy::OnSwapBuffersCompleteOnImplThread() {
- TRACE_EVENT0("cc", "ThreadProxy::OnSwapBuffersCompleteOnImplThread");
+void ThreadProxy::SetMaxSwapsPendingOnImplThread(int max) {
danakj 2014/04/17 15:05:39 +enne FYI: STP will need to do this also.
+ impl().scheduler->SetMaxSwapsPending(max);
+}
+
+void ThreadProxy::DidSwapBuffersOnImplThread() {
+ impl().scheduler->DidSwapBuffers();
+}
+
+void ThreadProxy::DidSwapBuffersCompleteOnImplThread() {
+ TRACE_EVENT0("cc", "ThreadProxy::DidSwapBuffersCompleteOnImplThread");
DCHECK(IsImplThread());
+ impl().scheduler->DidSwapBuffersComplete();
Proxy::MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_));
@@ -1237,10 +1246,10 @@ DrawSwapReadbackResult ThreadProxy::DrawSwapReadbackInternal(
impl().readback_request = NULL;
} else if (draw_frame) {
DCHECK(swap_requested);
- result.did_swap = impl().layer_tree_host_impl->SwapBuffers(frame);
+ result.did_request_swap = impl().layer_tree_host_impl->SwapBuffers(frame);
// We don't know if we have incomplete tiles if we didn't actually swap.
- if (result.did_swap) {
+ if (result.did_request_swap) {
DCHECK(!frame.has_no_damage);
SetSwapUsedIncompleteTileOnImplThread(frame.contains_incomplete_tile);
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698