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

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, 9 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/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 2da23fd61bce55bfe85991c687b2e9b48a06008d..86688b1e114415af6fb6ba95110f0a90de03944b 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;
ui::ContextFactory* g_context_factory = NULL;
@@ -246,9 +247,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);
@@ -317,6 +322,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());
« 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