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 MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ | 5 #ifndef MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ |
6 #define MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ | 6 #define MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "cc/surfaces/display_client.h" | 9 #include "cc/surfaces/display_client.h" |
10 #include "cc/surfaces/surface_factory.h" | 10 #include "cc/surfaces/surface_factory.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class ServiceManager; | 21 class ServiceManager; |
22 | 22 |
23 namespace surfaces { | 23 namespace surfaces { |
24 | 24 |
25 class SurfaceNativeViewportClient; | 25 class SurfaceNativeViewportClient; |
26 | 26 |
27 class SurfacesImpl : public InterfaceImpl<Surface>, | 27 class SurfacesImpl : public InterfaceImpl<Surface>, |
28 public cc::SurfaceFactoryClient, | 28 public cc::SurfaceFactoryClient, |
29 public cc::DisplayClient { | 29 public cc::DisplayClient { |
30 public: | 30 public: |
31 class Context { | 31 class Client { |
32 public: | 32 public: |
33 virtual cc::SurfaceManager* Manager() = 0; | |
34 virtual uint32_t IdNamespace() = 0; | |
35 virtual void FrameSubmitted() = 0; | 33 virtual void FrameSubmitted() = 0; |
36 virtual void SetDisplay(cc::Display*) = 0; | 34 virtual void SetDisplay(cc::Display*) = 0; |
37 }; | 35 }; |
38 SurfacesImpl(ApplicationConnection* app, Context* context); | 36 |
| 37 SurfacesImpl(cc::SurfaceManager* manager, |
| 38 uint32_t id_namespace, |
| 39 Client* client); |
39 virtual ~SurfacesImpl(); | 40 virtual ~SurfacesImpl(); |
40 | 41 |
41 // InterfaceImpl<Surface> implementation. | 42 // InterfaceImpl<Surface> implementation. |
42 virtual void OnConnectionEstablished() OVERRIDE; | 43 virtual void OnConnectionEstablished() OVERRIDE; |
43 | 44 |
44 // Surface implementation. | 45 // Surface implementation. |
45 virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) OVERRIDE; | 46 virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) OVERRIDE; |
46 virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) OVERRIDE; | 47 virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) OVERRIDE; |
47 virtual void DestroySurface(SurfaceIdPtr id) OVERRIDE; | 48 virtual void DestroySurface(SurfaceIdPtr id) OVERRIDE; |
48 virtual void CreateGLES2BoundSurface(CommandBufferPtr gles2_client, | 49 virtual void CreateGLES2BoundSurface(CommandBufferPtr gles2_client, |
49 SurfaceIdPtr id, | 50 SurfaceIdPtr id, |
50 mojo::SizePtr size) OVERRIDE; | 51 mojo::SizePtr size) OVERRIDE; |
51 | 52 |
52 // SurfaceFactoryClient implementation. | 53 // SurfaceFactoryClient implementation. |
53 virtual void ReturnResources( | 54 virtual void ReturnResources( |
54 const cc::ReturnedResourceArray& resources) OVERRIDE; | 55 const cc::ReturnedResourceArray& resources) OVERRIDE; |
55 | 56 |
56 // DisplayClient implementation. | 57 // DisplayClient implementation. |
57 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE; | 58 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE; |
58 | 59 |
59 cc::SurfaceFactory* factory() { return &factory_; } | 60 cc::SurfaceFactory* factory() { return &factory_; } |
60 | 61 |
61 private: | 62 private: |
62 Context* context_; | 63 cc::SurfaceManager* manager_; |
63 cc::SurfaceFactory factory_; | 64 cc::SurfaceFactory factory_; |
64 uint32_t id_namespace_; | 65 uint32_t id_namespace_; |
| 66 Client* client_; |
65 scoped_ptr<cc::Display> display_; | 67 scoped_ptr<cc::Display> display_; |
66 ScopedMessagePipeHandle command_buffer_handle_; | 68 ScopedMessagePipeHandle command_buffer_handle_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); | 70 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace surfaces | 73 } // namespace surfaces |
72 } // namespace mojo | 74 } // namespace mojo |
73 | 75 |
74 #endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ | 76 #endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ |
OLD | NEW |