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

Unified Diff: gpu/config/gpu_info_collector_android.cc

Issue 1160293004: Add tests for Android GL driver version extraction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ->,<- Created 5 years, 6 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_android.cc
diff --git a/gpu/config/gpu_info_collector_android.cc b/gpu/config/gpu_info_collector_android.cc
index 97a79e53eb6305209f782a1f97460da690e49e83..d05e85b30e577a179fac7271a6d492399cfc6e5b 100644
--- a/gpu/config/gpu_info_collector_android.cc
+++ b/gpu/config/gpu_info_collector_android.cc
@@ -18,10 +18,13 @@
namespace {
std::string GetDriverVersionFromString(const std::string& version_string) {
- // Extract driver version from the second number in a string like:
- // "OpenGL ES 2.0 V@6.0 AU@ (CL@2946718)"
-
- // Exclude first "2.0".
+ // We expect that android GL_VERSION strings will be of a form
+ // similar to: "OpenGL ES 2.0 V@6.0 AU@ (CL@2946718)" where the
+ // first match to [0-9][0-9.]* is the OpenGL ES version number, and
+ // the second match to [0-9][0-9.]* is the driver version (in this
+ // case, 6.0).
+ // It is currently assumed that the driver version has at least one
+ // period in it, and only the first two components are significant.
size_t begin = version_string.find_first_of("0123456789");
if (begin == std::string::npos)
return "0";
« 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