OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void DestroyImage(int32_t id) override; | 120 void DestroyImage(int32_t id) override; |
121 int32_t CreateGpuMemoryBufferImage(size_t width, | 121 int32_t CreateGpuMemoryBufferImage(size_t width, |
122 size_t height, | 122 size_t height, |
123 unsigned internalformat, | 123 unsigned internalformat, |
124 unsigned usage) override; | 124 unsigned usage) override; |
125 void SignalQuery(uint32_t query_id, const base::Closure& callback) override; | 125 void SignalQuery(uint32_t query_id, const base::Closure& callback) override; |
126 void SetLock(base::Lock*) override; | 126 void SetLock(base::Lock*) override; |
127 bool IsGpuChannelLost() override; | 127 bool IsGpuChannelLost() override; |
128 void EnsureWorkVisible() override; | 128 void EnsureWorkVisible() override; |
129 CommandBufferNamespace GetNamespaceID() const override; | 129 CommandBufferNamespace GetNamespaceID() const override; |
130 uint64_t GetCommandBufferID() const override; | 130 CommandBufferId GetCommandBufferID() const override; |
131 int32_t GetExtraCommandBufferData() const override; | 131 int32_t GetExtraCommandBufferData() const override; |
132 uint64_t GenerateFenceSyncRelease() override; | 132 uint64_t GenerateFenceSyncRelease() override; |
133 bool IsFenceSyncRelease(uint64_t release) override; | 133 bool IsFenceSyncRelease(uint64_t release) override; |
134 bool IsFenceSyncFlushed(uint64_t release) override; | 134 bool IsFenceSyncFlushed(uint64_t release) override; |
135 bool IsFenceSyncFlushReceived(uint64_t release) override; | 135 bool IsFenceSyncFlushReceived(uint64_t release) override; |
136 void SignalSyncToken(const SyncToken& sync_token, | 136 void SignalSyncToken(const SyncToken& sync_token, |
137 const base::Closure& callback) override; | 137 const base::Closure& callback) override; |
138 bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) override; | 138 bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) override; |
139 | 139 |
140 // The serializer interface to the GPU service (i.e. thread). | 140 // The serializer interface to the GPU service (i.e. thread). |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 void FlushOnGpuThread(int32_t put_offset, uint32_t order_num); | 212 void FlushOnGpuThread(int32_t put_offset, uint32_t order_num); |
213 void ScheduleDelayedWorkOnGpuThread(); | 213 void ScheduleDelayedWorkOnGpuThread(); |
214 uint32_t CreateStreamTextureOnGpuThread(uint32_t client_texture_id); | 214 uint32_t CreateStreamTextureOnGpuThread(uint32_t client_texture_id); |
215 bool MakeCurrent(); | 215 bool MakeCurrent(); |
216 base::Closure WrapCallback(const base::Closure& callback); | 216 base::Closure WrapCallback(const base::Closure& callback); |
217 State GetStateFast(); | 217 State GetStateFast(); |
218 void QueueTask(const base::Closure& task) { service_->ScheduleTask(task); } | 218 void QueueTask(const base::Closure& task) { service_->ScheduleTask(task); } |
219 void CheckSequencedThread(); | 219 void CheckSequencedThread(); |
220 void FenceSyncReleaseOnGpuThread(uint64_t release); | 220 void FenceSyncReleaseOnGpuThread(uint64_t release); |
221 bool WaitFenceSyncOnGpuThread(gpu::CommandBufferNamespace namespace_id, | 221 bool WaitFenceSyncOnGpuThread(gpu::CommandBufferNamespace namespace_id, |
222 uint64_t command_buffer_id, | 222 gpu::CommandBufferId command_buffer_id, |
223 uint64_t release); | 223 uint64_t release); |
224 void SignalSyncTokenOnGpuThread(const SyncToken& sync_token, | 224 void SignalSyncTokenOnGpuThread(const SyncToken& sync_token, |
225 const base::Closure& callback); | 225 const base::Closure& callback); |
226 void SignalQueryOnGpuThread(unsigned query_id, const base::Closure& callback); | 226 void SignalQueryOnGpuThread(unsigned query_id, const base::Closure& callback); |
227 void DestroyTransferBufferOnGpuThread(int32_t id); | 227 void DestroyTransferBufferOnGpuThread(int32_t id); |
228 void CreateImageOnGpuThread(int32_t id, | 228 void CreateImageOnGpuThread(int32_t id, |
229 const gfx::GpuMemoryBufferHandle& handle, | 229 const gfx::GpuMemoryBufferHandle& handle, |
230 const gfx::Size& size, | 230 const gfx::Size& size, |
231 gfx::BufferFormat format, | 231 gfx::BufferFormat format, |
232 uint32_t internalformat, | 232 uint32_t internalformat, |
233 uint32_t order_num, | 233 uint32_t order_num, |
234 uint64_t fence_sync); | 234 uint64_t fence_sync); |
235 void DestroyImageOnGpuThread(int32_t id); | 235 void DestroyImageOnGpuThread(int32_t id); |
236 void SetGetBufferOnGpuThread(int32_t shm_id, base::WaitableEvent* completion); | 236 void SetGetBufferOnGpuThread(int32_t shm_id, base::WaitableEvent* completion); |
237 | 237 |
238 // Callbacks: | 238 // Callbacks: |
239 void OnContextLost(); | 239 void OnContextLost(); |
240 bool GetBufferChanged(int32_t transfer_buffer_id); | 240 bool GetBufferChanged(int32_t transfer_buffer_id); |
241 void PumpCommands(); | 241 void PumpCommands(); |
242 void PerformDelayedWork(); | 242 void PerformDelayedWork(); |
243 | 243 |
244 const uint64_t command_buffer_id_; | 244 const CommandBufferId command_buffer_id_; |
245 | 245 |
246 // Members accessed on the gpu thread (possibly with the exception of | 246 // Members accessed on the gpu thread (possibly with the exception of |
247 // creation): | 247 // creation): |
248 bool context_lost_; | 248 bool context_lost_; |
249 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 249 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
250 scoped_ptr<GpuScheduler> gpu_scheduler_; | 250 scoped_ptr<GpuScheduler> gpu_scheduler_; |
251 scoped_ptr<gles2::GLES2Decoder> decoder_; | 251 scoped_ptr<gles2::GLES2Decoder> decoder_; |
252 scoped_refptr<gfx::GLContext> context_; | 252 scoped_refptr<gfx::GLContext> context_; |
253 scoped_refptr<gfx::GLSurface> surface_; | 253 scoped_refptr<gfx::GLSurface> surface_; |
254 scoped_refptr<SyncPointOrderData> sync_point_order_data_; | 254 scoped_refptr<SyncPointOrderData> sync_point_order_data_; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 SyncPointManager* sync_point_manager_; // Non-owning. | 316 SyncPointManager* sync_point_manager_; // Non-owning. |
317 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 317 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
318 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | 318 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
319 framebuffer_completeness_cache_; | 319 framebuffer_completeness_cache_; |
320 DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread); | 320 DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread); |
321 }; | 321 }; |
322 | 322 |
323 } // namespace gpu | 323 } // namespace gpu |
324 | 324 |
325 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 325 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
OLD | NEW |