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

Side by Side Diff: ui/gl/gl_version_info.cc

Issue 1282363003: Convert remaining StringToLowerASCII to ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_version_info.h" 5 #include "ui/gl/gl_version_info.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_tokenizer.h" 8 #include "base/strings/string_tokenizer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 unsigned* minor_version, 60 unsigned* minor_version,
61 bool* is_es, 61 bool* is_es,
62 bool* is_es3) { 62 bool* is_es3) {
63 // Make sure the outputs are always initialized. 63 // Make sure the outputs are always initialized.
64 *major_version = 0; 64 *major_version = 0;
65 *minor_version = 0; 65 *minor_version = 0;
66 *is_es = false; 66 *is_es = false;
67 *is_es3 = false; 67 *is_es3 = false;
68 if (!version_str) 68 if (!version_str)
69 return; 69 return;
70 std::string lstr(base::StringToLowerASCII(std::string(version_str))); 70 std::string lstr(base::ToLowerASCII(version_str));
71 *is_es = (lstr.length() > 12) && (lstr.substr(0, 9) == "opengl es"); 71 *is_es = (lstr.length() > 12) && (lstr.substr(0, 9) == "opengl es");
72 if (*is_es) 72 if (*is_es)
73 lstr = lstr.substr(10, 3); 73 lstr = lstr.substr(10, 3);
74 base::StringTokenizer tokenizer(lstr.begin(), lstr.end(), "."); 74 base::StringTokenizer tokenizer(lstr.begin(), lstr.end(), ".");
75 unsigned major, minor; 75 unsigned major, minor;
76 if (tokenizer.GetNext() && 76 if (tokenizer.GetNext() &&
77 base::StringToUint(tokenizer.token_piece(), &major)) { 77 base::StringToUint(tokenizer.token_piece(), &major)) {
78 *major_version = major; 78 *major_version = major;
79 if (tokenizer.GetNext() && 79 if (tokenizer.GetNext() &&
80 base::StringToUint(tokenizer.token_piece(), &minor)) { 80 base::StringToUint(tokenizer.token_piece(), &minor)) {
81 *minor_version = minor; 81 *minor_version = minor;
82 } 82 }
83 } 83 }
84 if (*is_es && *major_version == 3) 84 if (*is_es && *major_version == 3)
85 *is_es3 = true; 85 *is_es3 = true;
86 } 86 }
87 87
88 } // namespace gfx 88 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698