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