| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <d3d9.h> | 7 #include <d3d9.h> |
| 8 #include <setupapi.h> | 8 #include <setupapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_native_library.h" | 13 #include "base/memory/scoped_native_library.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "ui/gfx/gl/gl_context_egl.h" | |
| 17 #include "ui/gfx/gl/gl_implementation.h" | 16 #include "ui/gfx/gl/gl_implementation.h" |
| 17 #include "ui/gfx/gl/gl_surface_egl.h" |
| 18 | 18 |
| 19 // ANGLE seems to require that main.h be included before any other ANGLE header. | 19 // ANGLE seems to require that main.h be included before any other ANGLE header. |
| 20 #include "libEGL/main.h" | 20 #include "libEGL/main.h" |
| 21 #include "libEGL/Display.h" | 21 #include "libEGL/Display.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // The version number stores the major and minor version in the least 16 bits; | 25 // The version number stores the major and minor version in the least 16 bits; |
| 26 // for example, 2.5 is 0x00000205. | 26 // for example, 2.5 is 0x00000205. |
| 27 // Returned string is in the format of "major.minor". | 27 // Returned string is in the format of "major.minor". |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { | 66 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
| 67 gpu_info->finalized = true; | 67 gpu_info->finalized = true; |
| 68 return CollectGraphicsInfoGL(gpu_info); | 68 return CollectGraphicsInfoGL(gpu_info); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // TODO(zmo): the following code only works if running on top of ANGLE. | 71 // TODO(zmo): the following code only works if running on top of ANGLE. |
| 72 // Need to handle the case when running on top of real EGL/GLES2 drivers. | 72 // Need to handle the case when running on top of real EGL/GLES2 drivers. |
| 73 | 73 |
| 74 egl::Display* display = static_cast<egl::Display*>( | 74 egl::Display* display = static_cast<egl::Display*>( |
| 75 gfx::BaseEGLContext::GetDisplay()); | 75 gfx::GLSurfaceEGL::GetDisplay()); |
| 76 if (!display) { | 76 if (!display) { |
| 77 LOG(ERROR) << "gfx::BaseEGLContext::GetDisplay() failed"; | 77 LOG(ERROR) << "gfx::BaseEGLContext::GetDisplay() failed"; |
| 78 return false; | 78 return false; |
| 79 } | 79 } |
| 80 | 80 |
| 81 IDirect3DDevice9* device = display->getDevice(); | 81 IDirect3DDevice9* device = display->getDevice(); |
| 82 if (!device) { | 82 if (!device) { |
| 83 LOG(ERROR) << "display->getDevice() failed"; | 83 LOG(ERROR) << "display->getDevice() failed"; |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 265 |
| 266 size_t pos = gl_version_string.find_last_not_of("0123456789."); | 266 size_t pos = gl_version_string.find_last_not_of("0123456789."); |
| 267 if (pos != std::string::npos && pos < gl_version_string.length() - 1) { | 267 if (pos != std::string::npos && pos < gl_version_string.length() - 1) { |
| 268 gpu_info->driver_version = gl_version_string.substr(pos + 1); | 268 gpu_info->driver_version = gl_version_string.substr(pos + 1); |
| 269 return true; | 269 return true; |
| 270 } | 270 } |
| 271 return false; | 271 return false; |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace gpu_info_collector | 274 } // namespace gpu_info_collector |
| OLD | NEW |