summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Leekha <leekha@google.com>2015-08-03 15:05:12 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-03 15:05:12 +0000
commitda7645d6aba7c56b70c4b854685baf421a0c40f0 (patch)
treea6a68948ef0e13830e54e2f8fdf1956636c45430
parentf36738d37f030376a0c758394d3e3efd3d4b0b33 (diff)
parent7fa5c04d22416a3de239beea4c0f9d20229cf10a (diff)
downloadframeworks_native-da7645d6aba7c56b70c4b854685baf421a0c40f0.zip
frameworks_native-da7645d6aba7c56b70c4b854685baf421a0c40f0.tar.gz
frameworks_native-da7645d6aba7c56b70c4b854685baf421a0c40f0.tar.bz2
am 7fa5c04d: am c14a850f: am ea2afa46: Merge "Fix parsing of extension string" into mnc-dev
* commit '7fa5c04d22416a3de239beea4c0f9d20229cf10a': Fix parsing of extension string
-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()));
}
}
}