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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 1109203004: SetNeedsAnimate Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/single_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/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index b9f6a4849131dfa14431b6f7a0b48dd4fe81fab9..5fcddc50c30196714f3f4aa2abf1962311997bb8 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -47,6 +47,7 @@ SingleThreadProxy::SingleThreadProxy(
next_frame_is_newly_committed_frame_(false),
inside_draw_(false),
defer_commits_(false),
+ animate_requested_(false),
commit_requested_(false),
inside_synchronous_composite_(false),
output_surface_creation_requested_(false),
@@ -178,7 +179,13 @@ void SingleThreadProxy::SetNeedsAnimate() {
TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsAnimate");
DCHECK(Proxy::IsMainThread());
client_->ScheduleAnimation();
- SetNeedsCommit();
+ if (animate_requested_) {
+ return;
+ }
+ DebugScopedSetImplThread impl(this);
+ if (scheduler_on_impl_thread_)
+ scheduler_on_impl_thread_->SetNeedsCommit();
+ animate_requested_ = true;
}
void SingleThreadProxy::SetNeedsUpdateLayers() {
@@ -809,6 +816,7 @@ void SingleThreadProxy::SendBeginMainFrameNotExpectedSoon() {
void SingleThreadProxy::BeginMainFrame() {
commit_requested_ = false;
+ animate_requested_ = false;
if (defer_commits_) {
TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit",
@@ -837,7 +845,9 @@ void SingleThreadProxy::BeginMainFrame() {
return;
}
- // Prevent new commits from being requested inside DoBeginMainFrame.
+ // Prevent new commits from being requested inside DoBeginMainFrame. But don't
+ // do the same for animate_requested_ because animations can request a new
+ // frame inside of the commit.
commit_requested_ = true;
const BeginFrameArgs& begin_frame_args =
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698