Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 694fedbcd0909399627d73503f5d2f80ee47db33..f63daa72444d039d4a80d467415919388a865600 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1501,6 +1501,11 @@ gfx::SizeF LayerTreeHostImpl::UnscaledScrollableViewportSize() const { |
} |
void LayerTreeHostImpl::DidLoseOutputSurface() { |
+#ifndef NDEBUG |
+ // This must be set before calling the below functions as they may |
+ // synchronously try to recreate the output surface. |
+ did_lose_called_ = true; |
+#endif |
if (resource_provider_) |
resource_provider_->DidLoseOutputSurface(); |
// TODO(jamesr): The renderer_ check is needed to make some of the |
@@ -1508,9 +1513,6 @@ void LayerTreeHostImpl::DidLoseOutputSurface() { |
// important) in production. We should adjust the test to not need this. |
if (renderer_) |
client_->DidLoseOutputSurfaceOnImplThread(); |
-#ifndef NDEBUG |
- did_lose_called_ = true; |
-#endif |
} |
void LayerTreeHostImpl::Readback(void* pixels, |
@@ -1819,9 +1821,13 @@ bool LayerTreeHostImpl::InitializeRenderer( |
base::TimeDelta::FromMicroseconds( |
base::Time::kMicrosecondsPerSecond / |
settings_.refresh_rate); |
- |
+ // If no compositor thread, then begin impl frame messages should just |
+ // go back to the main thread. |
+ base::SingleThreadTaskRunner* task_runner = |
+ proxy_->ImplThreadTaskRunner() ? proxy_->ImplThreadTaskRunner() |
+ : proxy_->MainThreadTaskRunner(); |
output_surface->InitializeBeginImplFrameEmulation( |
- proxy_->ImplThreadTaskRunner(), |
+ task_runner, |
settings_.throttle_frame_production, |
display_refresh_interval); |
} |