OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
405 return use_swiftshader_; | 405 return use_swiftshader_; |
406 } | 406 } |
407 | 407 |
408 void GpuDataManagerImplPrivate::RegisterSwiftShaderPath( | 408 void GpuDataManagerImplPrivate::RegisterSwiftShaderPath( |
409 const base::FilePath& path) { | 409 const base::FilePath& path) { |
410 swiftshader_path_ = path; | 410 swiftshader_path_ = path; |
411 EnableSwiftShaderIfNecessary(); | 411 EnableSwiftShaderIfNecessary(); |
412 } | 412 } |
413 | 413 |
414 bool GpuDataManagerImplPrivate::ShouldUseWarp() const { | 414 bool GpuDataManagerImplPrivate::ShouldUseWarp() const { |
415 return use_warp_ || | 415 std::string angle_impl_flag = |
416 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp); | 416 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
417 switches::kUseANGLE); | |
418 return use_warp_ || angle_impl_flag == gfx::kANGLEImplementationWARPName; | |
Zhenyao Mo
2015/05/07 22:08:35
The only place use_warp_ is set to true is ForceWa
Geoff Lang
2015/05/11 13:31:50
Looks like use_warp_ is referenced in GpuDataManag
| |
417 } | 419 } |
418 | 420 |
419 void GpuDataManagerImplPrivate::AddObserver(GpuDataManagerObserver* observer) { | 421 void GpuDataManagerImplPrivate::AddObserver(GpuDataManagerObserver* observer) { |
420 GpuDataManagerImpl::UnlockedSession session(owner_); | 422 GpuDataManagerImpl::UnlockedSession session(owner_); |
421 observer_list_->AddObserver(observer); | 423 observer_list_->AddObserver(observer); |
422 } | 424 } |
423 | 425 |
424 void GpuDataManagerImplPrivate::RemoveObserver( | 426 void GpuDataManagerImplPrivate::RemoveObserver( |
425 GpuDataManagerObserver* observer) { | 427 GpuDataManagerObserver* observer) { |
426 GpuDataManagerImpl::UnlockedSession session(owner_); | 428 GpuDataManagerImpl::UnlockedSession session(owner_); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
673 // collect full info (on Linux) and for crash reporting purpose. | 675 // collect full info (on Linux) and for crash reporting purpose. |
674 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 676 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
675 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 677 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
676 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 678 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
677 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 679 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
678 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, | 680 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, |
679 gpu_info_.driver_vendor); | 681 gpu_info_.driver_vendor); |
680 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, | 682 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, |
681 gpu_info_.driver_version); | 683 gpu_info_.driver_version); |
682 | 684 |
683 if (ShouldUseWarp()) | 685 if (ShouldUseWarp() && |
684 command_line->AppendSwitch(switches::kUseWarp); | 686 !command_line->HasSwitch(switches::kUseANGLE)) { |
687 command_line->AppendSwitchASCII(switches::kUseANGLE, | |
688 gfx::kANGLEImplementationWARPName); | |
689 } | |
685 } | 690 } |
686 | 691 |
687 void GpuDataManagerImplPrivate::AppendPluginCommandLine( | 692 void GpuDataManagerImplPrivate::AppendPluginCommandLine( |
688 base::CommandLine* command_line) const { | 693 base::CommandLine* command_line) const { |
689 DCHECK(command_line); | 694 DCHECK(command_line); |
690 | 695 |
691 #if defined(OS_MACOSX) | 696 #if defined(OS_MACOSX) |
692 // TODO(jbauman): Add proper blacklist support for core animation plugins so | 697 // TODO(jbauman): Add proper blacklist support for core animation plugins so |
693 // special-casing this video card won't be necessary. See | 698 // special-casing this video card won't be necessary. See |
694 // http://crbug.com/134015 | 699 // http://crbug.com/134015 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1182 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1187 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1183 #if defined(OS_WIN) | 1188 #if defined(OS_WIN) |
1184 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1189 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1185 #endif | 1190 #endif |
1186 complete_gpu_info_already_requested_ = true; | 1191 complete_gpu_info_already_requested_ = true; |
1187 // Some observers might be waiting. | 1192 // Some observers might be waiting. |
1188 NotifyGpuInfoUpdate(); | 1193 NotifyGpuInfoUpdate(); |
1189 } | 1194 } |
1190 | 1195 |
1191 } // namespace content | 1196 } // namespace content |
OLD | NEW |