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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 if (!swiftshader_path.empty()) | 202 if (!swiftshader_path.empty()) |
203 command_line->AppendSwitchPath(switches::kSwiftShaderPath, | 203 command_line->AppendSwitchPath(switches::kSwiftShaderPath, |
204 swiftshader_path); | 204 swiftshader_path); |
205 | 205 |
206 { | 206 { |
207 base::AutoLock auto_lock(gpu_info_lock_); | 207 base::AutoLock auto_lock(gpu_info_lock_); |
208 if (gpu_info_.optimus) | 208 if (gpu_info_.optimus) |
209 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 209 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 210 if (gpu_info_.amd_switchable) { |
| 211 // The image transport surface currently doesn't work with AMD Dynamic |
| 212 // Switchable graphics. |
| 213 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
| 214 command_line->AppendSwitch(switches::kDisableImageTransportSurface); |
| 215 } |
210 } | 216 } |
211 } | 217 } |
212 | 218 |
213 void GpuDataManagerImpl::SetGpuFeatureType(GpuFeatureType feature_type) { | 219 void GpuDataManagerImpl::SetGpuFeatureType(GpuFeatureType feature_type) { |
214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 220 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
215 UpdateGpuFeatureType(feature_type); | 221 UpdateGpuFeatureType(feature_type); |
216 preliminary_gpu_feature_type_ = gpu_feature_type_; | 222 preliminary_gpu_feature_type_ = gpu_feature_type_; |
217 } | 223 } |
218 | 224 |
219 void GpuDataManagerImpl::NotifyGpuInfoUpdate() { | 225 void GpuDataManagerImpl::NotifyGpuInfoUpdate() { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 object->vendor_id != other.vendor_id) { | 295 object->vendor_id != other.vendor_id) { |
290 *object = other; | 296 *object = other; |
291 return true; | 297 return true; |
292 } | 298 } |
293 | 299 |
294 bool changed = false; | 300 bool changed = false; |
295 if (!object->finalized) { | 301 if (!object->finalized) { |
296 object->finalized = other.finalized; | 302 object->finalized = other.finalized; |
297 object->initialization_time = other.initialization_time; | 303 object->initialization_time = other.initialization_time; |
298 object->optimus |= other.optimus; | 304 object->optimus |= other.optimus; |
| 305 object->amd_switchable |= other.amd_switchable; |
299 | 306 |
300 if (object->driver_vendor.empty()) { | 307 if (object->driver_vendor.empty()) { |
301 changed |= object->driver_vendor != other.driver_vendor; | 308 changed |= object->driver_vendor != other.driver_vendor; |
302 object->driver_vendor = other.driver_vendor; | 309 object->driver_vendor = other.driver_vendor; |
303 } | 310 } |
304 if (object->driver_version.empty()) { | 311 if (object->driver_version.empty()) { |
305 changed |= object->driver_version != other.driver_version; | 312 changed |= object->driver_version != other.driver_version; |
306 object->driver_version = other.driver_version; | 313 object->driver_version = other.driver_version; |
307 } | 314 } |
308 if (object->driver_date.empty()) { | 315 if (object->driver_date.empty()) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 #if defined(OS_WIN) | 350 #if defined(OS_WIN) |
344 if (object->dx_diagnostics.values.size() == 0 && | 351 if (object->dx_diagnostics.values.size() == 0 && |
345 object->dx_diagnostics.children.size() == 0) { | 352 object->dx_diagnostics.children.size() == 0) { |
346 object->dx_diagnostics = other.dx_diagnostics; | 353 object->dx_diagnostics = other.dx_diagnostics; |
347 changed = true; | 354 changed = true; |
348 } | 355 } |
349 #endif | 356 #endif |
350 } | 357 } |
351 return changed; | 358 return changed; |
352 } | 359 } |
OLD | NEW |