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

Side by Side Diff: components/view_manager/surfaces/surfaces_impl.h

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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
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 COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_
6 #define COMPONENTS_VIEW_MANAGER_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 "components/view_manager/public/interfaces/command_buffer.mojom.h"
12 #include "components/view_manager/public/interfaces/surfaces.mojom.h"
13 #include "components/view_manager/surfaces/surfaces_state.h"
14 #include "mojo/application/public/cpp/application_connection.h"
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
16
17 namespace cc {
18 class Display;
19 }
20
21 namespace mojo {
22 class ApplicationManager;
23 }
24
25 namespace surfaces {
26
27 class SurfacesDelegate;
28 class SurfacesScheduler;
29
30 class SurfacesImpl : public mojo::Surface, public cc::SurfaceFactoryClient {
31 public:
32 SurfacesImpl(SurfacesDelegate* surfaces_delegate,
33 const scoped_refptr<SurfacesState>& state,
34 mojo::InterfaceRequest<mojo::Surface> request);
35
36 // Closes the connection and destroys |this| object.
37 void CloseConnection();
38
39 // Surface implementation.
40 void GetIdNamespace(const Surface::GetIdNamespaceCallback& callback) override;
41 void SetResourceReturner(mojo::ResourceReturnerPtr returner) override;
42 void CreateSurface(uint32_t local_id) override;
43 void SubmitCompositorFrame(uint32_t local_id,
44 mojo::CompositorFramePtr frame,
45 const mojo::Closure& callback) override;
46 void DestroySurface(uint32_t local_id) override;
47
48 // SurfaceFactoryClient implementation.
49 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
50
51 cc::SurfaceFactory* factory() { return &factory_; }
52
53 private:
54 ~SurfacesImpl() override;
55
56 cc::SurfaceId QualifyIdentifier(uint32_t local_id);
57
58 SurfacesDelegate* delegate_;
59 // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated
60 // by the Surfaces service, and the low 32-bits are generated by the process
61 // that requested the Surface.
62 scoped_refptr<SurfacesState> state_;
63 // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated
64 // by the Surfaces service, and the low 32-bits are generated by the process
65 // that requested the Surface.
66 const uint32_t id_namespace_;
67 cc::SurfaceFactory factory_;
68 mojo::ScopedMessagePipeHandle command_buffer_handle_;
69 mojo::ResourceReturnerPtr returner_;
70 mojo::Binding<Surface> binding_;
71 bool connection_closed_;
72
73 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
74 };
75
76 } // namespace surfaces
77
78 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_IMPL_H_
OLDNEW
« no previous file with comments | « components/view_manager/surfaces/surfaces_delegate.h ('k') | components/view_manager/surfaces/surfaces_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698