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

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

Issue 15890002: Display GL window system binding information in about:gpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo in unit test. Created 7 years, 6 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 | « gpu/config/gpu_info.h ('k') | gpu/config/gpu_info_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) 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/strings/string_piece.h" 14 #include "base/strings/string_piece.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "ui/gl/gl_bindings.h" 16 #include "ui/gl/gl_bindings.h"
17 #include "ui/gl/gl_context.h" 17 #include "ui/gl/gl_context.h"
18 #include "ui/gl/gl_implementation.h"
18 #include "ui/gl/gl_surface.h" 19 #include "ui/gl/gl_surface.h"
19 20
20 namespace { 21 namespace {
21 22
22 scoped_refptr<gfx::GLSurface> InitializeGLSurface() { 23 scoped_refptr<gfx::GLSurface> InitializeGLSurface() {
23 scoped_refptr<gfx::GLSurface> surface( 24 scoped_refptr<gfx::GLSurface> surface(
24 gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1))); 25 gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1)));
25 if (!surface) { 26 if (!surface) {
26 LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed"; 27 LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed";
27 return NULL; 28 return NULL;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 scoped_refptr<gfx::GLContext> context(InitializeGLContext(surface.get())); 94 scoped_refptr<gfx::GLContext> context(InitializeGLContext(surface.get()));
94 if (!context) 95 if (!context)
95 return false; 96 return false;
96 97
97 gpu_info->gl_renderer = GetGLString(GL_RENDERER); 98 gpu_info->gl_renderer = GetGLString(GL_RENDERER);
98 gpu_info->gl_vendor = GetGLString(GL_VENDOR); 99 gpu_info->gl_vendor = GetGLString(GL_VENDOR);
99 gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS); 100 gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS);
100 gpu_info->gl_version_string = GetGLString(GL_VERSION); 101 gpu_info->gl_version_string = GetGLString(GL_VERSION);
101 std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION); 102 std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION);
103
104 gfx::GLWindowSystemBindingInfo window_system_binding_info;
105 if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) {
106 gpu_info->gl_ws_vendor = window_system_binding_info.vendor;
107 gpu_info->gl_ws_version = window_system_binding_info.version;
108 gpu_info->gl_ws_extensions = window_system_binding_info.extensions;
109 }
110
102 // TODO(kbr): remove once the destruction of a current context automatically 111 // TODO(kbr): remove once the destruction of a current context automatically
103 // clears the current context. 112 // clears the current context.
104 context->ReleaseCurrent(surface.get()); 113 context->ReleaseCurrent(surface.get());
105 114
106 gpu_info->gl_version = GetVersionFromString(gpu_info->gl_version_string); 115 gpu_info->gl_version = GetVersionFromString(gpu_info->gl_version_string);
107 std::string glsl_version = GetVersionFromString(glsl_version_string); 116 std::string glsl_version = GetVersionFromString(glsl_version_string);
108 gpu_info->pixel_shader_version = glsl_version; 117 gpu_info->pixel_shader_version = glsl_version;
109 gpu_info->vertex_shader_version = glsl_version; 118 gpu_info->vertex_shader_version = glsl_version;
110 119
111 return CollectDriverInfoGL(gpu_info); 120 return CollectDriverInfoGL(gpu_info);
112 } 121 }
113 122
114 void MergeGPUInfoGL(GPUInfo* basic_gpu_info, 123 void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
115 const GPUInfo& context_gpu_info) { 124 const GPUInfo& context_gpu_info) {
116 DCHECK(basic_gpu_info); 125 DCHECK(basic_gpu_info);
117 basic_gpu_info->gl_renderer = context_gpu_info.gl_renderer; 126 basic_gpu_info->gl_renderer = context_gpu_info.gl_renderer;
118 basic_gpu_info->gl_vendor = context_gpu_info.gl_vendor; 127 basic_gpu_info->gl_vendor = context_gpu_info.gl_vendor;
119 basic_gpu_info->gl_version_string = context_gpu_info.gl_version_string; 128 basic_gpu_info->gl_version_string = context_gpu_info.gl_version_string;
120 basic_gpu_info->gl_extensions = context_gpu_info.gl_extensions; 129 basic_gpu_info->gl_extensions = context_gpu_info.gl_extensions;
121 basic_gpu_info->gl_version = context_gpu_info.gl_version; 130 basic_gpu_info->gl_version = context_gpu_info.gl_version;
122 basic_gpu_info->pixel_shader_version = 131 basic_gpu_info->pixel_shader_version =
123 context_gpu_info.pixel_shader_version; 132 context_gpu_info.pixel_shader_version;
124 basic_gpu_info->vertex_shader_version = 133 basic_gpu_info->vertex_shader_version =
125 context_gpu_info.vertex_shader_version; 134 context_gpu_info.vertex_shader_version;
135 basic_gpu_info->gl_ws_vendor = context_gpu_info.gl_ws_vendor;
136 basic_gpu_info->gl_ws_version = context_gpu_info.gl_ws_version;
137 basic_gpu_info->gl_ws_extensions = context_gpu_info.gl_ws_extensions;
126 138
127 if (!context_gpu_info.driver_vendor.empty()) 139 if (!context_gpu_info.driver_vendor.empty())
128 basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor; 140 basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor;
129 if (!context_gpu_info.driver_version.empty()) 141 if (!context_gpu_info.driver_version.empty())
130 basic_gpu_info->driver_version = context_gpu_info.driver_version; 142 basic_gpu_info->driver_version = context_gpu_info.driver_version;
131 143
132 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context; 144 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context;
133 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; 145 basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
134 basic_gpu_info->gpu_accessible = context_gpu_info.gpu_accessible; 146 basic_gpu_info->gpu_accessible = context_gpu_info.gpu_accessible;
135 basic_gpu_info->finalized = context_gpu_info.finalized; 147 basic_gpu_info->finalized = context_gpu_info.finalized;
136 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; 148 basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
137 } 149 }
138 150
139 } // namespace gpu 151 } // namespace gpu
140 152
OLDNEW
« no previous file with comments | « gpu/config/gpu_info.h ('k') | gpu/config/gpu_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698