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

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

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_version_info.h ('k') | ui/gl/gl_wgl_api_implementation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/gl/gl_version_info.h"
6
7 #include "base/strings/string_util.h"
8
9 namespace gfx {
10
11 GLVersionInfo::GLVersionInfo(const char* version_str)
12 : is_es(false),
13 is_es1(false),
14 is_es2(false),
15 is_es3(false),
16 is_gl1(false),
17 is_gl2(false),
18 is_gl3(false),
19 is_gl4(false) {
20 if (version_str) {
21 std::string lstr(StringToLowerASCII(std::string(version_str)));
22 is_es = (lstr.substr(0, 9) == "opengl es");
23 if (is_es) {
24 is_es1 = (lstr.substr(9, 2) == "-c" && lstr.substr(13, 2) == "1.");
25 is_es2 = (lstr.substr(9, 3) == " 2.");
26 is_es3 = (lstr.substr(9, 3) == " 3.");
27 } else {
28 is_gl2 = (lstr.substr(0, 2) == "2.");
29 is_gl3 = (lstr.substr(0, 2) == "3.");
30 is_gl4 = (lstr.substr(0, 2) == "4.");
31 // In early GL versions, GetString output format is implementation
32 // dependent.
33 is_gl1 = !is_gl2 && !is_gl3 && !is_gl4;
34 }
35 }
36 }
37
38 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_version_info.h ('k') | ui/gl/gl_wgl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698