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

Side by Side Diff: components/mus/gpu/gpu_service_mus.h

Issue 2020293003: Use mus::MojoGpuMemoryBufferManager in mus::GpuService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_ 5 #ifndef COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
6 #define COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_ 6 #define COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/non_thread_safe.h"
10 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "gpu/command_buffer/service/gpu_preferences.h" 13 #include "gpu/command_buffer/service/gpu_preferences.h"
13 #include "gpu/config/gpu_info.h" 14 #include "gpu/config/gpu_info.h"
14 #include "gpu/ipc/client/gpu_channel_host.h" 15 #include "gpu/ipc/client/gpu_channel_host.h"
15 #include "gpu/ipc/common/surface_handle.h" 16 #include "gpu/ipc/common/surface_handle.h"
16 #include "gpu/ipc/service/gpu_channel.h" 17 #include "gpu/ipc/service/gpu_channel.h"
17 #include "gpu/ipc/service/gpu_channel_manager.h" 18 #include "gpu/ipc/service/gpu_channel_manager.h"
18 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" 19 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
19 #include "gpu/ipc/service/gpu_config.h" 20 #include "gpu/ipc/service/gpu_config.h"
(...skipping 14 matching lines...) Expand all
34 class GpuMemoryBufferFactory; 35 class GpuMemoryBufferFactory;
35 class SyncPointManager; 36 class SyncPointManager;
36 } 37 }
37 38
38 namespace media { 39 namespace media {
39 class MediaService; 40 class MediaService;
40 } 41 }
41 42
42 namespace mus { 43 namespace mus {
43 44
44 class GpuMemoryBufferManagerMusLocal; 45 class MojoGpuMemoryBufferManager;
45 46
46 // TODO(fsamuel): GpuServiceMus is intended to be the Gpu thread within Mus. 47 // TODO(fsamuel): GpuServiceMus is intended to be the Gpu thread within Mus.
47 // Similar to GpuChildThread, it is a GpuChannelManagerDelegate and will have a 48 // Similar to GpuChildThread, it is a GpuChannelManagerDelegate and will have a
48 // GpuChannelManager. 49 // GpuChannelManager.
49 class GpuServiceMus : public gpu::GpuChannelManagerDelegate, 50 class GpuServiceMus : public gpu::GpuChannelManagerDelegate,
50 public gpu::GpuChannelHostFactory { 51 public gpu::GpuChannelHostFactory,
52 public base::NonThreadSafe {
51 public: 53 public:
52 typedef base::Callback<void(const IPC::ChannelHandle&)> 54 typedef base::Callback<void(int client_id, const IPC::ChannelHandle&)>
53 EstablishGpuChannelCallback; 55 EstablishGpuChannelCallback;
54 void EstablishGpuChannel(int client_id, 56 void EstablishGpuChannel(uint64_t client_tracing_id,
55 uint64_t client_tracing_id,
56 bool preempts, 57 bool preempts,
57 bool allow_view_command_buffers, 58 bool allow_view_command_buffers,
58 bool allow_real_time_streams, 59 bool allow_real_time_streams,
59 const EstablishGpuChannelCallback& callback); 60 const EstablishGpuChannelCallback& callback);
60 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 61 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
61 const gfx::Size& size, 62 const gfx::Size& size,
62 gfx::BufferFormat format, 63 gfx::BufferFormat format,
63 gfx::BufferUsage usage, 64 gfx::BufferUsage usage,
64 int client_id, 65 int client_id,
65 int32_t surface_handle); 66 int32_t surface_handle);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void Initialize(); 115 void Initialize();
115 void InitializeOnGpuThread(IPC::ChannelHandle* channel_handle, 116 void InitializeOnGpuThread(IPC::ChannelHandle* channel_handle,
116 base::WaitableEvent* event); 117 base::WaitableEvent* event);
117 void EstablishGpuChannelOnGpuThread(int client_id, 118 void EstablishGpuChannelOnGpuThread(int client_id,
118 uint64_t client_tracing_id, 119 uint64_t client_tracing_id,
119 bool preempts, 120 bool preempts,
120 bool allow_view_command_buffers, 121 bool allow_view_command_buffers,
121 bool allow_real_time_streams, 122 bool allow_real_time_streams,
122 IPC::ChannelHandle* channel_handle); 123 IPC::ChannelHandle* channel_handle);
123 124
125 // The next client id.
126 int next_client_id_;
127
124 // The main thread message loop. 128 // The main thread message loop.
125 base::MessageLoop* main_message_loop_; 129 base::MessageLoop* main_message_loop_;
126 130
127 // An event that will be signalled when we shutdown. 131 // An event that will be signalled when we shutdown.
128 base::WaitableEvent shutdown_event_; 132 base::WaitableEvent shutdown_event_;
129 133
130 // The main thread for GpuService. 134 // The main thread for GpuService.
131 base::Thread gpu_thread_; 135 base::Thread gpu_thread_;
132 136
133 // The thread that handles IO events for GpuService. 137 // The thread that handles IO events for GpuService.
134 base::Thread io_thread_; 138 base::Thread io_thread_;
135 139
136 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; 140 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
137 141
138 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; 142 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
139 143
140 std::unique_ptr<media::MediaService> media_service_; 144 std::unique_ptr<media::MediaService> media_service_;
141 145
142 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_; 146 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
143 147
144 // A GPU memory buffer manager used locally. 148 // A GPU memory buffer manager used locally.
145 std::unique_ptr<GpuMemoryBufferManagerMusLocal> 149 std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_local_;
146 gpu_memory_buffer_manager_mus_local_;
147 150
148 // A GPU channel used locally. 151 // A GPU channel used locally.
149 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local_; 152 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local_;
150 153
151 gpu::GpuPreferences gpu_preferences_; 154 gpu::GpuPreferences gpu_preferences_;
152 155
153 // Information about the GPU, such as device and vendor ID. 156 // Information about the GPU, such as device and vendor ID.
154 gpu::GPUInfo gpu_info_; 157 gpu::GPUInfo gpu_info_;
155 158
156 DISALLOW_COPY_AND_ASSIGN(GpuServiceMus); 159 DISALLOW_COPY_AND_ASSIGN(GpuServiceMus);
157 }; 160 };
158 161
159 } // namespace mus 162 } // namespace mus
160 163
161 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_ 164 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698