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

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

Issue 807733002: Split surface id and simplify connecting to surfaces service (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
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 SERVICES_SURFACES_SURFACES_IMPL_H_ 5 #ifndef SERVICES_SURFACES_SURFACES_IMPL_H_
6 #define SERVICES_SURFACES_SURFACES_IMPL_H_ 6 #define 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"
(...skipping 26 matching lines...) Expand all
37 virtual void OnVSyncParametersUpdated(base::TimeTicks timebase, 37 virtual void OnVSyncParametersUpdated(base::TimeTicks timebase,
38 base::TimeDelta interval) = 0; 38 base::TimeDelta interval) = 0;
39 virtual void FrameSubmitted() = 0; 39 virtual void FrameSubmitted() = 0;
40 virtual void SetDisplay(cc::Display* display) = 0; 40 virtual void SetDisplay(cc::Display* display) = 0;
41 virtual void OnDisplayBeingDestroyed(cc::Display* display) = 0; 41 virtual void OnDisplayBeingDestroyed(cc::Display* display) = 0;
42 }; 42 };
43 43
44 SurfacesImpl(cc::SurfaceManager* manager, 44 SurfacesImpl(cc::SurfaceManager* manager,
45 uint32_t id_namespace, 45 uint32_t id_namespace,
46 Client* client, 46 Client* client,
47 mojo::InterfaceRequest<mojo::Surface> request);
48
49 SurfacesImpl(cc::SurfaceManager* manager,
50 uint32_t id_namespace,
51 Client* client,
47 mojo::SurfacePtr* surface); 52 mojo::SurfacePtr* surface);
48 53
49 ~SurfacesImpl() override; 54 ~SurfacesImpl() override;
50 55
51 // Surface implementation. 56 // Surface implementation.
52 void CreateSurface(mojo::SurfaceIdPtr id, mojo::SizePtr size) override; 57 void CreateSurface(mojo::SurfaceIdPtr id) override;
53 void SubmitFrame(mojo::SurfaceIdPtr id, 58 void SubmitFrame(mojo::SurfaceIdPtr id,
54 mojo::FramePtr frame, 59 mojo::FramePtr frame,
55 const mojo::Closure& callback) override; 60 const mojo::Closure& callback) override;
56 void DestroySurface(mojo::SurfaceIdPtr id) override; 61 void DestroySurface(mojo::SurfaceIdPtr id) override;
57 void CreateGLES2BoundSurface( 62 void CreateGLES2BoundSurface(
58 mojo::CommandBufferPtr gles2_client, 63 mojo::CommandBufferPtr gles2_client,
59 mojo::SurfaceIdPtr id, 64 mojo::SurfaceIdPtr id,
60 mojo::SizePtr size, 65 mojo::SizePtr size,
61 mojo::InterfaceRequest<mojo::ViewportParameterListener> listener_request) 66 mojo::InterfaceRequest<mojo::ViewportParameterListener> listener_request)
62 override; 67 override;
63 68
64 // SurfaceFactoryClient implementation. 69 // SurfaceFactoryClient implementation.
65 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 70 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
66 71
67 // DisplayClient implementation. 72 // DisplayClient implementation.
68 void DisplayDamaged() override; 73 void DisplayDamaged() override;
69 void DidSwapBuffers() override; 74 void DidSwapBuffers() override;
70 void DidSwapBuffersComplete() override; 75 void DidSwapBuffersComplete() override;
71 void CommitVSyncParameters(base::TimeTicks timebase, 76 void CommitVSyncParameters(base::TimeTicks timebase,
72 base::TimeDelta interval) override; 77 base::TimeDelta interval) override;
73 void OutputSurfaceLost() override; 78 void OutputSurfaceLost() override;
74 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; 79 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
75 80
76 // ViewportParameterListener 81 // ViewportParameterListener
77 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; 82 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override;
78 83
79 cc::SurfaceFactory* factory() { return &factory_; } 84 cc::SurfaceFactory* factory() { return &factory_; }
80 85
81 private: 86 private:
87 SurfacesImpl(cc::SurfaceManager* manager,
88 uint32_t id_namespace,
89 Client* client);
90
82 cc::SurfaceManager* manager_; 91 cc::SurfaceManager* manager_;
83 cc::SurfaceFactory factory_; 92 cc::SurfaceFactory factory_;
84 uint32_t id_namespace_; 93 uint32_t id_namespace_;
85 Client* client_; 94 Client* client_;
86 scoped_ptr<cc::Display> display_; 95 scoped_ptr<cc::Display> display_;
87 mojo::ScopedMessagePipeHandle command_buffer_handle_; 96 mojo::ScopedMessagePipeHandle command_buffer_handle_;
88 mojo::WeakBindingSet<ViewportParameterListener> parameter_listeners_; 97 mojo::WeakBindingSet<ViewportParameterListener> parameter_listeners_;
89 mojo::StrongBinding<Surface> binding_; 98 mojo::StrongBinding<Surface> binding_;
90 99
91 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); 100 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
92 }; 101 };
93 102
94 } // namespace surfaces 103 } // namespace surfaces
95 104
96 #endif // SERVICES_SURFACES_SURFACES_IMPL_H_ 105 #endif // SERVICES_SURFACES_SURFACES_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698