| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 return; | 520 return; |
| 521 } | 521 } |
| 522 | 522 |
| 523 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 523 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 524 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) { | 524 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) { |
| 525 RunPostInitTasks(); | 525 RunPostInitTasks(); |
| 526 return; | 526 return; |
| 527 } | 527 } |
| 528 | 528 |
| 529 gpu::GPUInfo gpu_info; | 529 gpu::GPUInfo gpu_info; |
| 530 if (command_line->GetSwitchValueASCII(switches::kUseGL) == | 530 const bool force_osmesa = |
| 531 gl::kGLImplementationOSMesaName) { | 531 (command_line->GetSwitchValueASCII(switches::kUseGL) == |
| 532 gl::kGLImplementationOSMesaName) || |
| 533 command_line->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests); |
| 534 if (force_osmesa) { |
| 532 // If using the OSMesa GL implementation, use fake vendor and device ids to | 535 // If using the OSMesa GL implementation, use fake vendor and device ids to |
| 533 // make sure it never gets blacklisted. This is better than simply | 536 // make sure it never gets blacklisted. This is better than simply |
| 534 // cancelling GPUInfo gathering as it allows us to proceed with loading the | 537 // cancelling GPUInfo gathering as it allows us to proceed with loading the |
| 535 // blacklist below which may have non-device specific entries we want to | 538 // blacklist below which may have non-device specific entries we want to |
| 536 // apply anyways (e.g., OS version blacklisting). | 539 // apply anyways (e.g., OS version blacklisting). |
| 537 gpu_info.gpu.vendor_id = 0xffff; | 540 gpu_info.gpu.vendor_id = 0xffff; |
| 538 gpu_info.gpu.device_id = 0xffff; | 541 gpu_info.gpu.device_id = 0xffff; |
| 539 | 542 |
| 540 // Also declare the driver_vendor to be osmesa to be able to specify | 543 // Also declare the driver_vendor to be osmesa to be able to specify |
| 541 // exceptions based on driver_vendor==osmesa for some blacklist rules. | 544 // exceptions based on driver_vendor==osmesa for some blacklist rules. |
| 542 gpu_info.driver_vendor = gl::kGLImplementationOSMesaName; | 545 gpu_info.driver_vendor = gl::kGLImplementationOSMesaName; |
| 546 |
| 547 // We are not going to call CollectBasicGraphicsInfo. |
| 548 // So mark it as collected. |
| 549 gpu_info.basic_info_state = gpu::kCollectInfoSuccess; |
| 543 } else { | 550 } else { |
| 544 TRACE_EVENT0("startup", | 551 TRACE_EVENT0("startup", |
| 545 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); | 552 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
| 546 gpu::CollectBasicGraphicsInfo(&gpu_info); | 553 gpu::CollectBasicGraphicsInfo(&gpu_info); |
| 547 | 554 |
| 548 if (command_line->HasSwitch(switches::kGpuTestingVendorId) && | 555 if (command_line->HasSwitch(switches::kGpuTestingVendorId) && |
| 549 command_line->HasSwitch(switches::kGpuTestingDeviceId)) { | 556 command_line->HasSwitch(switches::kGpuTestingDeviceId)) { |
| 550 base::HexStringToUInt( | 557 base::HexStringToUInt( |
| 551 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), | 558 command_line->GetSwitchValueASCII(switches::kGpuTestingVendorId), |
| 552 &gpu_info.gpu.vendor_id); | 559 &gpu_info.gpu.vendor_id); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1291 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1285 #if defined(OS_WIN) | 1292 #if defined(OS_WIN) |
| 1286 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1293 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1287 #endif | 1294 #endif |
| 1288 complete_gpu_info_already_requested_ = true; | 1295 complete_gpu_info_already_requested_ = true; |
| 1289 // Some observers might be waiting. | 1296 // Some observers might be waiting. |
| 1290 NotifyGpuInfoUpdate(); | 1297 NotifyGpuInfoUpdate(); |
| 1291 } | 1298 } |
| 1292 | 1299 |
| 1293 } // namespace content | 1300 } // namespace content |
| OLD | NEW |