| 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_IPC_IN_PROCESS_COMMAND_BUFFER_H_ | 5 #ifndef GPU_IPC_IN_PROCESS_COMMAND_BUFFER_H_ |
| 6 #define GPU_IPC_IN_PROCESS_COMMAND_BUFFER_H_ | 6 #define GPU_IPC_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 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/atomic_sequence_num.h" | 15 #include "base/atomic_sequence_num.h" |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 21 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
| 22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
| 23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 24 #include "base/threading/thread.h" | 24 #include "base/threading/thread.h" |
| 25 #include "gpu/command_buffer/client/gpu_control.h" | 25 #include "gpu/command_buffer/client/gpu_control.h" |
| 26 #include "gpu/command_buffer/common/activity_flags.h" |
| 26 #include "gpu/command_buffer/common/command_buffer.h" | 27 #include "gpu/command_buffer/common/command_buffer.h" |
| 27 #include "gpu/command_buffer/service/command_executor.h" | 28 #include "gpu/command_buffer/service/command_executor.h" |
| 28 #include "gpu/command_buffer/service/context_group.h" | 29 #include "gpu/command_buffer/service/context_group.h" |
| 29 #include "gpu/command_buffer/service/gpu_preferences.h" | 30 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 30 #include "gpu/config/gpu_driver_bug_workarounds.h" | 31 #include "gpu/config/gpu_driver_bug_workarounds.h" |
| 31 #include "gpu/gpu_export.h" | 32 #include "gpu/gpu_export.h" |
| 32 #include "gpu/ipc/service/image_transport_surface_delegate.h" | 33 #include "gpu/ipc/service/image_transport_surface_delegate.h" |
| 33 #include "ui/gfx/gpu_memory_buffer.h" | 34 #include "ui/gfx/gpu_memory_buffer.h" |
| 34 #include "ui/gfx/native_widget_types.h" | 35 #include "ui/gfx/native_widget_types.h" |
| 35 #include "ui/gl/gl_surface.h" | 36 #include "ui/gl/gl_surface.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 scoped_refptr<gles2::MailboxManager> mailbox_manager(); | 193 scoped_refptr<gles2::MailboxManager> mailbox_manager(); |
| 193 gpu::gles2::ProgramCache* program_cache(); | 194 gpu::gles2::ProgramCache* program_cache(); |
| 194 virtual bool BlockThreadOnWaitSyncToken() const = 0; | 195 virtual bool BlockThreadOnWaitSyncToken() const = 0; |
| 195 | 196 |
| 196 protected: | 197 protected: |
| 197 const GpuPreferences gpu_preferences_; | 198 const GpuPreferences gpu_preferences_; |
| 198 const GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; | 199 const GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; |
| 199 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 200 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 200 scoped_refptr<gl::GLShareGroup> share_group_; | 201 scoped_refptr<gl::GLShareGroup> share_group_; |
| 201 std::unique_ptr<gpu::gles2::ProgramCache> program_cache_; | 202 std::unique_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 203 // No-op default initialization is used in in-process mode. |
| 204 GpuProcessActivityFlags activity_flags_; |
| 202 }; | 205 }; |
| 203 | 206 |
| 204 private: | 207 private: |
| 205 struct InitializeOnGpuThreadParams { | 208 struct InitializeOnGpuThreadParams { |
| 206 bool is_offscreen; | 209 bool is_offscreen; |
| 207 SurfaceHandle window; | 210 SurfaceHandle window; |
| 208 const gles2::ContextCreationAttribHelper& attribs; | 211 const gles2::ContextCreationAttribHelper& attribs; |
| 209 gpu::Capabilities* capabilities; // Ouptut. | 212 gpu::Capabilities* capabilities; // Ouptut. |
| 210 InProcessCommandBuffer* context_group; | 213 InProcessCommandBuffer* context_group; |
| 211 ImageFactory* image_factory; | 214 ImageFactory* image_factory; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; | 330 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; |
| 328 base::WeakPtrFactory<InProcessCommandBuffer> client_thread_weak_ptr_factory_; | 331 base::WeakPtrFactory<InProcessCommandBuffer> client_thread_weak_ptr_factory_; |
| 329 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; | 332 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; |
| 330 | 333 |
| 331 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 334 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
| 332 }; | 335 }; |
| 333 | 336 |
| 334 } // namespace gpu | 337 } // namespace gpu |
| 335 | 338 |
| 336 #endif // GPU_IPC_IN_PROCESS_COMMAND_BUFFER_H_ | 339 #endif // GPU_IPC_IN_PROCESS_COMMAND_BUFFER_H_ |
| OLD | NEW |