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

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

Issue 771043002: Move surfaces service implementation to //services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/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 "cc/surfaces/display_client.h"
9 #include "cc/surfaces/surface_factory.h"
10 #include "cc/surfaces/surface_factory_client.h"
11 #include "mojo/common/weak_binding_set.h"
12 #include "mojo/public/cpp/application/application_connection.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h"
15 #include "mojo/services/public/interfaces/gpu/viewport_parameter_listener.mojom. h"
16 #include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
17
18 namespace cc {
19 class Display;
20 }
21
22 namespace mojo {
23 class ApplicationManager;
24
25 class SurfaceNativeViewportClient;
26
27 class SurfacesImpl : public Surface,
28 public ViewportParameterListener,
29 public cc::SurfaceFactoryClient,
30 public cc::DisplayClient {
31 public:
32 class Client {
33 public:
34 virtual void OnVSyncParametersUpdated(base::TimeTicks timebase,
35 base::TimeDelta interval) = 0;
36 virtual void FrameSubmitted() = 0;
37 virtual void SetDisplay(cc::Display* display) = 0;
38 virtual void OnDisplayBeingDestroyed(cc::Display* display) = 0;
39 };
40
41 SurfacesImpl(cc::SurfaceManager* manager,
42 uint32_t id_namespace,
43 Client* client,
44 SurfacePtr* surface);
45
46 ~SurfacesImpl() override;
47
48 // Surface implementation.
49 void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) override;
50 void SubmitFrame(SurfaceIdPtr id,
51 FramePtr frame,
52 const mojo::Closure& callback) override;
53 void DestroySurface(SurfaceIdPtr id) override;
54 void CreateGLES2BoundSurface(
55 CommandBufferPtr gles2_client,
56 SurfaceIdPtr id,
57 mojo::SizePtr size,
58 InterfaceRequest<ViewportParameterListener> listener_request) override;
59
60 // SurfaceFactoryClient implementation.
61 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
62
63 // DisplayClient implementation.
64 void DisplayDamaged() override;
65 void DidSwapBuffers() override;
66 void DidSwapBuffersComplete() override;
67 void CommitVSyncParameters(base::TimeTicks timebase,
68 base::TimeDelta interval) override;
69 void OutputSurfaceLost() override;
70 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
71
72 // ViewportParameterListener
73 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override;
74
75 cc::SurfaceFactory* factory() { return &factory_; }
76
77 private:
78 cc::SurfaceManager* manager_;
79 cc::SurfaceFactory factory_;
80 uint32_t id_namespace_;
81 Client* client_;
82 scoped_ptr<cc::Display> display_;
83 ScopedMessagePipeHandle command_buffer_handle_;
84 WeakBindingSet<ViewportParameterListener> parameter_listeners_;
85 StrongBinding<Surface> binding_;
86
87 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
88 };
89
90 } // namespace mojo
91
92 #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