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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 1110183004: cc: Get BeginFrameArgs for STP::BeginMainFrame while inside an impl frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto master. 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 920dc15495abdb7be32b0ca26eb5abfb37e9cbbe..db409734a873587bc8fd73b254dea8e368cd6c65 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -45,6 +45,7 @@ SingleThreadProxy::SingleThreadProxy(
client_(client),
timing_history_(layer_tree_host->rendering_stats_instrumentation()),
next_frame_is_newly_committed_frame_(false),
+ inside_impl_frame_(false),
inside_draw_(false),
defer_commits_(false),
animate_requested_(false),
@@ -791,6 +792,9 @@ void SingleThreadProxy::SetAuthoritativeVSyncInterval(
}
void SingleThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) {
+ DCHECK(!inside_impl_frame_)
+ << "WillBeginImplFrame called while already inside an impl frame!";
+ inside_impl_frame_ = true;
layer_tree_host_impl_->WillBeginImplFrame(args);
}
@@ -803,17 +807,21 @@ void SingleThreadProxy::ScheduledActionSendBeginMainFrame() {
// fall on the next. Doing it asynchronously instead matches the semantics of
// ThreadProxy::SetNeedsCommit where SetNeedsCommit will not cause a
// synchronous commit.
+ DCHECK(inside_impl_frame_)
+ << "BeginMainFrame should only be sent inside a BeginImplFrame";
+ const BeginFrameArgs& begin_frame_args =
+ layer_tree_host_impl_->CurrentBeginFrameArgs();
+
MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&SingleThreadProxy::BeginMainFrame,
- weak_factory_.GetWeakPtr()));
+ FROM_HERE, base::Bind(&SingleThreadProxy::BeginMainFrame,
+ weak_factory_.GetWeakPtr(), begin_frame_args));
}
void SingleThreadProxy::SendBeginMainFrameNotExpectedSoon() {
layer_tree_host_->BeginMainFrameNotExpectedSoon();
}
-void SingleThreadProxy::BeginMainFrame() {
+void SingleThreadProxy::BeginMainFrame(const BeginFrameArgs& begin_frame_args) {
commit_requested_ = false;
animate_requested_ = false;
@@ -849,8 +857,6 @@ void SingleThreadProxy::BeginMainFrame() {
// a commit here.
commit_requested_ = true;
- const BeginFrameArgs& begin_frame_args =
- layer_tree_host_impl_->CurrentBeginFrameArgs();
DoBeginMainFrame(begin_frame_args);
}
@@ -969,6 +975,9 @@ base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() {
void SingleThreadProxy::DidBeginImplFrameDeadline() {
layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
+ DCHECK(inside_impl_frame_)
+ << "DidBeginImplFrameDeadline called while not inside an impl frame!";
+ inside_impl_frame_ = false;
}
void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& 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