diff options
author | senorblanco <senorblanco@chromium.org> | 2015-04-08 09:59:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-08 16:59:41 +0000 |
commit | b7a64d5752ffb18bd7916eda0977222a8085bace (patch) | |
tree | 846cc9209047da1576cbf39c0fabf53b96ff190e /gpu | |
parent | d4a43f2240f2ea3332a2a9f552e7983e8b61c301 (diff) | |
download | chromium_src-b7a64d5752ffb18bd7916eda0977222a8085bace.zip chromium_src-b7a64d5752ffb18bd7916eda0977222a8085bace.tar.gz chromium_src-b7a64d5752ffb18bd7916eda0977222a8085bace.tar.bz2 |
Add a "Max. MSAA samples" entry to chrome://gpu.
BUG=474727
Review URL: https://codereview.chromium.org/1063233002
Cr-Commit-Position: refs/heads/master@{#324236}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/config/gpu_info.cc | 2 | ||||
-rw-r--r-- | gpu/config/gpu_info.h | 4 | ||||
-rw-r--r-- | gpu/config/gpu_info_collector.cc | 6 | ||||
-rw-r--r-- | gpu/config/gpu_info_unittest.cc | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc index 2cba5d8..3653a10 100644 --- a/gpu/config/gpu_info.cc +++ b/gpu/config/gpu_info.cc @@ -79,6 +79,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { std::string driver_date; std::string pixel_shader_version; std::string vertex_shader_version; + std::string max_msaa_samples; std::string machine_model_name; std::string machine_model_version; std::string gl_version_string; @@ -135,6 +136,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { enumerator->AddString("driverDate", driver_date); enumerator->AddString("pixelShaderVersion", pixel_shader_version); enumerator->AddString("vertexShaderVersion", vertex_shader_version); + enumerator->AddString("maxMsaaSamples", max_msaa_samples); enumerator->AddString("glVersion", gl_version); enumerator->AddString("glVendor", gl_vendor); enumerator->AddString("glRenderer", gl_renderer); diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h index e5bef23..cbd8361 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h @@ -138,6 +138,10 @@ struct GPU_EXPORT GPUInfo { // The version of the vertex shader used by the gpu. std::string vertex_shader_version; + // The maximum multisapling sample count, either through ES3 or + // EXT_multisampled_render_to_texture MSAA. + std::string max_msaa_samples; + // The machine model identifier. They can contain any character, including // whitespaces. Currently it is supported on MacOSX and Android. // Android examples: "Naxus 5", "XT1032". diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index 521f2cd..c673057 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc @@ -12,6 +12,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" +#include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_context.h" @@ -101,6 +102,9 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) { gpu_info->gl_extensions = GetGLString(GL_EXTENSIONS); gpu_info->gl_version = GetGLString(GL_VERSION); std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION); + GLint max_samples = 0; + glGetIntegerv(GL_MAX_SAMPLES, &max_samples); + gpu_info->max_msaa_samples = base::StringPrintf("%d", max_samples); gfx::GLWindowSystemBindingInfo window_system_binding_info; if (GetGLWindowSystemBindingInfo(&window_system_binding_info)) { @@ -141,6 +145,8 @@ void MergeGPUInfoGL(GPUInfo* basic_gpu_info, context_gpu_info.pixel_shader_version; basic_gpu_info->vertex_shader_version = context_gpu_info.vertex_shader_version; + basic_gpu_info->max_msaa_samples = + context_gpu_info.max_msaa_samples; basic_gpu_info->gl_ws_vendor = context_gpu_info.gl_ws_vendor; basic_gpu_info->gl_ws_version = context_gpu_info.gl_ws_version; basic_gpu_info->gl_ws_extensions = context_gpu_info.gl_ws_extensions; diff --git a/gpu/config/gpu_info_unittest.cc b/gpu/config/gpu_info_unittest.cc index 71d4e5c..1d5fa6e 100644 --- a/gpu/config/gpu_info_unittest.cc +++ b/gpu/config/gpu_info_unittest.cc @@ -19,6 +19,7 @@ TEST(GPUInfoBasicTest, EmptyGPUInfo) { EXPECT_EQ(gpu_info.driver_date, ""); EXPECT_EQ(gpu_info.pixel_shader_version, ""); EXPECT_EQ(gpu_info.vertex_shader_version, ""); + EXPECT_EQ(gpu_info.max_msaa_samples, ""); EXPECT_EQ(gpu_info.gl_version, ""); EXPECT_EQ(gpu_info.gl_vendor, ""); EXPECT_EQ(gpu_info.gl_renderer, ""); |