OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/gpu/gpu_data_manager_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 { | 210 { |
211 base::AutoLock auto_lock(gpu_info_lock_); | 211 base::AutoLock auto_lock(gpu_info_lock_); |
212 if (gpu_info_.optimus) | 212 if (gpu_info_.optimus) |
213 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 213 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
214 if (gpu_info_.amd_switchable) { | 214 if (gpu_info_.amd_switchable) { |
215 // The image transport surface currently doesn't work with AMD Dynamic | 215 // The image transport surface currently doesn't work with AMD Dynamic |
216 // Switchable graphics. | 216 // Switchable graphics. |
217 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 217 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
218 command_line->AppendSwitch(switches::kDisableImageTransportSurface); | 218 command_line->AppendSwitch(switches::kDisableImageTransportSurface); |
219 } | 219 } |
| 220 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
| 221 // info collection at GPU process startup, but we need gpu vendor_id, |
| 222 // device_id, driver_version for crash reporting purpose. |
| 223 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
| 224 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
| 225 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
| 226 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
| 227 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, |
| 228 gpu_info_.driver_version); |
220 } | 229 } |
221 } | 230 } |
222 | 231 |
223 void GpuDataManagerImpl::SetGpuFeatureType(GpuFeatureType feature_type) { | 232 void GpuDataManagerImpl::SetGpuFeatureType(GpuFeatureType feature_type) { |
224 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
225 UpdateGpuFeatureType(feature_type); | 234 UpdateGpuFeatureType(feature_type); |
226 preliminary_gpu_feature_type_ = gpu_feature_type_; | 235 preliminary_gpu_feature_type_ = gpu_feature_type_; |
227 } | 236 } |
228 | 237 |
229 void GpuDataManagerImpl::NotifyGpuInfoUpdate() { | 238 void GpuDataManagerImpl::NotifyGpuInfoUpdate() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 int flags = gpu_feature_type_; | 295 int flags = gpu_feature_type_; |
287 flags |= content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | | 296 flags |= content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | |
288 content::GPU_FEATURE_TYPE_WEBGL; | 297 content::GPU_FEATURE_TYPE_WEBGL; |
289 gpu_feature_type_ = static_cast<GpuFeatureType>(flags); | 298 gpu_feature_type_ = static_cast<GpuFeatureType>(flags); |
290 } | 299 } |
291 | 300 |
292 EnableSoftwareRenderingIfNecessary(); | 301 EnableSoftwareRenderingIfNecessary(); |
293 NotifyGpuInfoUpdate(); | 302 NotifyGpuInfoUpdate(); |
294 } | 303 } |
295 | 304 |
OLD | NEW |