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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1128253004: Revert of Let layoutAndPaintAsync() schedule commit asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « content/renderer/gpu/render_widget_compositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index df8674a24e1730b1cb2f621e17988549de0b1767..a4278915f223d818e6557068dc6d56b2933acf33 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -747,17 +747,10 @@
void RenderWidgetCompositor::ScheduleCommit() {
if (CommitIsSynchronous()) {
- base::MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronousCommit,
- weak_factory_.GetWeakPtr()));
+ layer_tree_host_->Composite(gfx::FrameTime::Now());
} else {
layer_tree_host_->SetNeedsCommit();
}
-}
-
-void RenderWidgetCompositor::SynchronousCommit() {
- DCHECK(CommitIsSynchronous());
- layer_tree_host_->Composite(gfx::FrameTime::Now());
}
void RenderWidgetCompositor::finishAllRendering() {
@@ -925,6 +918,20 @@
void RenderWidgetCompositor::WillCommit() {
if (!layout_and_paint_async_callback_)
return;
+
+ if (CommitIsSynchronous()) {
+ // The caller expects the callback to be called asynchronously.
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidgetCompositor::DidLayoutAndPaintAsync,
+ weak_factory_.GetWeakPtr()));
+ } else {
+ DidLayoutAndPaintAsync();
+ }
+}
+
+void RenderWidgetCompositor::DidLayoutAndPaintAsync() {
+ if (!layout_and_paint_async_callback_)
+ return;
layout_and_paint_async_callback_->didLayoutAndPaint();
layout_and_paint_async_callback_ = nullptr;
}
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698