diff options
author | Jack Palevich <jackpal@google.com> | 2009-05-07 09:52:14 -0700 |
---|---|---|
committer | Jack Palevich <jackpal@google.com> | 2009-05-07 10:52:18 -0700 |
commit | be509c9c7de5929d014dfe6d45e71cc8454ede0f (patch) | |
tree | 53f649d9cd25b0d5930c5c9835d36b5521a6a02d /opengl/tools/glgen/stubs | |
parent | 0efb0868841cc1c2b5a669b39880d931f54f705a (diff) | |
download | frameworks_base-be509c9c7de5929d014dfe6d45e71cc8454ede0f.zip frameworks_base-be509c9c7de5929d014dfe6d45e71cc8454ede0f.tar.gz frameworks_base-be509c9c7de5929d014dfe6d45e71cc8454ede0f.tar.bz2 |
Fix automatically generated code for glGet
Remove include of an internal agl header file. We should not depend on any implementation details
of our software renderer, since they may not be correct if another renderer is used.
Fix glGet number-of-elements logic for GL_FOG_COLOR GL_LIGHT_MODEL_AMBIENT,
and GL_COMPRESSED_TEXTURE_FORMATS.
Diffstat (limited to 'opengl/tools/glgen/stubs')
5 files changed, 19 insertions, 29 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp index 3e5c19c..294d1ce 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp @@ -21,11 +21,7 @@ #include <assert.h> #include <GLES/gl.h> - -#include <private/opengles/gl_context.h> - -#define _NUM_COMPRESSED_TEXTURE_FORMATS \ - (::android::OGLES_NUM_COMPRESSED_TEXTURE_FORMATS) +#include <GLES/glext.h> static int initialized = 0; diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp index 3e5c19c..7aa18b6 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp @@ -21,11 +21,7 @@ #include <assert.h> #include <GLES/gl.h> - -#include <private/opengles/gl_context.h> - -#define _NUM_COMPRESSED_TEXTURE_FORMATS \ - (::android::OGLES_NUM_COMPRESSED_TEXTURE_FORMATS) +#include <GLES/glext.h> static int initialized = 0; @@ -66,7 +62,6 @@ nativeClassInitBuffer(JNIEnv *_env) _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); } - static void nativeClassInit(JNIEnv *_env, jclass glImplClass) { @@ -117,7 +112,6 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) return (void *) ((char *) data + offset); } - static void releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) { @@ -125,5 +119,12 @@ releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) commit ? 0 : JNI_ABORT); } +static int +getNumCompressedTextureFormats() { + int numCompressedTextureFormats = 0; + glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); + return numCompressedTextureFormats; +} + // -------------------------------------------------------------------------- diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp index 3e5c19c..294d1ce 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp @@ -21,11 +21,7 @@ #include <assert.h> #include <GLES/gl.h> - -#include <private/opengles/gl_context.h> - -#define _NUM_COMPRESSED_TEXTURE_FORMATS \ - (::android::OGLES_NUM_COMPRESSED_TEXTURE_FORMATS) +#include <GLES/glext.h> static int initialized = 0; diff --git a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp index 3e5c19c..294d1ce 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp @@ -21,11 +21,7 @@ #include <assert.h> #include <GLES/gl.h> - -#include <private/opengles/gl_context.h> - -#define _NUM_COMPRESSED_TEXTURE_FORMATS \ - (::android::OGLES_NUM_COMPRESSED_TEXTURE_FORMATS) +#include <GLES/glext.h> static int initialized = 0; diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp index 4636081..8f174c7 100644 --- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp +++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp @@ -21,11 +21,7 @@ #include <assert.h> #include <GLES/gl.h> - -#include <private/opengles/gl_context.h> - -#define _NUM_COMPRESSED_TEXTURE_FORMATS \ - (::android::OGLES_NUM_COMPRESSED_TEXTURE_FORMATS) +#include <GLES/glext.h> static int initialized = 0; @@ -66,7 +62,6 @@ nativeClassInitBuffer(JNIEnv *_env) _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); } - static void nativeClassInit(JNIEnv *_env, jclass glImplClass) { @@ -117,7 +112,6 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) return (void *) ((char *) data + offset); } - static void releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) { @@ -125,5 +119,12 @@ releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) commit ? 0 : JNI_ABORT); } +static int +getNumCompressedTextureFormats() { + int numCompressedTextureFormats = 0; + glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); + return numCompressedTextureFormats; +} + // -------------------------------------------------------------------------- |