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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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') | cc/trees/thread_proxy.cc » ('j') | 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 1e422cacb7f0e147d251af4429a5c93fa79fb446..344dfb97f66df586e94ef01a0717426831627db9 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -41,6 +41,7 @@ SingleThreadProxy::SingleThreadProxy(
defer_commits_(false),
commit_was_deferred_(false),
commit_requested_(false),
+ inside_synchronous_composite_(false),
output_surface_creation_requested_(false),
weak_factory_(this) {
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
@@ -134,6 +135,8 @@ void SingleThreadProxy::SetOutputSurface(
if (success) {
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
+ else if (!inside_synchronous_composite_)
+ SetNeedsCommit();
} else if (Proxy::MainThreadTaskRunner()) {
ScheduleRequestNewOutputSurface();
}
@@ -464,9 +467,17 @@ void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() {
void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately");
DCHECK(Proxy::IsMainThread());
- DCHECK(!layer_tree_host_->output_surface_lost());
DCHECK(!layer_tree_host_impl_->settings().impl_side_painting)
<< "Impl-side painting and synchronous compositing are not supported.";
+ base::AutoReset<bool> inside_composite(&inside_synchronous_composite_, true);
+
+ if (layer_tree_host_->output_surface_lost()) {
+ RequestNewOutputSurface();
+ // RequestNewOutputSurface could have synchronously created an output
+ // surface, so check again before returning.
+ if (layer_tree_host_->output_surface_lost())
+ return;
+ }
{
BeginFrameArgs begin_frame_args(
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698