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

Unified Diff: ui/compositor/compositor.cc

Issue 61823008: Introduce separate client and init path for single-threaded cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 1061424c06a126fe7c552b17470b5d110ff57640..41581f98768a3f8ca27e1a082d5e4d4f3064269d 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -285,11 +285,12 @@ Compositor::Compositor(gfx::AcceleratedWidget widget)
settings.initial_debug_state.show_non_occluding_rects =
command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects);
- scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner =
- g_compositor_thread ? g_compositor_thread->message_loop_proxy() : NULL;
-
- host_ =
- cc::LayerTreeHost::Create(this, NULL, settings, compositor_task_runner);
+ if (!!g_compositor_thread) {
+ host_ = cc::LayerTreeHost::CreateThreaded(
+ this, NULL, settings, g_compositor_thread->message_loop_proxy());
+ } else {
+ host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings);
+ }
host_->SetRootLayer(root_web_layer_);
host_->SetLayerTreeHostClientReady();
}
@@ -557,15 +558,15 @@ void Compositor::DidCompleteSwapBuffers() {
NotifyEnd();
}
+scoped_refptr<cc::ContextProvider> Compositor::OffscreenContextProvider() {
+ return ContextFactory::GetInstance()->OffscreenCompositorContextProvider();
+}
+
void Compositor::ScheduleComposite() {
if (!disable_schedule_composite_)
ScheduleDraw();
}
-scoped_refptr<cc::ContextProvider> Compositor::OffscreenContextProvider() {
- return ContextFactory::GetInstance()->OffscreenCompositorContextProvider();
-}
-
const cc::LayerTreeDebugState& Compositor::GetLayerTreeDebugState() const {
return host_->debug_state();
}
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698