Loading core/jni/android_opengl_GLES10.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -133,6 +133,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; Loading Loading @@ -305,9 +318,8 @@ android_glColorPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -2779,9 +2791,8 @@ android_glNormalPointerBounds__IILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3034,9 +3045,8 @@ android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3392,9 +3402,8 @@ android_glVertexPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading core/jni/com_google_android_gles_jni_GLImpl.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -133,6 +133,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; Loading Loading @@ -305,9 +318,8 @@ android_glColorPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -2779,9 +2791,8 @@ android_glNormalPointerBounds__IILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3034,9 +3045,8 @@ android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3392,9 +3402,8 @@ android_glVertexPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading opengl/tools/glgen/src/JniCodeEmitter.java +2 −8 Original line number Diff line number Diff line Loading @@ -890,16 +890,10 @@ public class JniCodeEmitter { cname + " = (" + cfunc.getArgType(cIndex).getDeclaration() + ") _env->GetDirectBufferAddress(" + (mUseCPlusPlus ? "" : "_env, ") + ") getDirectBufferPointer(_env, " + cname + "_buf);"); String iii = " "; out.println(iii + indent + "if ( ! " + cname + " ) {"); out.println(iii + iii + indent + (mUseCPlusPlus ? "_env" : "(*_env)") + "->ThrowNew(" + (mUseCPlusPlus ? "" : "_env, ") + "IAEClass, \"Must use a native order direct Buffer\");"); out.println(iii + iii + indent + "return;"); out.println(iii + indent + "}"); } else { Loading opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
core/jni/android_opengl_GLES10.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -133,6 +133,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; Loading Loading @@ -305,9 +318,8 @@ android_glColorPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -2779,9 +2791,8 @@ android_glNormalPointerBounds__IILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3034,9 +3045,8 @@ android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3392,9 +3402,8 @@ android_glVertexPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading
core/jni/com_google_android_gles_jni_GLImpl.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -133,6 +133,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; Loading Loading @@ -305,9 +318,8 @@ android_glColorPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -2779,9 +2791,8 @@ android_glNormalPointerBounds__IILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3034,9 +3045,8 @@ android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading Loading @@ -3392,9 +3402,8 @@ android_glVertexPointerBounds__IIILjava_nio_Buffer_2I GLvoid *pointer = (GLvoid *) 0; if (pointer_buf) { pointer = (GLvoid *) _env->GetDirectBufferAddress(pointer_buf); pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); if ( ! pointer ) { _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); return; } } Loading
opengl/tools/glgen/src/JniCodeEmitter.java +2 −8 Original line number Diff line number Diff line Loading @@ -890,16 +890,10 @@ public class JniCodeEmitter { cname + " = (" + cfunc.getArgType(cIndex).getDeclaration() + ") _env->GetDirectBufferAddress(" + (mUseCPlusPlus ? "" : "_env, ") + ") getDirectBufferPointer(_env, " + cname + "_buf);"); String iii = " "; out.println(iii + indent + "if ( ! " + cname + " ) {"); out.println(iii + iii + indent + (mUseCPlusPlus ? "_env" : "(*_env)") + "->ThrowNew(" + (mUseCPlusPlus ? "" : "_env, ") + "IAEClass, \"Must use a native order direct Buffer\");"); out.println(iii + iii + indent + "return;"); out.println(iii + indent + "}"); } else { Loading
opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -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; Loading