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

Unified Diff: ui/views/mus/surface_context_factory.cc

Issue 1808313002: Register surface namespace in BlimpUiContextFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move SurfaceManager to ContextFactory Created 4 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
Index: ui/views/mus/surface_context_factory.cc
diff --git a/ui/views/mus/surface_context_factory.cc b/ui/views/mus/surface_context_factory.cc
index bb27a08fb066fcd7d7c60a05f2b7cce4ebc7d507..ff89aa5109213ea303e1995085f3b3c7159b3697 100644
--- a/ui/views/mus/surface_context_factory.cc
+++ b/ui/views/mus/surface_context_factory.cc
@@ -7,6 +7,7 @@
#include "cc/output/output_surface.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "cc/surfaces/surface_id_allocator.h"
+#include "cc/surfaces/surface_manager.h"
#include "components/mus/public/cpp/window.h"
#include "mojo/shell/public/interfaces/connector.mojom.h"
#include "ui/compositor/reflector.h"
@@ -31,7 +32,8 @@ SurfaceContextFactory::SurfaceContextFactory(
mus::Window* window,
mus::mojom::SurfaceType surface_type)
: surface_binding_(connector, window, surface_type),
- next_surface_id_namespace_(1u) {}
+ next_surface_id_namespace_(1u),
+ surface_manager_(new cc::SurfaceManager) {}
SurfaceContextFactory::~SurfaceContextFactory() {}
@@ -86,10 +88,16 @@ cc::TaskGraphRunner* SurfaceContextFactory::GetTaskGraphRunner() {
return raster_thread_helper_.task_graph_runner();
}
+cc::SurfaceManager* SurfaceContextFactory::GetSurfaceManager() {
+ return surface_manager_.get();
+}
+
scoped_ptr<cc::SurfaceIdAllocator>
SurfaceContextFactory::CreateSurfaceIdAllocator() {
- return make_scoped_ptr(
- new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
+ scoped_ptr<cc::SurfaceIdAllocator> allocator =
+ make_scoped_ptr(new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
+ allocator->RegisterSurfaceIdNamespace(surface_manager_.get());
+ return allocator;
}
void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor,
« ui/compositor/test/in_process_context_factory.cc ('K') | « ui/views/mus/surface_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698