| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 !gpu_info_.gl_version.empty()) | 477 !gpu_info_.gl_version.empty()) |
| 478 return; | 478 return; |
| 479 | 479 |
| 480 gpu::GPUInfo gpu_info = gpu_info_; | 480 gpu::GPUInfo gpu_info = gpu_info_; |
| 481 | 481 |
| 482 gpu_info.gl_vendor = gl_vendor; | 482 gpu_info.gl_vendor = gl_vendor; |
| 483 gpu_info.gl_renderer = gl_renderer; | 483 gpu_info.gl_renderer = gl_renderer; |
| 484 gpu_info.gl_version = gl_version; | 484 gpu_info.gl_version = gl_version; |
| 485 | 485 |
| 486 gpu::IdentifyActiveGPU(&gpu_info); | 486 gpu::IdentifyActiveGPU(&gpu_info); |
| 487 gpu::CollectDriverInfoGL(&gpu_info); | 487 |
| 488 // Give a chance to IsEssentialGpuInfoAvailable() to return true. Useful |
| 489 // to prevent launching the gpu process from SystemInfoHandler::GetInfo |
| 490 // from DevToolsHttpHandler when running python browser tests. |
| 491 gpu_info.context_info_state = gpu::CollectDriverInfoGL(&gpu_info); |
| 488 | 492 |
| 489 UpdateGpuInfo(gpu_info); | 493 UpdateGpuInfo(gpu_info); |
| 490 UpdateGpuSwitchingManager(gpu_info); | 494 UpdateGpuSwitchingManager(gpu_info); |
| 491 UpdatePreliminaryBlacklistedFeatures(); | 495 UpdatePreliminaryBlacklistedFeatures(); |
| 492 } | 496 } |
| 493 | 497 |
| 494 void GpuDataManagerImplPrivate::GetGLStrings(std::string* gl_vendor, | 498 void GpuDataManagerImplPrivate::GetGLStrings(std::string* gl_vendor, |
| 495 std::string* gl_renderer, | 499 std::string* gl_renderer, |
| 496 std::string* gl_version) { | 500 std::string* gl_version) { |
| 497 DCHECK(gl_vendor && gl_renderer && gl_version); | 501 DCHECK(gl_vendor && gl_renderer && gl_version); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 523 gpu_info.gpu.vendor_id = 0xffff; | 527 gpu_info.gpu.vendor_id = 0xffff; |
| 524 gpu_info.gpu.device_id = 0xffff; | 528 gpu_info.gpu.device_id = 0xffff; |
| 525 | 529 |
| 526 // Also declare the driver_vendor to be osmesa to be able to specify | 530 // Also declare the driver_vendor to be osmesa to be able to specify |
| 527 // exceptions based on driver_vendor==osmesa for some blacklist rules. | 531 // exceptions based on driver_vendor==osmesa for some blacklist rules. |
| 528 gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; | 532 gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; |
| 529 } else { | 533 } else { |
| 530 TRACE_EVENT0("startup", | 534 TRACE_EVENT0("startup", |
| 531 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); | 535 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
| 532 gpu::CollectBasicGraphicsInfo(&gpu_info); | 536 gpu::CollectBasicGraphicsInfo(&gpu_info); |
| 537 |
| 538 // Always active the testing gpu device if any. |
| 539 uint32_t vendor_id = 0; |
| 540 uint32_t device_id = 0; |
| 541 gpu::ParseTestingIds(&vendor_id, &device_id); |
| 542 gpu_info.gpu.active = gpu_info.gpu.vendor_id == vendor_id && |
| 543 gpu_info.gpu.device_id == device_id; |
| 533 } | 544 } |
| 534 #if defined(ARCH_CPU_X86_FAMILY) | 545 #if defined(ARCH_CPU_X86_FAMILY) |
| 535 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { | 546 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { |
| 536 gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure; | 547 gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure; |
| 537 #if defined(OS_WIN) | 548 #if defined(OS_WIN) |
| 538 gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure; | 549 gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure; |
| 539 #endif // OS_WIN | 550 #endif // OS_WIN |
| 540 } | 551 } |
| 541 #endif // ARCH_CPU_X86_FAMILY | 552 #endif // ARCH_CPU_X86_FAMILY |
| 542 | 553 |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1254 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1244 #if defined(OS_WIN) | 1255 #if defined(OS_WIN) |
| 1245 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1256 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1246 #endif | 1257 #endif |
| 1247 complete_gpu_info_already_requested_ = true; | 1258 complete_gpu_info_already_requested_ = true; |
| 1248 // Some observers might be waiting. | 1259 // Some observers might be waiting. |
| 1249 NotifyGpuInfoUpdate(); | 1260 NotifyGpuInfoUpdate(); |
| 1250 } | 1261 } |
| 1251 | 1262 |
| 1252 } // namespace content | 1263 } // namespace content |
| OLD | NEW |