| 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 CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 5 #ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| 6 #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 6 #define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/common/in_process_child_thread_params.h" | 11 #include "content/common/in_process_child_thread_params.h" |
| 12 #include "gpu/command_buffer/service/gpu_preferences.h" | 12 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 13 | 13 |
| 14 namespace gpu { | 14 namespace gpu { |
| 15 class GpuMemoryBufferFactory; | 15 struct GpuPreferences; |
| 16 class SyncPointManager; | 16 class SyncPointManager; |
| 17 struct GpuPreferences; | |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 | 20 |
| 21 class GpuMemoryBufferFactory; |
| 22 class GpuProcess; | 22 class GpuProcess; |
| 23 | 23 |
| 24 // This class creates a GPU thread (instead of a GPU process), when running | 24 // This class creates a GPU thread (instead of a GPU process), when running |
| 25 // with --in-process-gpu or --single-process. | 25 // with --in-process-gpu or --single-process. |
| 26 class InProcessGpuThread : public base::Thread { | 26 class InProcessGpuThread : public base::Thread { |
| 27 public: | 27 public: |
| 28 InProcessGpuThread(const InProcessChildThreadParams& params, | 28 InProcessGpuThread(const InProcessChildThreadParams& params, |
| 29 const gpu::GpuPreferences& gpu_preferences, | 29 const gpu::GpuPreferences& gpu_preferences, |
| 30 gpu::SyncPointManager* sync_point_manager_override); | 30 gpu::SyncPointManager* sync_point_manager_override); |
| 31 ~InProcessGpuThread() override; | 31 ~InProcessGpuThread() override; |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 void Init() override; | 34 void Init() override; |
| 35 void CleanUp() override; | 35 void CleanUp() override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 InProcessChildThreadParams params_; | 38 InProcessChildThreadParams params_; |
| 39 | 39 |
| 40 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. | 40 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers. |
| 41 GpuProcess* gpu_process_; | 41 GpuProcess* gpu_process_; |
| 42 | 42 |
| 43 const gpu::GpuPreferences gpu_preferences_; | 43 const gpu::GpuPreferences gpu_preferences_; |
| 44 | 44 |
| 45 // Can be null if overridden. | 45 // Can be null if overridden. |
| 46 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; | 46 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; |
| 47 | 47 |
| 48 // Non-owning. | 48 // Non-owning. |
| 49 gpu::SyncPointManager* sync_point_manager_override_; | 49 gpu::SyncPointManager* sync_point_manager_override_; |
| 50 | 50 |
| 51 scoped_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | 51 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); | 53 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( | 56 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( |
| 57 const InProcessChildThreadParams& params, | 57 const InProcessChildThreadParams& params, |
| 58 const gpu::GpuPreferences& gpu_preferences); | 58 const gpu::GpuPreferences& gpu_preferences); |
| 59 | 59 |
| 60 } // namespace content | 60 } // namespace content |
| 61 | 61 |
| 62 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 62 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
| OLD | NEW |