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

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

Issue 1063233002: Add a "Max. MSAA samples" entry to chrome://gpu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per kbr's comments Created 5 years, 8 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
« no previous file with comments | « gpu/config/gpu_info.cc ('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/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
15 #include "base/strings/stringprintf.h"
15 #include "base/trace_event/trace_event.h" 16 #include "base/trace_event/trace_event.h"
16 #include "ui/gl/gl_bindings.h" 17 #include "ui/gl/gl_bindings.h"
17 #include "ui/gl/gl_context.h" 18 #include "ui/gl/gl_context.h"
18 #include "ui/gl/gl_implementation.h" 19 #include "ui/gl/gl_implementation.h"
19 #include "ui/gl/gl_surface.h" 20 #include "ui/gl/gl_surface.h"
20 21
21 namespace { 22 namespace {
22 23
23 scoped_refptr<gfx::GLSurface> InitializeGLSurface() { 24 scoped_refptr<gfx::GLSurface> InitializeGLSurface() {
24 scoped_refptr<gfx::GLSurface> surface( 25 scoped_refptr<gfx::GLSurface> surface(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (!context.get()) { 95 if (!context.get()) {
95 LOG(ERROR) << "Could not create context for info collection."; 96 LOG(ERROR) << "Could not create context for info collection.";
96 return kCollectInfoFatalFailure; 97 return kCollectInfoFatalFailure;
97 } 98 }
98 99
99 gpu_info->gl_renderer = GetGLString(GL_RENDERER); 100 gpu_info->gl_renderer = GetGLString(GL_RENDERER);
100 gpu_info->gl_vendor = GetGLString(GL_VENDOR); 101 gpu_info->gl_vendor = GetGLString(GL_VENDOR);
101 gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS); 102 gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS);
102 gpu_info->gl_version = GetGLString(GL_VERSION); 103 gpu_info->gl_version = GetGLString(GL_VERSION);
103 std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION); 104 std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION);
105 GLint max_samples = 0;
106 glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
107 gpu_info->max_msaa_samples = base::StringPrintf("%d", max_samples);
104 108
105 gfx::GLWindowSystemBindingInfo window_system_binding_info; 109 gfx::GLWindowSystemBindingInfo window_system_binding_info;
106 if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) { 110 if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) {
107 gpu_info->gl_ws_vendor = window_system_binding_info.vendor; 111 gpu_info->gl_ws_vendor = window_system_binding_info.vendor;
108 gpu_info->gl_ws_version = window_system_binding_info.version; 112 gpu_info->gl_ws_version = window_system_binding_info.version;
109 gpu_info->gl_ws_extensions = window_system_binding_info.extensions; 113 gpu_info->gl_ws_extensions = window_system_binding_info.extensions;
110 gpu_info->direct_rendering = window_system_binding_info.direct_rendering; 114 gpu_info->direct_rendering = window_system_binding_info.direct_rendering;
111 } 115 }
112 116
113 bool supports_robustness = 117 bool supports_robustness =
(...skipping 20 matching lines...) Expand all
134 const GPUInfo& context_gpu_info) { 138 const GPUInfo& context_gpu_info) {
135 DCHECK(basic_gpu_info); 139 DCHECK(basic_gpu_info);
136 basic_gpu_info->gl_renderer = context_gpu_info.gl_renderer; 140 basic_gpu_info->gl_renderer = context_gpu_info.gl_renderer;
137 basic_gpu_info->gl_vendor = context_gpu_info.gl_vendor; 141 basic_gpu_info->gl_vendor = context_gpu_info.gl_vendor;
138 basic_gpu_info->gl_version = context_gpu_info.gl_version; 142 basic_gpu_info->gl_version = context_gpu_info.gl_version;
139 basic_gpu_info->gl_extensions = context_gpu_info.gl_extensions; 143 basic_gpu_info->gl_extensions = context_gpu_info.gl_extensions;
140 basic_gpu_info->pixel_shader_version = 144 basic_gpu_info->pixel_shader_version =
141 context_gpu_info.pixel_shader_version; 145 context_gpu_info.pixel_shader_version;
142 basic_gpu_info->vertex_shader_version = 146 basic_gpu_info->vertex_shader_version =
143 context_gpu_info.vertex_shader_version; 147 context_gpu_info.vertex_shader_version;
148 basic_gpu_info->max_msaa_samples =
149 context_gpu_info.max_msaa_samples;
144 basic_gpu_info->gl_ws_vendor = context_gpu_info.gl_ws_vendor; 150 basic_gpu_info->gl_ws_vendor = context_gpu_info.gl_ws_vendor;
145 basic_gpu_info->gl_ws_version = context_gpu_info.gl_ws_version; 151 basic_gpu_info->gl_ws_version = context_gpu_info.gl_ws_version;
146 basic_gpu_info->gl_ws_extensions = context_gpu_info.gl_ws_extensions; 152 basic_gpu_info->gl_ws_extensions = context_gpu_info.gl_ws_extensions;
147 basic_gpu_info->gl_reset_notification_strategy = 153 basic_gpu_info->gl_reset_notification_strategy =
148 context_gpu_info.gl_reset_notification_strategy; 154 context_gpu_info.gl_reset_notification_strategy;
149 155
150 if (!context_gpu_info.driver_vendor.empty()) 156 if (!context_gpu_info.driver_vendor.empty())
151 basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor; 157 basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor;
152 if (!context_gpu_info.driver_version.empty()) 158 if (!context_gpu_info.driver_version.empty())
153 basic_gpu_info->driver_version = context_gpu_info.driver_version; 159 basic_gpu_info->driver_version = context_gpu_info.driver_version;
154 160
155 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context; 161 basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context;
156 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; 162 basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
157 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering; 163 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering;
158 basic_gpu_info->context_info_state = context_gpu_info.context_info_state; 164 basic_gpu_info->context_info_state = context_gpu_info.context_info_state;
159 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; 165 basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
160 basic_gpu_info->video_encode_accelerator_supported_profiles = 166 basic_gpu_info->video_encode_accelerator_supported_profiles =
161 context_gpu_info.video_encode_accelerator_supported_profiles; 167 context_gpu_info.video_encode_accelerator_supported_profiles;
162 } 168 }
163 169
164 } // namespace gpu 170 } // namespace gpu
165 171
OLDNEW
« no previous file with comments | « gpu/config/gpu_info.cc ('k') | gpu/config/gpu_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698