summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
diff options
context:
space:
mode:
authorThomas Tafertshofer <tafertth@google.com>2012-07-12 11:16:20 -0700
committerThomas Tafertshofer <tafertth@google.com>2012-07-12 11:23:02 -0700
commite58a97b5d77b59fad1572ba3c0572c7434e8e503 (patch)
tree21fd4ea77bc12da8d79a62706d879811fa905e29 /opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
parent2aa3aa680e24521e9874a5da9b017d978142faba (diff)
downloadframeworks_native-e58a97b5d77b59fad1572ba3c0572c7434e8e503.zip
frameworks_native-e58a97b5d77b59fad1572ba3c0572c7434e8e503.tar.gz
frameworks_native-e58a97b5d77b59fad1572ba3c0572c7434e8e503.tar.bz2
OpenGL bindings fix for methods with iobuffer args
This changes generation of the OpenGL bindings to prevent crashes of methods with more then one nio buffer argument. Bug: 6772416 Change-Id: I4eff25c2f568dea78a6ffd3e95ff4620ab4b3b7d
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp')
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
index 35a3c33..4ef815b 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
@@ -74,14 +74,12 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass)
}
static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
+getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
- jint offset;
- void *data;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
@@ -96,11 +94,10 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
- offset = _env->CallStaticIntMethod(nioAccessClass,
+ *offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
- data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
- return (void *) ((char *) data + offset);
+ return NULL;
}
static void