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

Unified Diff: cc/trees/thread_proxy.cc

Issue 178123003: Make it possible to cancel commits following an animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cc_perftests failure. Make unit test limits stricter. Created 6 years, 10 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 ab45c3e1de63ff13d0977086dc235484e5586d79..8f19578ad0773913e2ad422db91531f879890cf3 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -381,7 +381,7 @@ void ThreadProxy::SetNeedsAnimate() {
TRACE_EVENT0("cc", "ThreadProxy::SetNeedsAnimate");
main().animate_requested = true;
- main().can_cancel_commit = false;
+ main().can_cancel_commit = true;
SendCommitRequestToImplThreadIfNeeded();
}
@@ -911,6 +911,17 @@ void ThreadProxy::BeginMainFrame(
layer_tree_host()->WillCommit();
+ // Before calling animate, we set main().animate_requested to false. If it is
+ // true now, it means SetNeedAnimate was called again, but during a state when
+ // main().commit_request_sent_to_impl_thread = true. We need to force that
+ // call to happen again now so that the commit request is sent to the impl
+ // thread.
+ if (main().animate_requested) {
+ // Forces SetNeedsAnimate to consider posting a commit task.
+ main().animate_requested = false;
+ SetNeedsAnimate();
+ }
+
if (!updated && can_cancel_this_commit) {
TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD);
bool did_handle = true;
@@ -928,18 +939,6 @@ void ThreadProxy::BeginMainFrame(
return;
}
- // Before calling animate, we set main().animate_requested to false. If it is
- // true
- // now, it means SetNeedAnimate was called again, but during a state when
- // main().commit_request_sent_to_impl_thread = true. We need to force that
- // call to
- // happen again now so that the commit request is sent to the impl thread.
- if (main().animate_requested) {
- // Forces SetNeedsAnimate to consider posting a commit task.
- main().animate_requested = false;
- SetNeedsAnimate();
- }
-
scoped_refptr<ContextProvider> offscreen_context_provider;
if (main().renderer_capabilities_main_thread_copy.using_offscreen_context3d &&
layer_tree_host()->needs_offscreen_context()) {

Powered by Google App Engine
This is Rietveld 408576698