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

Unified Diff: gpu/config/gpu_info_collector_linux.cc

Issue 2153373002: On Linux rework driver_version/vendor extraction from gl version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add unit test Created 4 years, 5 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 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_linux.cc
diff --git a/gpu/config/gpu_info_collector_linux.cc b/gpu/config/gpu_info_collector_linux.cc
index 050c33d246d391afb8edea0fbd0ed753fdd4c8ee..6c4f82c17df05616a01ad4242d9adf2024f4d2dd 100644
--- a/gpu/config/gpu_info_collector_linux.cc
+++ b/gpu/config/gpu_info_collector_linux.cc
@@ -247,8 +247,15 @@ CollectInfoResult CollectDriverInfoGL(GPUInfo* gpu_info) {
DCHECK(gpu_info);
std::string gl_version = gpu_info->gl_version;
- if (base::StartsWith(gl_version, "OpenGL ES", base::CompareCase::SENSITIVE))
+ if (base::StartsWith(gl_version, "OpenGL ES", base::CompareCase::SENSITIVE)) {
gl_version = gl_version.substr(10);
+ } else {
+ std::string core_profile = "(Core Profile)";
Zhenyao Mo 2016/07/21 13:30:44 I guess this is ok, but a more generic fix is you
Julien Isorce Samsung 2016/07/21 13:56:36 Good idea, thx, and driver_vendor would be the las
Zhenyao Mo 2016/07/21 13:59:47 right
+ size_t position = gl_version.find(core_profile);
+ if (position != std::string::npos)
+ gl_version.erase(position, core_profile.length());
+ }
+
std::vector<std::string> pieces = base::SplitString(
gl_version, base::kWhitespaceASCII, base::KEEP_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
« 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