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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 1099703004: cc: Make SingleThreadProxy::CompositeImmediately match scheduler path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing review comments. 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 | « no previous file | 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 db409734a873587bc8fd73b254dea8e368cd6c65..b97b3ce889cb35186764c513476da9d17fbf1215 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -587,6 +587,7 @@ void SingleThreadProxy::OnDrawForOutputSurface() {
void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately");
DCHECK(Proxy::IsMainThread());
+ DCHECK(!inside_impl_frame_);
base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true);
if (layer_tree_host_->output_surface_lost()) {
@@ -597,10 +598,19 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
return;
}
+ BeginFrameArgs begin_frame_args(BeginFrameArgs::Create(
+ BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(),
+ BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL));
+
+ // Start the impl frame.
+ {
+ DebugScopedSetImplThread impl(this);
+ WillBeginImplFrame(begin_frame_args);
+ }
+
+ // Run the "main thread" and get it to commit.
{
- BeginFrameArgs begin_frame_args(BeginFrameArgs::Create(
- BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(),
- BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL));
+ DCHECK(inside_impl_frame_);
DoBeginMainFrame(begin_frame_args);
DoCommit();
@@ -608,8 +618,9 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
<< "Commit should always succeed and transfer promises.";
}
+ // Finish the impl frame.
{
- DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
+ DebugScopedSetImplThread impl(this);
if (layer_tree_host_impl_->settings().impl_side_painting) {
layer_tree_host_impl_->ActivateSyncTree();
DCHECK(!layer_tree_host_impl_->active_tree()
@@ -627,6 +638,8 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
// another draw will never be scheduled, so break remaining promises.
layer_tree_host_impl_->active_tree()->BreakSwapPromises(
SwapPromise::SWAP_FAILS);
+
+ DidBeginImplFrameDeadline();
}
}
@@ -717,12 +730,6 @@ DrawResult SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time,
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"461509 SingleThreadProxy::DoComposite5"));
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
- // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
- // is fixed.
- tracked_objects::ScopedTracker tracking_profile6(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "461509 SingleThreadProxy::DoComposite6"));
- layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
// TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
// is fixed.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698