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

Side by Side Diff: mojo/services/surfaces/surfaces_impl.h

Issue 718623004: Use Binding<Interface> in surfaces and gles2 code (Closed) Base URL: git@github.com:domokit/mojo.git@connector
Patch Set: use InterfaceRequest<> instead of InterfaceRequest<>* Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | mojo/services/surfaces/surfaces_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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 "mojo/public/cpp/application/application_connection.h" 11 #include "mojo/public/cpp/application/application_connection.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h" 13 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h"
13 #include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h" 14 #include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
14 15
15 namespace cc { 16 namespace cc {
16 class Display; 17 class Display;
17 } 18 }
18 19
19 namespace mojo { 20 namespace mojo {
20 class ApplicationManager; 21 class ApplicationManager;
21 22
22 class SurfaceNativeViewportClient; 23 class SurfaceNativeViewportClient;
23 24
24 class SurfacesImpl : public InterfaceImpl<Surface>, 25 class SurfacesImpl : public Surface,
25 public cc::SurfaceFactoryClient, 26 public cc::SurfaceFactoryClient,
26 public cc::DisplayClient { 27 public cc::DisplayClient {
27 public: 28 public:
28 class Client { 29 class Client {
29 public: 30 public:
30 virtual void FrameSubmitted() = 0; 31 virtual void FrameSubmitted() = 0;
31 virtual void SetDisplay(cc::Display* display) = 0; 32 virtual void SetDisplay(cc::Display* display) = 0;
32 virtual void OnDisplayBeingDestroyed(cc::Display* display) = 0; 33 virtual void OnDisplayBeingDestroyed(cc::Display* display) = 0;
33 }; 34 };
34 35
35 SurfacesImpl(cc::SurfaceManager* manager, 36 SurfacesImpl(cc::SurfaceManager* manager,
36 uint32_t id_namespace, 37 uint32_t id_namespace,
37 Client* client); 38 Client* client,
39 SurfacePtr* surface);
40
38 ~SurfacesImpl() override; 41 ~SurfacesImpl() override;
39 42
40 // Surface implementation. 43 // Surface implementation.
41 void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) override; 44 void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) override;
42 void SubmitFrame(SurfaceIdPtr id, FramePtr frame) override; 45 void SubmitFrame(SurfaceIdPtr id, FramePtr frame) override;
43 void DestroySurface(SurfaceIdPtr id) override; 46 void DestroySurface(SurfaceIdPtr id) override;
44 void CreateGLES2BoundSurface(CommandBufferPtr gles2_client, 47 void CreateGLES2BoundSurface(CommandBufferPtr gles2_client,
45 SurfaceIdPtr id, 48 SurfaceIdPtr id,
46 mojo::SizePtr size) override; 49 mojo::SizePtr size) override;
47 50
(...skipping 11 matching lines...) Expand all
59 62
60 cc::SurfaceFactory* factory() { return &factory_; } 63 cc::SurfaceFactory* factory() { return &factory_; }
61 64
62 private: 65 private:
63 cc::SurfaceManager* manager_; 66 cc::SurfaceManager* manager_;
64 cc::SurfaceFactory factory_; 67 cc::SurfaceFactory factory_;
65 uint32_t id_namespace_; 68 uint32_t id_namespace_;
66 Client* client_; 69 Client* client_;
67 scoped_ptr<cc::Display> display_; 70 scoped_ptr<cc::Display> display_;
68 ScopedMessagePipeHandle command_buffer_handle_; 71 ScopedMessagePipeHandle command_buffer_handle_;
72 StrongBinding<Surface> binding_;
69 73
70 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); 74 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
71 }; 75 };
72 76
73 } // namespace mojo 77 } // namespace mojo
74 78
75 #endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_ 79 #endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | mojo/services/surfaces/surfaces_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698