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

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

Issue 361123002: Mojo surfaces service and example app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « mojo/services/surfaces/DEPS ('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
(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 MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
6 #define MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
7
8 #include "base/compiler_specific.h"
9 #include "cc/surfaces/display_client.h"
10 #include "cc/surfaces/surface_factory.h"
11 #include "cc/surfaces/surface_factory_client.h"
12 #include "mojo/public/cpp/application/application_connection.h"
13 #include "mojo/services/gles2/command_buffer.mojom.h"
14 #include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
15
16 namespace cc {
17 class Display;
18 }
19
20 namespace mojo {
21 class ServiceManager;
22
23 namespace surfaces {
24
25 class SurfaceNativeViewportClient;
26
27 class SurfacesImpl : public InterfaceImpl<Surface>,
28 public cc::SurfaceFactoryClient,
29 public cc::DisplayClient {
30 public:
31 class Context {
32 public:
33 virtual cc::SurfaceManager* Manager() = 0;
34 virtual uint32_t IdNamespace() = 0;
35 virtual void FrameSubmitted() = 0;
36 virtual void SetDisplay(cc::Display*) = 0;
37 };
38 SurfacesImpl(ApplicationConnection* app, Context* context);
39 virtual ~SurfacesImpl();
40
41 // InterfaceImpl<Surface> implementation.
42 virtual void OnConnectionEstablished() OVERRIDE;
43
44 // Surface implementation.
45 virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) OVERRIDE;
46 virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) OVERRIDE;
47 virtual void DestroySurface(SurfaceIdPtr id) OVERRIDE;
48 virtual void CreateGLES2BoundSurface(CommandBufferPtr gles2_client,
49 SurfaceIdPtr id,
50 mojo::SizePtr size) OVERRIDE;
51
52 // SurfaceFactoryClient implementation.
53 virtual void ReturnResources(
54 const cc::ReturnedResourceArray& resources) OVERRIDE;
55
56 // DisplayClient implementation.
57 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE;
58
59 cc::SurfaceFactory* factory() { return &factory_; }
60
61 private:
62 Context* context_;
63 cc::SurfaceFactory factory_;
64 uint32_t id_namespace_;
65 scoped_ptr<cc::Display> display_;
66 ScopedMessagePipeHandle command_buffer_handle_;
67
68 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
69 };
70
71 } // namespace surfaces
72 } // namespace mojo
73
74 #endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/surfaces/DEPS ('k') | mojo/services/surfaces/surfaces_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698