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

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, 1 month 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 | no next file » | 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..ca7e14e0dfe9893e9a442889f4817023688dbfba 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,13 @@ 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))
Zhenyao Mo 2015/11/25 18:09:25 It's more complicated. You also need to consider
+ 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698