| 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 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "app/gfx/gl/gl_bindings.h" | 10 #include "app/gfx/gl/gl_bindings.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 } // namespace anonymous | 42 } // namespace anonymous |
| 43 | 43 |
| 44 namespace gpu_info_collector { | 44 namespace gpu_info_collector { |
| 45 | 45 |
| 46 bool CollectGraphicsInfo(GPUInfo* gpu_info) { | 46 bool CollectGraphicsInfo(GPUInfo* gpu_info) { |
| 47 DCHECK(gpu_info); | 47 DCHECK(gpu_info); |
| 48 | 48 |
| 49 gpu_info->SetCanLoseContext( | 49 gpu_info->SetCanLoseContext( |
| 50 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); | 50 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2); |
| 51 gpu_info->SetProgress(GPUInfo::kComplete); | 51 gpu_info->SetLevel(GPUInfo::kComplete); |
| 52 return CollectGraphicsInfoGL(gpu_info); | 52 return CollectGraphicsInfoGL(gpu_info); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool CollectVideoCardInfo(GPUInfo* gpu_info) { | 55 bool CollectVideoCardInfo(GPUInfo* gpu_info) { |
| 56 DCHECK(gpu_info); | 56 DCHECK(gpu_info); |
| 57 | 57 |
| 58 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) | 58 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) |
| 59 return false; | 59 return false; |
| 60 | 60 |
| 61 UInt32 vendor_id = 0, device_id = 0; | 61 UInt32 vendor_id = 0, device_id = 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. | 84 // Use some jiggery-pokery to turn that utf8 string into a std::wstring. |
| 85 std::string gl_version_string = gpu_info->gl_version_string(); | 85 std::string gl_version_string = gpu_info->gl_version_string(); |
| 86 size_t pos = gl_version_string.find_last_of('-'); | 86 size_t pos = gl_version_string.find_last_of('-'); |
| 87 if (pos == std::string::npos) | 87 if (pos == std::string::npos) |
| 88 return false; | 88 return false; |
| 89 gpu_info->SetDriverInfo("", gl_version_string.substr(pos + 1)); | 89 gpu_info->SetDriverInfo("", gl_version_string.substr(pos + 1)); |
| 90 return true; | 90 return true; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace gpu_info_collector | 93 } // namespace gpu_info_collector |
| OLD | NEW |