summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorNaveen Leekha <leekha@google.com>2015-08-03 14:45:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-03 14:45:11 +0000
commitea2afa460a2c2ee6c44406c1993e8bbacac838ba (patch)
tree11c704ced84dd451625700542b2761315f560ea2 /opengl
parentd87defaf486ff4e9c0066754564851cfb7be49ed (diff)
parente2fc6f87bea38ff3e4e6bd20ffe838b09b9f4411 (diff)
downloadframeworks_native-ea2afa460a2c2ee6c44406c1993e8bbacac838ba.zip
frameworks_native-ea2afa460a2c2ee6c44406c1993e8bbacac838ba.tar.gz
frameworks_native-ea2afa460a2c2ee6c44406c1993e8bbacac838ba.tar.bz2
Merge "Fix parsing of extension string" into mnc-dev
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/egl_object.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp
index d511940..918faa8 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()));
}
}
}