OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_SURFACES_SURFACES_IMPL_H_ | |
6 #define SERVICES_SURFACES_SURFACES_IMPL_H_ | |
7 | |
8 #include "cc/surfaces/display_client.h" | |
9 #include "cc/surfaces/surface_factory.h" | |
10 #include "cc/surfaces/surface_factory_client.h" | |
11 #include "mojo/public/cpp/application/application_connection.h" | |
12 #include "mojo/public/cpp/bindings/strong_binding.h" | |
13 #include "mojo/services/gpu/interfaces/command_buffer.mojom.h" | |
14 #include "mojo/services/gpu/interfaces/viewport_parameter_listener.mojom.h" | |
15 #include "mojo/services/surfaces/interfaces/surfaces.mojom.h" | |
16 | |
17 namespace cc { | |
18 class Display; | |
19 } | |
20 | |
21 namespace mojo { | |
22 class ApplicationManager; | |
23 } | |
24 | |
25 namespace surfaces { | |
26 class SurfacesScheduler; | |
27 | |
28 class SurfacesImpl : public mojo::Surface, public cc::SurfaceFactoryClient { | |
29 public: | |
30 SurfacesImpl(cc::SurfaceManager* manager, | |
31 uint32_t id_namespace, | |
32 SurfacesScheduler* scheduler, | |
33 mojo::InterfaceRequest<mojo::Surface> request); | |
34 | |
35 ~SurfacesImpl() override; | |
36 | |
37 // Surface implementation. | |
38 void GetIdNamespace(const Surface::GetIdNamespaceCallback& callback) override; | |
39 void SetResourceReturner(mojo::ResourceReturnerPtr returner) override; | |
40 void CreateSurface(uint32_t local_id) override; | |
41 void SubmitFrame(uint32_t local_id, | |
42 mojo::FramePtr frame, | |
43 const mojo::Closure& callback) override; | |
44 void DestroySurface(uint32_t local_id) override; | |
45 | |
46 // SurfaceFactoryClient implementation. | |
47 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
48 | |
49 cc::SurfaceFactory* factory() { return &factory_; } | |
50 | |
51 private: | |
52 cc::SurfaceId QualifyIdentifier(uint32_t local_id); | |
53 | |
54 cc::SurfaceManager* manager_; | |
55 cc::SurfaceFactory factory_; | |
56 const uint32_t id_namespace_; | |
57 SurfacesScheduler* scheduler_; | |
58 mojo::ScopedMessagePipeHandle command_buffer_handle_; | |
59 mojo::ResourceReturnerPtr returner_; | |
60 mojo::StrongBinding<Surface> binding_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); | |
63 }; | |
64 | |
65 } // namespace surfaces | |
66 | |
67 #endif // SERVICES_SURFACES_SURFACES_IMPL_H_ | |
OLD | NEW |