summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/stubs/jsr239
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-05-15 18:13:34 -0700
committerJack Palevich <jackpal@google.com>2009-05-15 18:13:34 -0700
commit16e7972f0d986eebf846ea8feb50f4435a9c6970 (patch)
treef5de2dace8158a51e9aed2304311054ffa7c3013 /opengl/tools/glgen/stubs/jsr239
parentb3af6b4805040ea42c01765387c99089822bbe7e (diff)
downloadframeworks_base-16e7972f0d986eebf846ea8feb50f4435a9c6970.zip
frameworks_base-16e7972f0d986eebf846ea8feb50f4435a9c6970.tar.gz
frameworks_base-16e7972f0d986eebf846ea8feb50f4435a9c6970.tar.bz2
Fix bug 1856713 gl Pointer functions should use Buffer position
JSR239 and android.opengl gl Pointer functions (glColorPointer, etc.) now respect the current setting of the Buffer position. This fixes a regression introduced when we started requiring the Buffers passed to the Pointer functions to be direct Buffers.
Diffstat (limited to 'opengl/tools/glgen/stubs/jsr239')
-rw-r--r--opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
index 11c6087..4896acb 100644
--- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
+++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
@@ -132,6 +132,19 @@ releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
commit ? 0 : JNI_ABORT);
}
+static void *
+getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
+ char* buf = (char*) _env->GetDirectBufferAddress(buffer);
+ if (buf) {
+ jint position = _env->GetIntField(buffer, positionID);
+ jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
+ buf += position << elementSizeShift;
+ } else {
+ _env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
+ }
+ return (void*) buf;
+}
+
static int
getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;