Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: chrome/gpu/gpu_info_collector.cc

Issue 6279009: Collect GL_EXTENSIONS string in GPUInfo and display it in about:gpu page.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/gpu_messages_unittest.cc ('k') | chrome/gpu/gpu_info_collector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 7 #include <string>
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 bool CollectGraphicsInfoGL(GPUInfo* gpu_info) { 82 bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
83 DCHECK(gpu_info); 83 DCHECK(gpu_info);
84 84
85 gfx::GLContext* context = InitializeGLContext(); 85 gfx::GLContext* context = InitializeGLContext();
86 if (context == NULL) 86 if (context == NULL)
87 return false; 87 return false;
88 88
89 gpu_info->SetGLRenderer(GetGLString(GL_RENDERER)); 89 gpu_info->SetGLRenderer(GetGLString(GL_RENDERER));
90 gpu_info->SetGLVendor(GetGLString(GL_VENDOR)); 90 gpu_info->SetGLVendor(GetGLString(GL_VENDOR));
91 gpu_info->SetGLVersionString(GetGLString(GL_VERSION)); 91 gpu_info->SetGLVersionString(GetGLString(GL_VERSION));
92 gpu_info->SetGLExtensions(GetGLString(GL_EXTENSIONS));
92 93
93 bool validGLVersionInfo = CollectGLVersionInfo(gpu_info); 94 bool validGLVersionInfo = CollectGLVersionInfo(gpu_info);
94 bool validVideoCardInfo = CollectVideoCardInfo(gpu_info); 95 bool validVideoCardInfo = CollectVideoCardInfo(gpu_info);
95 bool validDriverInfo = CollectDriverInfo(gpu_info); 96 bool validDriverInfo = CollectDriverInfo(gpu_info);
96 97
97 FinalizeGLContext(&context); 98 FinalizeGLContext(&context);
98 99
99 return (validGLVersionInfo && validVideoCardInfo && validDriverInfo); 100 return (validGLVersionInfo && validVideoCardInfo && validDriverInfo);
100 } 101 }
101 102
102 bool CollectGLVersionInfo(GPUInfo* gpu_info) { 103 bool CollectGLVersionInfo(GPUInfo* gpu_info) {
103 DCHECK(gpu_info); 104 DCHECK(gpu_info);
104 105
105 std::string gl_version_string = gpu_info->gl_version_string(); 106 std::string gl_version_string = gpu_info->gl_version_string();
106 std::string glsl_version_string = 107 std::string glsl_version_string =
107 GetGLString(GL_SHADING_LANGUAGE_VERSION); 108 GetGLString(GL_SHADING_LANGUAGE_VERSION);
108 109
109 uint32 gl_version = GetVersionNumberFromString(gl_version_string); 110 uint32 gl_version = GetVersionNumberFromString(gl_version_string);
110 gpu_info->SetGLVersion(gl_version); 111 gpu_info->SetGLVersion(gl_version);
111 112
112 uint32 glsl_version = GetVersionNumberFromString(glsl_version_string); 113 uint32 glsl_version = GetVersionNumberFromString(glsl_version_string);
113 gpu_info->SetShaderVersion(glsl_version, glsl_version); 114 gpu_info->SetShaderVersion(glsl_version, glsl_version);
114 115
115 return true; 116 return true;
116 } 117 }
117 118
118 } // namespace gpu_info_collector 119 } // namespace gpu_info_collector
119 120
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages_unittest.cc ('k') | chrome/gpu/gpu_info_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698