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

Unified Diff: services/surfaces/surfaces_service_application.cc

Issue 940293003: Add a Display and ContextProvider concept to mojom, use to recreate (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « services/surfaces/surfaces_service_application.h ('k') | services/view_manager/display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/surfaces/surfaces_service_application.cc
diff --git a/services/surfaces/surfaces_service_application.cc b/services/surfaces/surfaces_service_application.cc
index 107261764dbf92f677bc34899f469f5f0a62573a..74ca4f09cdd8d2358d5749f35ea6276624d1caa9 100644
--- a/services/surfaces/surfaces_service_application.cc
+++ b/services/surfaces/surfaces_service_application.cc
@@ -4,15 +4,16 @@
#include "services/surfaces/surfaces_service_application.h"
-#include "cc/surfaces/display.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/public/c/system/main.h"
+#include "services/surfaces/display_factory_impl.h"
#include "services/surfaces/surfaces_impl.h"
+#include "services/surfaces/surfaces_scheduler.h"
namespace surfaces {
SurfacesServiceApplication::SurfacesServiceApplication()
- : next_id_namespace_(1u), display_(nullptr) {
+ : next_id_namespace_(1u) {
}
SurfacesServiceApplication::~SurfacesServiceApplication() {
@@ -20,43 +21,28 @@ SurfacesServiceApplication::~SurfacesServiceApplication() {
void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) {
tracing_.Initialize(app);
- scheduler_.reset(new SurfacesScheduler(this));
+ scheduler_.reset(new SurfacesScheduler);
}
bool SurfacesServiceApplication::ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) {
- connection->AddService(this);
+ connection->AddService<mojo::DisplayFactory>(this);
+ connection->AddService<mojo::Surface>(this);
return true;
}
void SurfacesServiceApplication::Create(
mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<mojo::Surface> request) {
- new SurfacesImpl(&manager_, next_id_namespace_++, this, request.Pass());
-}
-
-void SurfacesServiceApplication::OnVSyncParametersUpdated(
- base::TimeTicks timebase,
- base::TimeDelta interval) {
- scheduler_->OnVSyncParametersUpdated(timebase, interval);
-}
-
-void SurfacesServiceApplication::FrameSubmitted() {
- scheduler_->SetNeedsDraw();
-}
-
-void SurfacesServiceApplication::SetDisplay(cc::Display* display) {
- display_ = display;
-}
-
-void SurfacesServiceApplication::OnDisplayBeingDestroyed(cc::Display* display) {
- if (display_ == display)
- SetDisplay(nullptr);
+ mojo::InterfaceRequest<mojo::DisplayFactory> request) {
+ new DisplayFactoryImpl(&manager_, next_id_namespace_++, scheduler_.get(),
+ request.Pass());
}
-void SurfacesServiceApplication::Draw() {
- if (display_)
- display_->Draw();
+void SurfacesServiceApplication::Create(
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::Surface> request) {
+ new SurfacesImpl(&manager_, next_id_namespace_++, scheduler_.get(),
+ request.Pass());
}
} // namespace surfaces
« no previous file with comments | « services/surfaces/surfaces_service_application.h ('k') | services/view_manager/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698