| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 return; | 517 return; |
| 518 } | 518 } |
| 519 | 519 |
| 520 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 520 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 521 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) { | 521 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) { |
| 522 RunPostInitTasks(); | 522 RunPostInitTasks(); |
| 523 return; | 523 return; |
| 524 } | 524 } |
| 525 | 525 |
| 526 gpu::GPUInfo gpu_info; | 526 gpu::GPUInfo gpu_info; |
| 527 if (command_line->GetSwitchValueASCII( | 527 if (command_line->GetSwitchValueASCII(switches::kUseGL) == |
| 528 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { | 528 gl::kGLImplementationOSMesaName) { |
| 529 // If using the OSMesa GL implementation, use fake vendor and device ids to | 529 // If using the OSMesa GL implementation, use fake vendor and device ids to |
| 530 // make sure it never gets blacklisted. This is better than simply | 530 // make sure it never gets blacklisted. This is better than simply |
| 531 // cancelling GPUInfo gathering as it allows us to proceed with loading the | 531 // cancelling GPUInfo gathering as it allows us to proceed with loading the |
| 532 // blacklist below which may have non-device specific entries we want to | 532 // blacklist below which may have non-device specific entries we want to |
| 533 // apply anyways (e.g., OS version blacklisting). | 533 // apply anyways (e.g., OS version blacklisting). |
| 534 gpu_info.gpu.vendor_id = 0xffff; | 534 gpu_info.gpu.vendor_id = 0xffff; |
| 535 gpu_info.gpu.device_id = 0xffff; | 535 gpu_info.gpu.device_id = 0xffff; |
| 536 | 536 |
| 537 // Also declare the driver_vendor to be osmesa to be able to specify | 537 // Also declare the driver_vendor to be osmesa to be able to specify |
| 538 // exceptions based on driver_vendor==osmesa for some blacklist rules. | 538 // exceptions based on driver_vendor==osmesa for some blacklist rules. |
| 539 gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; | 539 gpu_info.driver_vendor = gl::kGLImplementationOSMesaName; |
| 540 } else { | 540 } else { |
| 541 TRACE_EVENT0("startup", | 541 TRACE_EVENT0("startup", |
| 542 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); | 542 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
| 543 gpu::CollectBasicGraphicsInfo(&gpu_info); | 543 gpu::CollectBasicGraphicsInfo(&gpu_info); |
| 544 | 544 |
| 545 if (command_line->HasSwitch(switches::kGpuTestingVendorId) && | 545 if (command_line->HasSwitch(switches::kGpuTestingVendorId) && |
| 546 command_line->HasSwitch(switches::kGpuTestingDeviceId)) { | 546 command_line->HasSwitch(switches::kGpuTestingDeviceId)) { |
| 547 base::HexStringToUInt( | 547 base::HexStringToUInt( |
| 548 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), | 548 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), |
| 549 &gpu_info.gpu.vendor_id); | 549 &gpu_info.gpu.vendor_id); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 if (gpu_driver_bugs_.find(gpu::DISABLE_DIRECT_COMPOSITION) != | 696 if (gpu_driver_bugs_.find(gpu::DISABLE_DIRECT_COMPOSITION) != |
| 697 gpu_driver_bugs_.end()) | 697 gpu_driver_bugs_.end()) |
| 698 command_line->AppendSwitch(switches::kDisableDirectComposition); | 698 command_line->AppendSwitch(switches::kDisableDirectComposition); |
| 699 if (use_swiftshader_) { | 699 if (use_swiftshader_) { |
| 700 command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader"); | 700 command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader"); |
| 701 } else if ((IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL) || | 701 } else if ((IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL) || |
| 702 IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING) || | 702 IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING) || |
| 703 IsFeatureBlacklisted( | 703 IsFeatureBlacklisted( |
| 704 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) && | 704 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) && |
| 705 (use_gl == "any")) { | 705 (use_gl == "any")) { |
| 706 command_line->AppendSwitchASCII( | 706 command_line->AppendSwitchASCII(switches::kUseGL, |
| 707 switches::kUseGL, gfx::kGLImplementationOSMesaName); | 707 gl::kGLImplementationOSMesaName); |
| 708 } else if (!use_gl.empty()) { | 708 } else if (!use_gl.empty()) { |
| 709 command_line->AppendSwitchASCII(switches::kUseGL, use_gl); | 709 command_line->AppendSwitchASCII(switches::kUseGL, use_gl); |
| 710 } | 710 } |
| 711 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) | 711 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) |
| 712 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "true"); | 712 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "true"); |
| 713 else | 713 else |
| 714 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "false"); | 714 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "false"); |
| 715 | 715 |
| 716 if (!swiftshader_path_.empty()) { | 716 if (!swiftshader_path_.empty()) { |
| 717 command_line->AppendSwitchPath(switches::kSwiftShaderPath, | 717 command_line->AppendSwitchPath(switches::kSwiftShaderPath, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1271 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1272 #if defined(OS_WIN) | 1272 #if defined(OS_WIN) |
| 1273 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1273 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1274 #endif | 1274 #endif |
| 1275 complete_gpu_info_already_requested_ = true; | 1275 complete_gpu_info_already_requested_ = true; |
| 1276 // Some observers might be waiting. | 1276 // Some observers might be waiting. |
| 1277 NotifyGpuInfoUpdate(); | 1277 NotifyGpuInfoUpdate(); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 } // namespace content | 1280 } // namespace content |
| OLD | NEW |