| 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 25 matching lines...) Expand all Loading... |
| 36 class SequenceChecker; | 36 class SequenceChecker; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace gfx { | 39 namespace gfx { |
| 40 class GLContext; | 40 class GLContext; |
| 41 class GLShareGroup; | 41 class GLShareGroup; |
| 42 class GLSurface; | 42 class GLSurface; |
| 43 class Size; | 43 class Size; |
| 44 } | 44 } |
| 45 | 45 |
| 46 #if defined(OS_ANDROID) | |
| 47 namespace gfx { | |
| 48 class SurfaceTexture; | |
| 49 } | |
| 50 namespace gpu { | |
| 51 class StreamTextureManagerInProcess; | |
| 52 } | |
| 53 #endif | |
| 54 | |
| 55 namespace gpu { | 46 namespace gpu { |
| 56 class SyncPointClient; | 47 class SyncPointClient; |
| 57 class SyncPointOrderData; | 48 class SyncPointOrderData; |
| 58 class SyncPointManager; | 49 class SyncPointManager; |
| 59 class ValueStateMap; | 50 class ValueStateMap; |
| 60 | 51 |
| 61 namespace gles2 { | 52 namespace gles2 { |
| 62 class FramebufferCompletenessCache; | 53 class FramebufferCompletenessCache; |
| 63 class GLES2Decoder; | 54 class GLES2Decoder; |
| 64 class MailboxManager; | 55 class MailboxManager; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 162 |
| 172 private: | 163 private: |
| 173 const GpuPreferences gpu_preferences_; | 164 const GpuPreferences gpu_preferences_; |
| 174 scoped_refptr<gfx::GLShareGroup> share_group_; | 165 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 175 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 166 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 176 scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_; | 167 scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_; |
| 177 scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; | 168 scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; |
| 178 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 169 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 179 }; | 170 }; |
| 180 | 171 |
| 181 #if defined(OS_ANDROID) | |
| 182 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture(uint32_t stream_id); | |
| 183 uint32_t CreateStreamTexture(uint32_t texture_id); | |
| 184 #endif | |
| 185 | |
| 186 private: | 172 private: |
| 187 struct InitializeOnGpuThreadParams { | 173 struct InitializeOnGpuThreadParams { |
| 188 bool is_offscreen; | 174 bool is_offscreen; |
| 189 gfx::AcceleratedWidget window; | 175 gfx::AcceleratedWidget window; |
| 190 const gfx::Size& size; | 176 const gfx::Size& size; |
| 191 const std::vector<int32_t>& attribs; | 177 const std::vector<int32_t>& attribs; |
| 192 gfx::GpuPreference gpu_preference; | 178 gfx::GpuPreference gpu_preference; |
| 193 gpu::Capabilities* capabilities; // Ouptut. | 179 gpu::Capabilities* capabilities; // Ouptut. |
| 194 InProcessCommandBuffer* context_group; | 180 InProcessCommandBuffer* context_group; |
| 195 ImageFactory* image_factory; | 181 ImageFactory* image_factory; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 210 capabilities(capabilities), | 196 capabilities(capabilities), |
| 211 context_group(share_group), | 197 context_group(share_group), |
| 212 image_factory(image_factory) {} | 198 image_factory(image_factory) {} |
| 213 }; | 199 }; |
| 214 | 200 |
| 215 bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params); | 201 bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params); |
| 216 void Destroy(); | 202 void Destroy(); |
| 217 bool DestroyOnGpuThread(); | 203 bool DestroyOnGpuThread(); |
| 218 void FlushOnGpuThread(int32_t put_offset, uint32_t order_num); | 204 void FlushOnGpuThread(int32_t put_offset, uint32_t order_num); |
| 219 void ScheduleDelayedWorkOnGpuThread(); | 205 void ScheduleDelayedWorkOnGpuThread(); |
| 220 uint32_t CreateStreamTextureOnGpuThread(uint32_t client_texture_id); | |
| 221 bool MakeCurrent(); | 206 bool MakeCurrent(); |
| 222 base::Closure WrapCallback(const base::Closure& callback); | 207 base::Closure WrapCallback(const base::Closure& callback); |
| 223 State GetStateFast(); | 208 State GetStateFast(); |
| 224 void QueueTask(const base::Closure& task) { service_->ScheduleTask(task); } | 209 void QueueTask(const base::Closure& task) { service_->ScheduleTask(task); } |
| 225 void CheckSequencedThread(); | 210 void CheckSequencedThread(); |
| 226 void FenceSyncReleaseOnGpuThread(uint64_t release); | 211 void FenceSyncReleaseOnGpuThread(uint64_t release); |
| 227 bool WaitFenceSyncOnGpuThread(gpu::CommandBufferNamespace namespace_id, | 212 bool WaitFenceSyncOnGpuThread(gpu::CommandBufferNamespace namespace_id, |
| 228 gpu::CommandBufferId command_buffer_id, | 213 gpu::CommandBufferId command_buffer_id, |
| 229 uint64_t release); | 214 uint64_t release); |
| 230 void SignalSyncTokenOnGpuThread(const SyncToken& sync_token, | 215 void SignalSyncTokenOnGpuThread(const SyncToken& sync_token, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Accessed on both threads: | 266 // Accessed on both threads: |
| 282 scoped_ptr<CommandBufferServiceBase> command_buffer_; | 267 scoped_ptr<CommandBufferServiceBase> command_buffer_; |
| 283 base::Lock command_buffer_lock_; | 268 base::Lock command_buffer_lock_; |
| 284 base::WaitableEvent flush_event_; | 269 base::WaitableEvent flush_event_; |
| 285 scoped_refptr<Service> service_; | 270 scoped_refptr<Service> service_; |
| 286 State state_after_last_flush_; | 271 State state_after_last_flush_; |
| 287 base::Lock state_after_last_flush_lock_; | 272 base::Lock state_after_last_flush_lock_; |
| 288 scoped_refptr<gfx::GLShareGroup> gl_share_group_; | 273 scoped_refptr<gfx::GLShareGroup> gl_share_group_; |
| 289 base::WaitableEvent fence_sync_wait_event_; | 274 base::WaitableEvent fence_sync_wait_event_; |
| 290 | 275 |
| 291 #if defined(OS_ANDROID) | |
| 292 scoped_ptr<StreamTextureManagerInProcess> stream_texture_manager_; | |
| 293 #endif | |
| 294 | |
| 295 // Only used with explicit scheduling and the gpu thread is the same as | 276 // Only used with explicit scheduling and the gpu thread is the same as |
| 296 // the client thread. | 277 // the client thread. |
| 297 scoped_ptr<base::SequenceChecker> sequence_checker_; | 278 scoped_ptr<base::SequenceChecker> sequence_checker_; |
| 298 | 279 |
| 299 base::WeakPtr<InProcessCommandBuffer> client_thread_weak_ptr_; | 280 base::WeakPtr<InProcessCommandBuffer> client_thread_weak_ptr_; |
| 300 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; | 281 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; |
| 301 base::WeakPtrFactory<InProcessCommandBuffer> client_thread_weak_ptr_factory_; | 282 base::WeakPtrFactory<InProcessCommandBuffer> client_thread_weak_ptr_factory_; |
| 302 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; | 283 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; |
| 303 | 284 |
| 304 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 285 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 330 SyncPointManager* sync_point_manager_; // Non-owning. | 311 SyncPointManager* sync_point_manager_; // Non-owning. |
| 331 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 312 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 332 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | 313 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 333 framebuffer_completeness_cache_; | 314 framebuffer_completeness_cache_; |
| 334 DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread); | 315 DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread); |
| 335 }; | 316 }; |
| 336 | 317 |
| 337 } // namespace gpu | 318 } // namespace gpu |
| 338 | 319 |
| 339 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 320 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
| OLD | NEW |