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 (command_line->HasSwitch(switches::kSkipGpuDataLoading) && | |
561 !command_line->HasSwitch(switches::kUseGpuInTests)) | |
562 return; | |
563 | 560 |
564 gpu::GPUInfo gpu_info; | 561 gpu::GPUInfo gpu_info; |
565 { | 562 if (command_line->GetSwitchValueASCII( |
563 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { | |
564 // If using the OSMesa GL implementation, report fake vendor and device | |
565 // names. | |
566 gpu_info.gpu.vendor_string = gfx::kGLImplementationOSMesaName; | |
Zhenyao Mo
2013/08/16 16:59:01
Actually you don't have to fake these data. The o
gab
2013/08/16 17:04:46
Ah ok, good to know, why is that? (it's not clear
gab
2013/08/16 19:42:16
Done.
| |
567 gpu_info.gpu.device_string = gfx::kGLImplementationOSMesaName; | |
568 gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; | |
569 gpu_info.driver_date = "8-16-2013"; | |
570 gpu_info.gl_vendor = gfx::kGLImplementationOSMesaName; | |
571 gpu_info.gl_renderer = gfx::kGLImplementationOSMesaName; | |
572 } else { | |
566 TRACE_EVENT0("startup", | 573 TRACE_EVENT0("startup", |
567 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); | 574 "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); |
568 gpu::CollectBasicGraphicsInfo(&gpu_info); | 575 gpu::CollectBasicGraphicsInfo(&gpu_info); |
569 } | 576 } |
570 #if defined(ARCH_CPU_X86_FAMILY) | 577 #if defined(ARCH_CPU_X86_FAMILY) |
571 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) | 578 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) |
572 gpu_info.finalized = true; | 579 gpu_info.finalized = true; |
573 #endif | 580 #endif |
574 | 581 |
575 std::string gpu_blacklist_string; | 582 std::string gpu_blacklist_string; |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1245 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1252 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1246 gpu_process_accessible_ = false; | 1253 gpu_process_accessible_ = false; |
1247 gpu_info_.finalized = true; | 1254 gpu_info_.finalized = true; |
1248 complete_gpu_info_already_requested_ = true; | 1255 complete_gpu_info_already_requested_ = true; |
1249 // Some observers might be waiting. | 1256 // Some observers might be waiting. |
1250 NotifyGpuInfoUpdate(); | 1257 NotifyGpuInfoUpdate(); |
1251 } | 1258 } |
1252 | 1259 |
1253 } // namespace content | 1260 } // namespace content |
1254 | 1261 |
OLD | NEW |