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 | 13 |
13 namespace gpu { | 14 namespace gpu { |
| 15 struct GpuPreferences; |
14 class SyncPointManager; | 16 class SyncPointManager; |
15 } | 17 } |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 class GpuMemoryBufferFactory; | 21 class GpuMemoryBufferFactory; |
20 class GpuProcess; | 22 class GpuProcess; |
21 | 23 |
22 // 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 |
23 // with --in-process-gpu or --single-process. | 25 // with --in-process-gpu or --single-process. |
24 class InProcessGpuThread : public base::Thread { | 26 class InProcessGpuThread : public base::Thread { |
25 public: | 27 public: |
26 InProcessGpuThread(const InProcessChildThreadParams& params, | 28 InProcessGpuThread(const InProcessChildThreadParams& params, |
| 29 const gpu::GpuPreferences& gpu_preferences, |
27 gpu::SyncPointManager* sync_point_manager_override); | 30 gpu::SyncPointManager* sync_point_manager_override); |
28 ~InProcessGpuThread() override; | 31 ~InProcessGpuThread() override; |
29 | 32 |
30 protected: | 33 protected: |
31 void Init() override; | 34 void Init() override; |
32 void CleanUp() override; | 35 void CleanUp() override; |
33 | 36 |
34 private: | 37 private: |
35 InProcessChildThreadParams params_; | 38 InProcessChildThreadParams params_; |
36 | 39 |
37 // 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. |
38 GpuProcess* gpu_process_; | 41 GpuProcess* gpu_process_; |
39 | 42 |
| 43 const gpu::GpuPreferences gpu_preferences_; |
| 44 |
40 // Can be null if overridden. | 45 // Can be null if overridden. |
41 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; | 46 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; |
42 | 47 |
43 // Non-owning. | 48 // Non-owning. |
44 gpu::SyncPointManager* sync_point_manager_override_; | 49 gpu::SyncPointManager* sync_point_manager_override_; |
45 | 50 |
46 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | 51 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
47 | 52 |
48 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); | 53 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread); |
49 }; | 54 }; |
50 | 55 |
51 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( | 56 CONTENT_EXPORT base::Thread* CreateInProcessGpuThread( |
52 const InProcessChildThreadParams& params); | 57 const InProcessChildThreadParams& params); |
53 | 58 |
54 } // namespace content | 59 } // namespace content |
55 | 60 |
56 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ | 61 #endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_ |
OLD | NEW |