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

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

Issue 2797453002: Rename DisplayCompositor to MojoFrameSinkManager. (Closed)
Patch Set: Fix 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 // The MojoFrameSinkManager object is an object global to the Window Server app
28 // that holds the SurfaceServer and allocates new Surfaces namespaces. 28 // that holds the SurfaceServer and allocates new Surfaces namespaces.
29 // This object lives on the main thread of the Window Server. 29 // This object lives on the main thread of the Window Server.
30 // TODO(rjkroege, fsamuel): This object will need to change to support multiple 30 // TODO(rjkroege, fsamuel): This object will need to change to support multiple
31 // displays. 31 // displays.
32 class DisplayCompositor 32 class MojoFrameSinkManager
msw 2017/04/03 19:22:13 q: Why use Mojo in this name? Maybe explain in com
kylechar 2017/04/03 19:54:15 There is a cc::FrameSinkManager already :( MojoFra
danakj 2017/04/03 19:55:15 Also this is managing MojoCompositorFrameSink, so
msw 2017/04/03 20:07:34 Then I'd ask the same question of MojoCompositorFr
danakj 2017/04/03 20:11:15 We had that discussion on the CL that introduced t
33 : public cc::SurfaceObserver, 33 : public cc::SurfaceObserver,
34 public display_compositor::GpuCompositorFrameSinkDelegate, 34 public display_compositor::GpuCompositorFrameSinkDelegate,
35 public cc::mojom::DisplayCompositor { 35 public cc::mojom::FrameSinkManager {
36 public: 36 public:
37 DisplayCompositor(DisplayProvider* display_provider, 37 MojoFrameSinkManager(DisplayProvider* display_provider,
38 cc::mojom::DisplayCompositorRequest request, 38 cc::mojom::FrameSinkManagerRequest request,
39 cc::mojom::DisplayCompositorClientPtr client); 39 cc::mojom::FrameSinkManagerClientPtr client);
40 ~DisplayCompositor() override; 40 ~MojoFrameSinkManager() override;
41 41
42 cc::SurfaceManager* manager() { return &manager_; } 42 cc::SurfaceManager* manager() { return &manager_; }
43 43
44 // cc::mojom::DisplayCompositor implementation: 44 // cc::mojom::MojoFrameSinkManager implementation:
45 void CreateRootCompositorFrameSink( 45 void CreateRootCompositorFrameSink(
46 const cc::FrameSinkId& frame_sink_id, 46 const cc::FrameSinkId& frame_sink_id,
47 gpu::SurfaceHandle surface_handle, 47 gpu::SurfaceHandle surface_handle,
48 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, 48 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request,
49 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, 49 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
50 cc::mojom::MojoCompositorFrameSinkClientPtr client, 50 cc::mojom::MojoCompositorFrameSinkClientPtr client,
51 cc::mojom::DisplayPrivateAssociatedRequest display_private_request) 51 cc::mojom::DisplayPrivateAssociatedRequest display_private_request)
52 override; 52 override;
53 void CreateCompositorFrameSink( 53 void CreateCompositorFrameSink(
54 const cc::FrameSinkId& frame_sink_id, 54 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(). 90 // Provides a cc::Display for CreateRootCompositorFrameSink().
91 DisplayProvider* const display_provider_; 91 DisplayProvider* const display_provider_;
92 92
93 std::unordered_map<cc::FrameSinkId, 93 std::unordered_map<cc::FrameSinkId,
94 std::unique_ptr<cc::mojom::MojoCompositorFrameSink>, 94 std::unique_ptr<cc::mojom::MojoCompositorFrameSink>,
95 cc::FrameSinkIdHash> 95 cc::FrameSinkIdHash>
96 compositor_frame_sinks_; 96 compositor_frame_sinks_;
97 97
98 base::ThreadChecker thread_checker_; 98 base::ThreadChecker thread_checker_;
99 99
100 cc::mojom::DisplayCompositorClientPtr client_; 100 cc::mojom::FrameSinkManagerClientPtr client_;
101 mojo::Binding<cc::mojom::DisplayCompositor> binding_; 101 mojo::Binding<cc::mojom::FrameSinkManager> binding_;
102 102
103 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); 103 DISALLOW_COPY_AND_ASSIGN(MojoFrameSinkManager);
104 }; 104 };
105 105
106 } // namespace ui 106 } // namespace ui
107 107
108 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 108 #endif // SERVICES_UI_SURFACES_MOJO_FRAME_SINK_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698