| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gpu/gpu_info_collector.h" | 5 #include "content/gpu/gpu_info_collector.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <d3d9.h> | 8 #include <d3d9.h> |
| 9 #include <setupapi.h> | 9 #include <setupapi.h> |
| 10 #include <winsatcominterfacei.h> | 10 #include <winsatcominterfacei.h> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 namespace gpu_info_collector { | 99 namespace gpu_info_collector { |
| 100 | 100 |
| 101 bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { | 101 bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { |
| 102 DCHECK(gpu_info); | 102 DCHECK(gpu_info); |
| 103 | 103 |
| 104 gpu_info->performance_stats = RetrieveGpuPerformanceStats(); | 104 gpu_info->performance_stats = RetrieveGpuPerformanceStats(); |
| 105 | 105 |
| 106 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { | 106 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { |
| 107 std::string requested_implementation_name = | 107 std::string requested_implementation_name = |
| 108 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); | 108 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); |
| 109 if (requested_implementation_name == "swiftshader") | 109 if (requested_implementation_name == "swiftshader") { |
| 110 gpu_info->software_rendering = true; |
| 110 return false; | 111 return false; |
| 112 } |
| 111 } | 113 } |
| 112 | 114 |
| 113 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { | 115 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
| 114 gpu_info->finalized = true; | 116 gpu_info->finalized = true; |
| 115 return CollectGraphicsInfoGL(gpu_info); | 117 return CollectGraphicsInfoGL(gpu_info); |
| 116 } | 118 } |
| 117 | 119 |
| 118 // TODO(zmo): the following code only works if running on top of ANGLE. | 120 // TODO(zmo): the following code only works if running on top of ANGLE. |
| 119 // Need to handle the case when running on top of real EGL/GLES2 drivers. | 121 // Need to handle the case when running on top of real EGL/GLES2 drivers. |
| 120 | 122 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 295 |
| 294 size_t pos = gl_version_string.find_last_not_of("0123456789."); | 296 size_t pos = gl_version_string.find_last_not_of("0123456789."); |
| 295 if (pos != std::string::npos && pos < gl_version_string.length() - 1) { | 297 if (pos != std::string::npos && pos < gl_version_string.length() - 1) { |
| 296 gpu_info->driver_version = gl_version_string.substr(pos + 1); | 298 gpu_info->driver_version = gl_version_string.substr(pos + 1); |
| 297 return true; | 299 return true; |
| 298 } | 300 } |
| 299 return false; | 301 return false; |
| 300 } | 302 } |
| 301 | 303 |
| 302 } // namespace gpu_info_collector | 304 } // namespace gpu_info_collector |
| OLD | NEW |