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

Unified Diff: ui/compositor/compositor.cc

Issue 148243013: Add shared bitmap managers for browser and renderer processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 2993d8a6fd21dffc40465c2ed46af07f0fba6a30..6e568cab33bccd7e8595d16d1a93089b00d5dec8 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -45,6 +45,7 @@ enum SwapType {
bool g_compositor_initialized = false;
base::Thread* g_compositor_thread = NULL;
+cc::SharedBitmapManager* g_shared_bitmap_manager;
danakj 2014/01/30 22:59:01 Can we pass it to ui::Compositor constructor inste
ui::ContextFactory* g_context_factory = NULL;
@@ -240,9 +241,13 @@ Compositor::Compositor(gfx::AcceleratedWidget widget)
base::TimeTicks before_create = base::TimeTicks::Now();
if (!!g_compositor_thread) {
host_ = cc::LayerTreeHost::CreateThreaded(
- this, NULL, settings, g_compositor_thread->message_loop_proxy());
+ this,
+ g_shared_bitmap_manager,
+ settings,
+ g_compositor_thread->message_loop_proxy());
} else {
- host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings);
+ host_ = cc::LayerTreeHost::CreateSingleThreaded(
+ this, this, g_shared_bitmap_manager, settings);
}
UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor",
base::TimeTicks::Now() - before_create);
@@ -315,6 +320,11 @@ void Compositor::Terminate() {
g_compositor_initialized = false;
}
+// static
+void Compositor::SetSharedBitmapManager(cc::SharedBitmapManager* manager) {
+ g_shared_bitmap_manager = manager;
+}
+
void Compositor::ScheduleDraw() {
if (g_compositor_thread) {
host_->Composite(gfx::FrameTime::Now());
« content/common/host_shared_bitmap_manager_unittest.cc ('K') | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698