diff options
| author | 2015-08-03 14:51:31 +0000 | |
|---|---|---|
| committer | 2015-08-03 14:51:31 +0000 | |
| commit | c14a850f65b2946cad808c0abb8740e800b74ab8 (patch) | |
| tree | 1aea1b5b4d3a6bc0122cb989b113825f311f3cde | |
| parent | 03d7e301c8beb971df7b560d1f16503ba3d6f440 (diff) | |
| parent | ea2afa460a2c2ee6c44406c1993e8bbacac838ba (diff) | |
am ea2afa46: Merge "Fix parsing of extension string" into mnc-dev
* commit 'ea2afa460a2c2ee6c44406c1993e8bbacac838ba':
Fix parsing of extension string
| -rw-r--r-- | opengl/libs/EGL/egl_object.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp index d511940e33..918faa80a5 100644 --- a/opengl/libs/EGL/egl_object.cpp +++ b/opengl/libs/EGL/egl_object.cpp @@ -14,6 +14,9 @@ ** limitations under the License. */ +#include <string> +#include <sstream> + #include <ctype.h> #include <stdint.h> #include <stdlib.h> @@ -115,15 +118,11 @@ void egl_context_t::onMakeCurrent(EGLSurface draw, EGLSurface read) { } // tokenize the supported extensions for the glGetStringi() wrapper - exts = gl_extensions.string(); - while (1) { - const char *end = strchr(exts, ' '); - if (end == NULL) { - tokenized_gl_extensions.push(String8(exts)); - break; - } - tokenized_gl_extensions.push(String8(exts, end - exts)); - exts = end + 1; + std::stringstream ss; + std::string str; + ss << gl_extensions.string(); + while (ss >> str) { + tokenized_gl_extensions.push(String8(str.c_str())); } } } |