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 COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ |
6 #define COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ | 6 #define COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ |
7 | 7 |
8 #include "cc/surfaces/display_client.h" | 8 #include "cc/surfaces/display_client.h" |
9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
10 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
11 #include "components/view_manager/public/interfaces/command_buffer.mojom.h" | 11 #include "components/view_manager/public/interfaces/command_buffer.mojom.h" |
12 #include "components/view_manager/public/interfaces/surfaces.mojom.h" | 12 #include "components/view_manager/public/interfaces/surfaces.mojom.h" |
13 #include "components/view_manager/public/interfaces/viewport_parameter_listener. mojom.h" | 13 #include "components/view_manager/surfaces/surfaces_state.h" |
14 #include "mojo/application/public/cpp/application_connection.h" | 14 #include "mojo/application/public/cpp/application_connection.h" |
15 #include "mojo/common/weak_binding_set.h" | 15 #include "mojo/common/weak_binding_set.h" |
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 class Display; | 19 class Display; |
20 } | 20 } |
21 | 21 |
22 namespace mojo { | 22 namespace mojo { |
23 class ApplicationManager; | 23 class ApplicationManager; |
24 } | 24 } |
25 | 25 |
26 namespace surfaces { | 26 namespace surfaces { |
27 class SurfacesScheduler; | 27 class SurfacesScheduler; |
28 class SurfacesServiceApplication; | |
29 | 28 |
30 class SurfacesImpl : public mojo::Surface, public cc::SurfaceFactoryClient { | 29 class SurfacesImpl : public mojo::Surface, public cc::SurfaceFactoryClient { |
rjkroege
2015/08/06 00:16:22
This has a confusing name. Is it the SurfaceImplem
Fady Samuel
2015/08/06 16:48:23
Very confusing name. I agree. Again I don't want t
rjkroege
2015/08/06 22:09:02
but we will clean it up in future iterations over
| |
31 public: | 30 public: |
32 SurfacesImpl(SurfacesServiceApplication* application, | 31 SurfacesImpl(const scoped_refptr<SurfacesState>& state, |
33 cc::SurfaceManager* manager, | |
34 uint32_t id_namespace, | |
35 SurfacesScheduler* scheduler, | |
36 mojo::InterfaceRequest<mojo::Surface> request); | 32 mojo::InterfaceRequest<mojo::Surface> request); |
37 | 33 |
38 ~SurfacesImpl() override; | 34 ~SurfacesImpl() override; |
39 | 35 |
40 // Surface implementation. | 36 // Surface implementation. |
41 void GetIdNamespace(const Surface::GetIdNamespaceCallback& callback) override; | 37 void GetIdNamespace(const Surface::GetIdNamespaceCallback& callback) override; |
42 void SetResourceReturner(mojo::ResourceReturnerPtr returner) override; | 38 void SetResourceReturner(mojo::ResourceReturnerPtr returner) override; |
43 void CreateSurface(uint32_t local_id) override; | 39 void CreateSurface(uint32_t local_id) override; |
44 void SubmitFrame(uint32_t local_id, | 40 void SubmitFrame(uint32_t local_id, |
rjkroege
2015/08/06 00:16:21
a mojo::FramePtr is a ptr to a CompositorFrame?
Fady Samuel
2015/08/06 16:48:23
Yes, I hate the "FramePtr" name, but I don't want
rjkroege
2015/08/06 22:09:02
yes. +1.
| |
45 mojo::FramePtr frame, | 41 mojo::FramePtr frame, |
46 const mojo::Closure& callback) override; | 42 const mojo::Closure& callback) override; |
47 void DestroySurface(uint32_t local_id) override; | 43 void DestroySurface(uint32_t local_id) override; |
48 | 44 |
49 // SurfaceFactoryClient implementation. | 45 // SurfaceFactoryClient implementation. |
50 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 46 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
51 | 47 |
52 cc::SurfaceFactory* factory() { return &factory_; } | 48 cc::SurfaceFactory* factory() { return &factory_; } |
53 | 49 |
54 private: | 50 private: |
55 cc::SurfaceId QualifyIdentifier(uint32_t local_id); | 51 cc::SurfaceId QualifyIdentifier(uint32_t local_id); |
56 | 52 |
57 SurfacesServiceApplication* application_; | 53 scoped_refptr<SurfacesState> state_; |
58 cc::SurfaceManager* manager_; | 54 const uint32_t id_namespace_; |
rjkroege
2015/08/06 00:16:22
what is this? needs a comment
Fady Samuel
2015/08/06 16:48:23
Done.
| |
59 cc::SurfaceFactory factory_; | 55 cc::SurfaceFactory factory_; |
rjkroege
2015/08/06 00:16:21
Why inline and not a pointer? Is this class the Su
Fady Samuel
2015/08/06 16:48:23
The problem is this abstraction is bad. SurfacesIm
rjkroege
2015/08/06 22:09:02
ok
| |
60 const uint32_t id_namespace_; | |
61 SurfacesScheduler* scheduler_; | |
62 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 56 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
63 mojo::ResourceReturnerPtr returner_; | 57 mojo::ResourceReturnerPtr returner_; |
64 mojo::StrongBinding<Surface> binding_; | 58 mojo::StrongBinding<Surface> binding_; |
65 | 59 |
66 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); | 60 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); |
67 }; | 61 }; |
68 | 62 |
69 } // namespace surfaces | 63 } // namespace surfaces |
70 | 64 |
71 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ | 65 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_ |
OLD | NEW |