| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | 5 #ifndef SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ |
| 6 #define SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | 6 #define SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 10 #include "cc/surfaces/surface_manager.h" |
| 11 #include "mojo/public/cpp/application/application_delegate.h" | 11 #include "mojo/public/cpp/application/application_delegate.h" |
| 12 #include "mojo/public/cpp/application/interface_factory.h" | 12 #include "mojo/public/cpp/application/interface_factory.h" |
| 13 #include "mojo/services/surfaces/public/interfaces/surfaces_service.mojom.h" | 13 #include "mojo/services/surfaces/public/interfaces/surfaces_service.mojom.h" |
| 14 #include "services/surfaces/surfaces_impl.h" | 14 #include "services/surfaces/surfaces_impl.h" |
| 15 #include "services/surfaces/surfaces_scheduler.h" | 15 #include "services/surfaces/surfaces_scheduler.h" |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 class ApplicationConnection; | 18 class ApplicationConnection; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace surfaces { | 21 namespace surfaces { |
| 22 | 22 |
| 23 class SurfacesServiceApplication | 23 class SurfacesServiceApplication |
| 24 : public mojo::ApplicationDelegate, | 24 : public mojo::ApplicationDelegate, |
| 25 public mojo::InterfaceFactory<mojo::SurfacesService>, | 25 public mojo::InterfaceFactory<mojo::SurfacesService>, |
| 26 public mojo::InterfaceFactory<mojo::Surface>, |
| 26 public SurfacesImpl::Client, | 27 public SurfacesImpl::Client, |
| 27 public SurfacesScheduler::Client { | 28 public SurfacesScheduler::Client { |
| 28 public: | 29 public: |
| 29 SurfacesServiceApplication(); | 30 SurfacesServiceApplication(); |
| 30 ~SurfacesServiceApplication() override; | 31 ~SurfacesServiceApplication() override; |
| 31 | 32 |
| 32 // ApplicationDelegate implementation. | 33 // ApplicationDelegate implementation. |
| 33 void Initialize(mojo::ApplicationImpl* app) override; | 34 void Initialize(mojo::ApplicationImpl* app) override; |
| 34 bool ConfigureIncomingConnection( | 35 bool ConfigureIncomingConnection( |
| 35 mojo::ApplicationConnection* connection) override; | 36 mojo::ApplicationConnection* connection) override; |
| 36 | 37 |
| 37 // InterfaceFactory<SurfacsServicee> implementation. | 38 // InterfaceFactory<SurfacesServicee> implementation. |
| 38 void Create(mojo::ApplicationConnection* connection, | 39 void Create(mojo::ApplicationConnection* connection, |
| 39 mojo::InterfaceRequest<mojo::SurfacesService> request) override; | 40 mojo::InterfaceRequest<mojo::SurfacesService> request) override; |
| 40 | 41 |
| 42 // InterfaceFactory<Surface> implementation. |
| 43 void Create(mojo::ApplicationConnection* connection, |
| 44 mojo::InterfaceRequest<mojo::Surface> request) override; |
| 45 |
| 41 // SurfacesImpl::Client implementation. | 46 // SurfacesImpl::Client implementation. |
| 42 void OnVSyncParametersUpdated(base::TimeTicks timebase, | 47 void OnVSyncParametersUpdated(base::TimeTicks timebase, |
| 43 base::TimeDelta interval) override; | 48 base::TimeDelta interval) override; |
| 44 void FrameSubmitted() override; | 49 void FrameSubmitted() override; |
| 45 void SetDisplay(cc::Display*) override; | 50 void SetDisplay(cc::Display*) override; |
| 46 void OnDisplayBeingDestroyed(cc::Display* display) override; | 51 void OnDisplayBeingDestroyed(cc::Display* display) override; |
| 47 | 52 |
| 48 // SurfacesScheduler::Client | 53 // SurfacesScheduler::Client |
| 49 void Draw() override; | 54 void Draw() override; |
| 50 | 55 |
| 51 private: | 56 private: |
| 52 cc::SurfaceManager manager_; | 57 cc::SurfaceManager manager_; |
| 53 uint32_t next_id_namespace_; | 58 uint32_t next_id_namespace_; |
| 54 cc::Display* display_; | 59 cc::Display* display_; |
| 55 scoped_ptr<SurfacesScheduler> scheduler_; | 60 scoped_ptr<SurfacesScheduler> scheduler_; |
| 56 | 61 |
| 57 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceApplication); | 62 DISALLOW_COPY_AND_ASSIGN(SurfacesServiceApplication); |
| 58 }; | 63 }; |
| 59 | 64 |
| 60 } // namespace surfaces | 65 } // namespace surfaces |
| 61 | 66 |
| 62 #endif // SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ | 67 #endif // SERVICES_SURFACES_SURFACES_SERVICE_APPLICATION_H_ |
| OLD | NEW |