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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 std::string* gl_version) { | 549 std::string* gl_version) { |
550 DCHECK(gl_vendor && gl_renderer && gl_version); | 550 DCHECK(gl_vendor && gl_renderer && gl_version); |
551 | 551 |
552 *gl_vendor = gpu_info_.gl_vendor; | 552 *gl_vendor = gpu_info_.gl_vendor; |
553 *gl_renderer = gpu_info_.gl_renderer; | 553 *gl_renderer = gpu_info_.gl_renderer; |
554 *gl_version = gpu_info_.gl_version_string; | 554 *gl_version = gpu_info_.gl_version_string; |
555 } | 555 } |
556 | 556 |
557 void GpuDataManagerImplPrivate::Initialize() { | 557 void GpuDataManagerImplPrivate::Initialize() { |
558 TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize"); | 558 TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize"); |
559 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 559 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 560 #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 561 // TODO(gab): Enable GPU blacklist usage on all the bots |
| 562 // (http://crbug.com/277242). |
560 if (command_line->HasSwitch(switches::kSkipGpuDataLoading) && | 563 if (command_line->HasSwitch(switches::kSkipGpuDataLoading) && |
561 !command_line->HasSwitch(switches::kUseGpuInTests)) | 564 !command_line->HasSwitch(switches::kUseGpuInTests)) |
562 return; | 565 return; |
| 566 #endif |
563 | 567 |
564 gpu::GPUInfo gpu_info; | 568 gpu::GPUInfo gpu_info; |
565 { | 569 if (command_line->GetSwitchValueASCII( |
| 570 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { |
| 571 // If using the OSMesa GL implementation, use fake vendor and device ids to |
| 572 // make sure it never gets blacklisted. This is better than simply |
| 573 // cancelling GPUInfo gathering as it allows us to proceed with loading the |
| 574 // blacklist below which may have non-device specific entries we want to |
| 575 // apply anyways (e.g., OS version blacklisting). |
| 576 gpu_info.gpu.vendor_id = 0xffff; |
| 577 gpu_info.gpu.device_id = 0xffff; |
| 578 |
| 579 // Hardcode these two values otherwise blacklisting rules #12, 55, and 74 in |
| 580 // kSoftwareRenderingListJson result in a positive match as GpuControlList |
| 581 // assumes a match (by design) when a property is required for the |
| 582 // verification yet not present in the GpuInfo. |
| 583 gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; |
| 584 gpu_info.driver_date = "2013.8"; |
| 585 } else { |
566 TRACE_EVENT0("startup", | 586 TRACE_EVENT0("startup", |
567 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); | 587 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
568 gpu::CollectBasicGraphicsInfo(&gpu_info); | 588 gpu::CollectBasicGraphicsInfo(&gpu_info); |
569 } | 589 } |
570 #if defined(ARCH_CPU_X86_FAMILY) | 590 #if defined(ARCH_CPU_X86_FAMILY) |
571 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) | 591 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) |
572 gpu_info.finalized = true; | 592 gpu_info.finalized = true; |
573 #endif | 593 #endif |
574 | 594 |
575 std::string gpu_blacklist_string; | 595 std::string gpu_blacklist_string; |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1266 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1247 gpu_process_accessible_ = false; | 1267 gpu_process_accessible_ = false; |
1248 gpu_info_.finalized = true; | 1268 gpu_info_.finalized = true; |
1249 complete_gpu_info_already_requested_ = true; | 1269 complete_gpu_info_already_requested_ = true; |
1250 // Some observers might be waiting. | 1270 // Some observers might be waiting. |
1251 NotifyGpuInfoUpdate(); | 1271 NotifyGpuInfoUpdate(); |
1252 } | 1272 } |
1253 | 1273 |
1254 } // namespace content | 1274 } // namespace content |
1255 | 1275 |
OLD | NEW |