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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 134623005: Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 6 years, 10 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698