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

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

Issue 2654653004: Remove SurfaceReferenceManager interface. (Closed)
Patch Set: Rebase + fix tests. Created 3 years, 10 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
« no previous file with comments | « cc/surfaces/surface_reference_manager.h ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DISPLAY_COMPOSITOR_H_
6 #define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 6 #define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 15 matching lines...) Expand all
26 #include "ipc/ipc_channel_handle.h" 26 #include "ipc/ipc_channel_handle.h"
27 #include "mojo/public/cpp/bindings/binding.h" 27 #include "mojo/public/cpp/bindings/binding.h"
28 28
29 namespace gpu { 29 namespace gpu {
30 class GpuMemoryBufferManager; 30 class GpuMemoryBufferManager;
31 class ImageFactory; 31 class ImageFactory;
32 } 32 }
33 33
34 namespace cc { 34 namespace cc {
35 class Display; 35 class Display;
36 class SurfaceManager;
37 class SyntheticBeginFrameSource; 36 class SyntheticBeginFrameSource;
38 } 37 }
39 38
40 namespace display_compositor { 39 namespace display_compositor {
41 class GpuCompositorFrameSink; 40 class GpuCompositorFrameSink;
42 } 41 }
43 42
44 namespace ui { 43 namespace ui {
45 44
46 // The DisplayCompositor object is an object global to the Window Server app 45 // The DisplayCompositor object is an object global to the Window Server app
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void CreateCompositorFrameSinkInternal( 92 void CreateCompositorFrameSinkInternal(
94 const cc::FrameSinkId& frame_sink_id, 93 const cc::FrameSinkId& frame_sink_id,
95 gpu::SurfaceHandle surface_handle, 94 gpu::SurfaceHandle surface_handle,
96 std::unique_ptr<cc::Display> display, 95 std::unique_ptr<cc::Display> display,
97 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source, 96 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source,
98 cc::mojom::MojoCompositorFrameSinkRequest request, 97 cc::mojom::MojoCompositorFrameSinkRequest request,
99 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, 98 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request,
100 cc::mojom::MojoCompositorFrameSinkClientPtr client, 99 cc::mojom::MojoCompositorFrameSinkClientPtr client,
101 cc::mojom::DisplayPrivateRequest display_private_request); 100 cc::mojom::DisplayPrivateRequest display_private_request);
102 101
103 const cc::SurfaceId& GetRootSurfaceId() const;
104
105 // cc::SurfaceObserver implementation. 102 // cc::SurfaceObserver implementation.
106 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override; 103 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override;
107 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, 104 void OnSurfaceDamaged(const cc::SurfaceId& surface_id,
108 bool* changed) override; 105 bool* changed) override;
109 106
110 // SurfaceManager should be the first object constructed and the last object 107 // SurfaceManager should be the first object constructed and the last object
111 // destroyed in order to ensure that all other objects that depend on it have 108 // destroyed in order to ensure that all other objects that depend on it have
112 // access to a valid pointer for the entirety of their liftimes. 109 // access to a valid pointer for the entirety of their liftimes.
113 cc::SurfaceManager manager_; 110 cc::SurfaceManager manager_;
114 111
115 // Will normally point to |manager_| as it provides the interface. For tests
116 // it will be swapped out with a mock implementation.
117 cc::SurfaceReferenceManager* reference_manager_;
118
119 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; 112 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_;
120 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; 113 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_;
121 gpu::ImageFactory* image_factory_; 114 gpu::ImageFactory* image_factory_;
122 115
123 std::unordered_map< 116 std::unordered_map<
124 cc::FrameSinkId, 117 cc::FrameSinkId,
125 std::unique_ptr<display_compositor::GpuCompositorFrameSink>, 118 std::unique_ptr<display_compositor::GpuCompositorFrameSink>,
126 cc::FrameSinkIdHash> 119 cc::FrameSinkIdHash>
127 compositor_frame_sinks_; 120 compositor_frame_sinks_;
128 121
129 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 122 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
130 123
131 base::ThreadChecker thread_checker_; 124 base::ThreadChecker thread_checker_;
132 125
133 cc::mojom::DisplayCompositorClientPtr client_; 126 cc::mojom::DisplayCompositorClientPtr client_;
134 mojo::Binding<cc::mojom::DisplayCompositor> binding_; 127 mojo::Binding<cc::mojom::DisplayCompositor> binding_;
135 128
136 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); 129 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor);
137 }; 130 };
138 131
139 } // namespace ui 132 } // namespace ui
140 133
141 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ 134 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_reference_manager.h ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698