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

Unified Diff: gpu/config/gpu_info_collector.cc

Issue 1481523003: Check gl version before querying GL_MAX_SAMPLES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/config/gpu_info_collector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info_collector.cc
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 2b7eaef5b4e797579bf87900d3781466058e7557..beda6fd5b96951f75415860d851951ba52db1bf5 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -18,6 +18,7 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_version_info.h"
namespace {
@@ -102,8 +103,24 @@ CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info) {
gpu_info->gl_extensions = gfx::GetGLExtensionsFromCurrentContext();
gpu_info->gl_version = GetGLString(GL_VERSION);
std::string glsl_version_string = GetGLString(GL_SHADING_LANGUAGE_VERSION);
+
+ gfx::GLVersionInfo gl_info(gpu_info->gl_version.c_str(),
+ gpu_info->gl_renderer.c_str(),
+ gpu_info->gl_extensions.c_str());
GLint max_samples = 0;
- glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+ if (gl_info.IsAtLeastGL(3, 0) || gl_info.IsAtLeastGLES(3, 0) ||
+ gpu_info->gl_extensions.find("GL_ANGLE_framebuffer_multisample") !=
+ std::string::npos ||
+ gpu_info->gl_extensions.find("GL_APPLE_framebuffer_multisample") !=
+ std::string::npos ||
+ gpu_info->gl_extensions.find("GL_EXT_framebuffer_multisample") !=
+ std::string::npos ||
+ gpu_info->gl_extensions.find("GL_EXT_multisampled_render_to_texture") !=
+ std::string::npos ||
+ gpu_info->gl_extensions.find("GL_NV_framebuffer_multisample") !=
+ std::string::npos) {
+ glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+ }
gpu_info->max_msaa_samples = base::IntToString(max_samples);
UMA_HISTOGRAM_SPARSE_SLOWLY("GPU.MaxMSAASampleCount", max_samples);
« no previous file with comments | « no previous file | gpu/config/gpu_info_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698