summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp')
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp105
1 files changed, 1 insertions, 104 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
index 996f441..2389563 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
@@ -1,3 +1,4 @@
+/*
**
** Copyright 2009, The Android Open Source Project
**
@@ -16,110 +17,6 @@
// This source file is automatically generated
-#include "jni.h"
-#include "JNIHelp.h"
-#include <android_runtime/AndroidRuntime.h>
-#include <utils/misc.h>
-
-#include <assert.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-static int initialized = 0;
-
-static jclass nioAccessClass;
-static jclass bufferClass;
-static jmethodID getBasePointerID;
-static jmethodID getBaseArrayID;
-static jmethodID getBaseArrayOffsetID;
-static jfieldID positionID;
-static jfieldID limitID;
-static jfieldID elementSizeShiftID;
-
-/* Cache method IDs each time the class is loaded. */
-
-static void
-nativeClassInit(JNIEnv *_env, jclass glImplClass)
-{
- jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
- nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
-
- jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
- bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
-
- getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
- "getBasePointer", "(Ljava/nio/Buffer;)J");
- getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
- getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
- "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
-
- positionID = _env->GetFieldID(bufferClass, "position", "I");
- limitID = _env->GetFieldID(bufferClass, "limit", "I");
- elementSizeShiftID =
- _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
-}
-
-
-static void *
-getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
-{
- jint position;
- jint limit;
- jint elementSizeShift;
- jlong pointer;
-
- position = _env->GetIntField(buffer, positionID);
- limit = _env->GetIntField(buffer, limitID);
- elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- *remaining = (limit - position) << elementSizeShift;
- pointer = _env->CallStaticLongMethod(nioAccessClass,
- getBasePointerID, buffer);
- if (pointer != 0L) {
- *array = NULL;
- return (void *) (jint) pointer;
- }
-
- *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
- getBaseArrayID, buffer);
- *offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
-
- return NULL;
-}
-
-
-static void
-releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
-{
- _env->ReleasePrimitiveArrayCritical(array, data,
- 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 {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
-}
-
-static int
-getNumCompressedTextureFormats() {
- int numCompressedTextureFormats = 0;
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
- return numCompressedTextureFormats;
-}
-
-static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
-}
-
-// --------------------------------------------------------------------------