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

Unified Diff: ui/compositor/test/in_process_context_factory.cc

Issue 277713002: ui/compositor: move the browser compositor thread to the ContextFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix includes Created 6 years, 7 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 | « ui/compositor/test/in_process_context_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/test/in_process_context_factory.cc
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index 7aa8098ae6eb2ab34c7b665c38076025bb9b5125..fbc4c813cc0eee2536ebce2ed57f2ef73788d7cd 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -4,8 +4,11 @@
#include "ui/compositor/test/in_process_context_factory.h"
+#include "base/command_line.h"
+#include "base/threading/thread.h"
#include "cc/output/output_surface.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/reflector.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
@@ -18,6 +21,16 @@ namespace ui {
InProcessContextFactory::InProcessContextFactory()
: shared_bitmap_manager_(new cc::TestSharedBitmapManager()) {
DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone);
+#if defined(OS_CHROMEOS)
+ bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUIDisableThreadedCompositing);
+#else
+ bool use_thread = false;
+#endif
+ if (use_thread) {
+ compositor_thread_.reset(new base::Thread("Browser Compositor"));
+ compositor_thread_->Start();
+ }
}
InProcessContextFactory::~InProcessContextFactory() {}
@@ -80,4 +93,10 @@ cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() {
return shared_bitmap_manager_.get();
}
+base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() {
+ if (!compositor_thread_)
+ return NULL;
+ return compositor_thread_->message_loop_proxy();
+}
+
} // namespace ui
« no previous file with comments | « ui/compositor/test/in_process_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698