Index: components/view_manager/view_manager_app.cc |
diff --git a/components/view_manager/view_manager_app.cc b/components/view_manager/view_manager_app.cc |
index 4b092ada2ddb62de5f850b0f13b963d9361a4d89..aa702cfd2f234ef57de4b4bb24d79bc8dacb03af 100644 |
--- a/components/view_manager/view_manager_app.cc |
+++ b/components/view_manager/view_manager_app.cc |
@@ -5,9 +5,12 @@ |
#include "components/view_manager/view_manager_app.h" |
#include "base/command_line.h" |
+#include "base/stl_util.h" |
#include "components/view_manager/client_connection.h" |
#include "components/view_manager/connection_manager.h" |
#include "components/view_manager/public/cpp/args.h" |
+#include "components/view_manager/surfaces/surfaces_impl.h" |
+#include "components/view_manager/surfaces/surfaces_scheduler.h" |
#include "components/view_manager/view_manager_root_connection.h" |
#include "components/view_manager/view_manager_root_impl.h" |
#include "components/view_manager/view_manager_service_impl.h" |
@@ -30,7 +33,9 @@ using mojo::ViewManagerService; |
namespace view_manager { |
-ViewManagerApp::ViewManagerApp() : app_impl_(nullptr), is_headless_(false) { |
+ViewManagerApp::ViewManagerApp() |
+ : app_impl_(nullptr), |
+ is_headless_(false) { |
} |
ViewManagerApp::~ViewManagerApp() { |
@@ -41,6 +46,7 @@ ViewManagerApp::~ViewManagerApp() { |
void ViewManagerApp::Initialize(ApplicationImpl* app) { |
app_impl_ = app; |
tracing_.Initialize(app); |
+ surfaces_state_ = new surfaces::SurfacesState; |
#if !defined(OS_ANDROID) |
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
@@ -61,9 +67,12 @@ void ViewManagerApp::Initialize(ApplicationImpl* app) { |
bool ViewManagerApp::ConfigureIncomingConnection( |
ApplicationConnection* connection) { |
+ // ViewManager |
connection->AddService<ViewManagerRoot>(this); |
+ // Surfaces |
rjkroege
2015/08/06 00:16:22
you can (eventually) remove this based on today's
Fady Samuel
2015/08/06 16:48:24
Done.
|
+ connection->AddService<mojo::Surface>(this); |
+ // GPU |
connection->AddService<Gpu>(this); |
rjkroege
2015/08/06 00:16:22
why do we have a gpu service? is it still necessar
Fady Samuel
2015/08/06 16:48:24
I'm not sure yet. html_viewers still need a Comman
rjkroege
2015/08/06 22:09:02
not same. Yes, html_viewers need a CommandBuffer.
|
- |
return true; |
} |
@@ -105,7 +114,8 @@ void ViewManagerApp::Create(ApplicationConnection* connection, |
// TODO(fsamuel): We need to make sure that only the window manager can create |
// new roots. |
ViewManagerRootImpl* view_manager_root = new ViewManagerRootImpl( |
- connection_manager_.get(), is_headless_, app_impl_, gpu_state_); |
+ connection_manager_.get(), is_headless_, app_impl_, gpu_state_, |
+ surfaces_state_); |
mojo::ViewManagerClientPtr client; |
connection->ConnectToService(&client); |
@@ -124,4 +134,10 @@ void ViewManagerApp::Create( |
new gles2::GpuImpl(request.Pass(), gpu_state_); |
} |
+void ViewManagerApp::Create( |
+ mojo::ApplicationConnection* connection, |
+ mojo::InterfaceRequest<mojo::Surface> request) { |
+ new surfaces::SurfacesImpl(surfaces_state_, request.Pass()); |
+} |
+ |
} // namespace view_manager |