Chromium Code Reviews| 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 "gpu/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 gpu_info->gl_extensions.find("GL_EXT_robustness") != std::string::npos || | 209 gpu_info->gl_extensions.find("GL_EXT_robustness") != std::string::npos || |
| 210 gpu_info->gl_extensions.find("GL_KHR_robustness") != std::string::npos || | 210 gpu_info->gl_extensions.find("GL_KHR_robustness") != std::string::npos || |
| 211 gpu_info->gl_extensions.find("GL_ARB_robustness") != std::string::npos; | 211 gpu_info->gl_extensions.find("GL_ARB_robustness") != std::string::npos; |
| 212 | 212 |
| 213 if (supports_robustness) { | 213 if (supports_robustness) { |
| 214 glGetIntegervFn( | 214 glGetIntegervFn( |
| 215 GL_RESET_NOTIFICATION_STRATEGY_ARB, | 215 GL_RESET_NOTIFICATION_STRATEGY_ARB, |
| 216 reinterpret_cast<GLint*>(&gpu_info->gl_reset_notification_strategy)); | 216 reinterpret_cast<GLint*>(&gpu_info->gl_reset_notification_strategy)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 std::string glsl_version_string = | 219 std::string glsl_version_string; |
| 220 reinterpret_cast<const char*>(glGetStringFn(GL_SHADING_LANGUAGE_VERSION)); | 220 if (const char* glsl_version_cstring = reinterpret_cast<const char*>( |
|
Tobias Sargeant
2015/09/22 12:12:03
Defining glsl_version_cstring in the if seems a li
davve
2015/09/23 10:24:51
I'm open to other suggestions. It felt unnecessary
| |
| 221 glGetStringFn(GL_SHADING_LANGUAGE_VERSION))) | |
| 222 glsl_version_string = glsl_version_cstring; | |
| 221 | 223 |
| 222 std::string glsl_version = GetVersionFromString(glsl_version_string).first; | 224 std::string glsl_version = GetVersionFromString(glsl_version_string).first; |
| 223 gpu_info->pixel_shader_version = glsl_version; | 225 gpu_info->pixel_shader_version = glsl_version; |
| 224 gpu_info->vertex_shader_version = glsl_version; | 226 gpu_info->vertex_shader_version = glsl_version; |
| 225 | 227 |
| 226 if (curr_display != EGL_NO_DISPLAY && | 228 if (curr_display != EGL_NO_DISPLAY && |
| 227 curr_context != EGL_NO_CONTEXT) { | 229 curr_context != EGL_NO_CONTEXT) { |
| 228 eglMakeCurrentFn(curr_display, curr_draw_surface, curr_read_surface, | 230 eglMakeCurrentFn(curr_display, curr_draw_surface, curr_read_surface, |
| 229 curr_context); | 231 curr_context); |
| 230 } else { | 232 } else { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 gpu_info->gpu.device_string = gpu_info->gl_renderer; | 282 gpu_info->gpu.device_string = gpu_info->gl_renderer; |
| 281 return kCollectInfoSuccess; | 283 return kCollectInfoSuccess; |
| 282 } | 284 } |
| 283 | 285 |
| 284 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 286 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
| 285 const GPUInfo& context_gpu_info) { | 287 const GPUInfo& context_gpu_info) { |
| 286 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 288 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 287 } | 289 } |
| 288 | 290 |
| 289 } // namespace gpu | 291 } // namespace gpu |
| OLD | NEW |