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

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

Issue 2049083002: Implement MusGpuMemoryBufferManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the mojom document 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
« no previous file with comments | « components/mus/gpu/DEPS ('k') | components/mus/gpu/gpu_service_mus.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 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/non_thread_safe.h"
(...skipping 24 matching lines...) Expand all
35 class GpuMemoryBufferFactory; 35 class GpuMemoryBufferFactory;
36 class SyncPointManager; 36 class SyncPointManager;
37 } 37 }
38 38
39 namespace media { 39 namespace media {
40 class MediaService; 40 class MediaService;
41 } 41 }
42 42
43 namespace mus { 43 namespace mus {
44 44
45 class MojoGpuMemoryBufferManager; 45 class MusGpuMemoryBufferManager;
46 46
47 // 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.
48 // Similar to GpuChildThread, it is a GpuChannelManagerDelegate and will have a 48 // Similar to GpuChildThread, it is a GpuChannelManagerDelegate and will have a
49 // GpuChannelManager. 49 // GpuChannelManager.
50 class GpuServiceMus : public gpu::GpuChannelManagerDelegate, 50 class GpuServiceMus : public gpu::GpuChannelManagerDelegate,
51 public gpu::GpuChannelHostFactory, 51 public gpu::GpuChannelHostFactory,
52 public base::NonThreadSafe { 52 public base::NonThreadSafe {
53 public: 53 public:
54 typedef base::Callback<void(int client_id, const IPC::ChannelHandle&)> 54 typedef base::Callback<void(int client_id, const IPC::ChannelHandle&)>
55 EstablishGpuChannelCallback; 55 EstablishGpuChannelCallback;
(...skipping 12 matching lines...) Expand all
68 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle( 68 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle(
69 gfx::GpuMemoryBufferHandle buffer_handle, 69 gfx::GpuMemoryBufferHandle buffer_handle,
70 gfx::GpuMemoryBufferId id, 70 gfx::GpuMemoryBufferId id,
71 const gfx::Size& size, 71 const gfx::Size& size,
72 gfx::BufferFormat format, 72 gfx::BufferFormat format,
73 int client_id); 73 int client_id);
74 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 74 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
75 int client_id, 75 int client_id,
76 const gpu::SyncToken& sync_token); 76 const gpu::SyncToken& sync_token);
77 77
78 gpu::GpuChannelManager* gpu_channel_manager() const {
79 return gpu_channel_manager_.get();
80 }
81
82 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory() const {
83 return gpu_memory_buffer_factory_.get();
84 }
85
78 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local() const { 86 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local() const {
79 return gpu_channel_local_; 87 return gpu_channel_local_;
80 } 88 }
81 89
82 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } 90 const gpu::GPUInfo& gpu_info() const { return gpu_info_; }
83 91
84 // GpuChannelManagerDelegate overrides: 92 // GpuChannelManagerDelegate overrides:
85 void DidCreateOffscreenContext(const GURL& active_url) override; 93 void DidCreateOffscreenContext(const GURL& active_url) override;
86 void DidDestroyChannel(int client_id) override; 94 void DidDestroyChannel(int client_id) override;
87 void DidDestroyOffscreenContext(const GURL& active_url) override; 95 void DidDestroyOffscreenContext(const GURL& active_url) override;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 148
141 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; 149 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
142 150
143 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; 151 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
144 152
145 std::unique_ptr<media::MediaService> media_service_; 153 std::unique_ptr<media::MediaService> media_service_;
146 154
147 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_; 155 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
148 156
149 // A GPU memory buffer manager used locally. 157 // A GPU memory buffer manager used locally.
150 std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_local_; 158 std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_local_;
151 159
152 // A GPU channel used locally. 160 // A GPU channel used locally.
153 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local_; 161 scoped_refptr<gpu::GpuChannelHost> gpu_channel_local_;
154 162
155 gpu::GpuPreferences gpu_preferences_; 163 gpu::GpuPreferences gpu_preferences_;
156 164
157 // Information about the GPU, such as device and vendor ID. 165 // Information about the GPU, such as device and vendor ID.
158 gpu::GPUInfo gpu_info_; 166 gpu::GPUInfo gpu_info_;
159 167
160 DISALLOW_COPY_AND_ASSIGN(GpuServiceMus); 168 DISALLOW_COPY_AND_ASSIGN(GpuServiceMus);
161 }; 169 };
162 170
163 } // namespace mus 171 } // namespace mus
164 172
165 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_ 173 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_MUS_H_
OLDNEW
« no previous file with comments | « components/mus/gpu/DEPS ('k') | components/mus/gpu/gpu_service_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698