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 dfdb11573c739c3e61f6d8d939723786e933b807..fbcde9d954822ccca65d9ea3937fdbda7d418868 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1509,6 +1509,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 |
@@ -1516,9 +1521,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, |
@@ -1826,9 +1828,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); |
} |