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

Side by Side Diff: services/ui/surfaces/mojo_frame_sink_manager.h

Issue 2797453002: Rename DisplayCompositor to MojoFrameSinkManager. (Closed)
Patch Set: Fix msw@ comments. Created 3 years, 8 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 5 #ifndef SERVICES_UI_SURFACES_MOJO_FRAME_SINK_MANAGER_H_
6 #define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 6 #define SERVICES_UI_SURFACES_MOJO_FRAME_SINK_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <unordered_map> 11 #include <unordered_map>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "cc/ipc/display_compositor.mojom.h" 15 #include "cc/ipc/frame_sink_manager.mojom.h"
16 #include "cc/surfaces/frame_sink_id.h" 16 #include "cc/surfaces/frame_sink_id.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "cc/surfaces/surface_observer.h" 18 #include "cc/surfaces/surface_observer.h"
19 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h" 19 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h"
20 #include "gpu/ipc/common/surface_handle.h" 20 #include "gpu/ipc/common/surface_handle.h"
21 #include "mojo/public/cpp/bindings/binding.h" 21 #include "mojo/public/cpp/bindings/binding.h"
22 22
23 namespace ui { 23 namespace ui {
24 24
25 class DisplayProvider; 25 class DisplayProvider;
26 26
27 // The DisplayCompositor object is an object global to the Window Server app 27 // MojoFrameSinkManager manages state associated with CompositorFrameSinks. It
28 // that holds the SurfaceServer and allocates new Surfaces namespaces. 28 // provides a Mojo interface to create CompositorFrameSinks, manage BeginFrame
msw 2017/04/03 20:07:34 nit: 'manages' here and on the next line?
kylechar 2017/04/03 20:32:06 Done.
29 // This object lives on the main thread of the Window Server. 29 // hierarchy and managed surface lifetime.
30 // TODO(rjkroege, fsamuel): This object will need to change to support multiple 30 //
31 // displays. 31 // This is intended to created in the viz or GPU process. For mus+ash this will
msw 2017/04/03 20:07:34 nit: 'be created'? Is 'viz' the appropriate proces
kylechar 2017/04/03 20:32:06 Changed. Also, yep, basically GPU process => viz p
32 class DisplayCompositor 32 // be true after the mus process split. For non-mus Chrome this will be created
33 // in the browser process, at least until GPU implementations can be unified.
34 class MojoFrameSinkManager
33 : public cc::SurfaceObserver, 35 : public cc::SurfaceObserver,
34 public display_compositor::GpuCompositorFrameSinkDelegate, 36 public display_compositor::GpuCompositorFrameSinkDelegate,
35 public cc::mojom::DisplayCompositor { 37 public cc::mojom::FrameSinkManager {
36 public: 38 public:
37 DisplayCompositor(DisplayProvider* display_provider, 39 MojoFrameSinkManager(DisplayProvider* display_provider,
38 cc::mojom::DisplayCompositorRequest request, 40 cc::mojom::FrameSinkManagerRequest request,
39 cc::mojom::DisplayCompositorClientPtr client); 41 cc::mojom::FrameSinkManagerClientPtr client);
40 ~DisplayCompositor() override; 42 ~MojoFrameSinkManager() override;
41 43
42 cc::SurfaceManager* manager() { return &manager_; } 44 cc::SurfaceManager* manager() { return &manager_; }
43 45
44 // cc::mojom::DisplayCompositor implementation: 46 // cc::mojom::MojoFrameSinkManager implementation:
45 void CreateRootCompositorFrameSink( 47 void CreateRootCompositorFrameSink(
46 const cc::FrameSinkId& frame_sink_id, 48 const cc::FrameSinkId& frame_sink_id,
47 gpu::SurfaceHandle surface_handle, 49 gpu::SurfaceHandle surface_handle,
48 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, 50 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request,
49 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, 51 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
50 cc::mojom::MojoCompositorFrameSinkClientPtr client, 52 cc::mojom::MojoCompositorFrameSinkClientPtr client,
51 cc::mojom::DisplayPrivateAssociatedRequest display_private_request) 53 cc::mojom::DisplayPrivateAssociatedRequest display_private_request)
52 override; 54 override;
53 void CreateCompositorFrameSink( 55 void CreateCompositorFrameSink(
54 const cc::FrameSinkId& frame_sink_id, 56 const cc::FrameSinkId& frame_sink_id,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Provides a cc::Display for CreateRootCompositorFrameSink(). 92 // Provides a cc::Display for CreateRootCompositorFrameSink().
91 DisplayProvider* const display_provider_; 93 DisplayProvider* const display_provider_;
92 94
93 std::unordered_map<cc::FrameSinkId, 95 std::unordered_map<cc::FrameSinkId,
94 std::unique_ptr<cc::mojom::MojoCompositorFrameSink>, 96 std::unique_ptr<cc::mojom::MojoCompositorFrameSink>,
95 cc::FrameSinkIdHash> 97 cc::FrameSinkIdHash>
96 compositor_frame_sinks_; 98 compositor_frame_sinks_;
97 99
98 base::ThreadChecker thread_checker_; 100 base::ThreadChecker thread_checker_;
99 101
100 cc::mojom::DisplayCompositorClientPtr client_; 102 cc::mojom::FrameSinkManagerClientPtr client_;
101 mojo::Binding<cc::mojom::DisplayCompositor> binding_; 103 mojo::Binding<cc::mojom::FrameSinkManager> binding_;
102 104
103 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); 105 DISALLOW_COPY_AND_ASSIGN(MojoFrameSinkManager);
104 }; 106 };
105 107
106 } // namespace ui 108 } // namespace ui
107 109
108 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 110 #endif // SERVICES_UI_SURFACES_MOJO_FRAME_SINK_MANAGER_H_
OLDNEW
« no previous file with comments | « services/ui/surfaces/display_provider.h ('k') | services/ui/surfaces/mojo_frame_sink_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698