OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 "chrome/gpu/gpu_info_collector.h" | 5 #include "chrome/gpu/gpu_info_collector.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/gfx/gl/gl_bindings.h" | 10 #include "app/gfx/gl/gl_bindings.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 namespace gpu_info_collector { | 127 namespace gpu_info_collector { |
128 | 128 |
129 bool CollectGraphicsInfo(GPUInfo* gpu_info) { | 129 bool CollectGraphicsInfo(GPUInfo* gpu_info) { |
130 DCHECK(gpu_info); | 130 DCHECK(gpu_info); |
131 | 131 |
132 // TODO(zmo): need to consider the case where we are running on top of | 132 // TODO(zmo): need to consider the case where we are running on top of |
133 // desktop GL and GL_ARB_robustness extension is available. | 133 // desktop GL and GL_ARB_robustness extension is available. |
134 gpu_info->SetCanLoseContext( | 134 gpu_info->SetCanLoseContext( |
135 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); | 135 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); |
136 gpu_info->SetProgress(GPUInfo::kComplete); | 136 gpu_info->SetLevel(GPUInfo::kComplete); |
137 return CollectGraphicsInfoGL(gpu_info); | 137 return CollectGraphicsInfoGL(gpu_info); |
138 } | 138 } |
139 | 139 |
140 bool CollectVideoCardInfo(GPUInfo* gpu_info) { | 140 bool CollectVideoCardInfo(GPUInfo* gpu_info) { |
141 DCHECK(gpu_info); | 141 DCHECK(gpu_info); |
142 | 142 |
143 // TODO(zmo): be more flexible about library name. | 143 // TODO(zmo): be more flexible about library name. |
144 PciInterface* interface = InitializeLibPci("libpci.so.3"); | 144 PciInterface* interface = InitializeLibPci("libpci.so.3"); |
145 if (interface == NULL) | 145 if (interface == NULL) |
146 return false; | 146 return false; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (pos == 0) | 233 if (pos == 0) |
234 return false; | 234 return false; |
235 if (pos != std::string::npos) | 235 if (pos != std::string::npos) |
236 driver_version = driver_version.substr(0, pos); | 236 driver_version = driver_version.substr(0, pos); |
237 | 237 |
238 gpu_info->SetDriverInfo(pieces[1], driver_version); | 238 gpu_info->SetDriverInfo(pieces[1], driver_version); |
239 return true; | 239 return true; |
240 } | 240 } |
241 | 241 |
242 } // namespace gpu_info_collector | 242 } // namespace gpu_info_collector |
OLD | NEW |