diff options
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp')
-rw-r--r-- | opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp deleted file mode 100644 index 5d418d7..0000000 --- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp +++ /dev/null @@ -1,102 +0,0 @@ -** -** Copyright 2009, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -// 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 <GLES/gl.h> -#include <GLES/glext.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 position; - jint limit; - jint elementSizeShift; - jlong pointer; - jint offset; - void *data; - - 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); - data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - - return (void *) ((char *) data + offset); -} - - -static void -releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) -{ - _env->ReleasePrimitiveArrayCritical(array, data, - commit ? 0 : JNI_ABORT); -} - -// -------------------------------------------------------------------------- |