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