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 #include "content/gpu/in_process_gpu_thread.h" | 5 #include "content/gpu/in_process_gpu_thread.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/gpu/gpu_memory_buffer_factory.h" | |
10 #include "content/gpu/gpu_child_thread.h" | 9 #include "content/gpu/gpu_child_thread.h" |
11 #include "content/gpu/gpu_process.h" | 10 #include "content/gpu/gpu_process.h" |
12 #include "gpu/command_buffer/service/sync_point_manager.h" | 11 #include "gpu/command_buffer/service/sync_point_manager.h" |
13 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 12 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 13 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
14 | 14 |
15 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
16 #include "base/android/jni_android.h" | 16 #include "base/android/jni_android.h" |
17 #endif | 17 #endif |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 InProcessGpuThread::InProcessGpuThread( | 21 InProcessGpuThread::InProcessGpuThread( |
22 const InProcessChildThreadParams& params, | 22 const InProcessChildThreadParams& params, |
23 const gpu::GpuPreferences& gpu_preferences, | 23 const gpu::GpuPreferences& gpu_preferences, |
24 gpu::SyncPointManager* sync_point_manager_override) | 24 gpu::SyncPointManager* sync_point_manager_override) |
25 : base::Thread("Chrome_InProcGpuThread"), | 25 : base::Thread("Chrome_InProcGpuThread"), |
26 params_(params), | 26 params_(params), |
27 gpu_process_(NULL), | 27 gpu_process_(NULL), |
28 gpu_preferences_(gpu_preferences), | 28 gpu_preferences_(gpu_preferences), |
29 sync_point_manager_override_(sync_point_manager_override), | 29 sync_point_manager_override_(sync_point_manager_override), |
30 gpu_memory_buffer_factory_( | 30 gpu_memory_buffer_factory_( |
31 gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER | 31 gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER |
32 ? GpuMemoryBufferFactory::CreateNativeType() | 32 ? gpu::GpuMemoryBufferFactory::CreateNativeType() |
33 : nullptr) { | 33 : nullptr) { |
34 if (!sync_point_manager_override_) { | 34 if (!sync_point_manager_override_) { |
35 sync_point_manager_.reset(new gpu::SyncPointManager(false)); | 35 sync_point_manager_.reset(new gpu::SyncPointManager(false)); |
36 sync_point_manager_override_ = sync_point_manager_.get(); | 36 sync_point_manager_override_ = sync_point_manager_.get(); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 InProcessGpuThread::~InProcessGpuThread() { | 40 InProcessGpuThread::~InProcessGpuThread() { |
41 Stop(); | 41 Stop(); |
42 } | 42 } |
43 | 43 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 base::Thread* CreateInProcessGpuThread( | 77 base::Thread* CreateInProcessGpuThread( |
78 const InProcessChildThreadParams& params, | 78 const InProcessChildThreadParams& params, |
79 const gpu::GpuPreferences& gpu_preferences) { | 79 const gpu::GpuPreferences& gpu_preferences) { |
80 return new InProcessGpuThread( | 80 return new InProcessGpuThread( |
81 params, gpu_preferences, nullptr); | 81 params, gpu_preferences, nullptr); |
82 } | 82 } |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
OLD | NEW |