OSDN Git Service

Add an Android-specific static OpenGL ES 1.1 Java API.
authorJack Palevich <jackpal@google.com>
Thu, 16 Apr 2009 02:13:17 +0000 (19:13 -0700)
committerJack Palevich <jackpal@google.com>
Thu, 16 Apr 2009 22:20:55 +0000 (15:20 -0700)
commit27f8002e591b5c579f75b2580183b5d1c4219cd4
tree23fafecbd64e66b7a866510c8163d34c3e506df8
parentf5bfda1fcecc5d8553eab16182e2f6579214ede2
Add an Android-specific static OpenGL ES 1.1 Java API.

This change adds four new public classes that expose a static OpenGL ES 1.1 API:

android.opengl.GLES10
android.opengl.GLES10Ext
android.opengl.GLES11
android.opengl.GLES11Ext

Benefits:

 + The static API is slightly faster (1% to 4%) than the existing Interface based JSR239 API.
 + The static API is similar to the C API, which should make it easier to import C-based
   example code.
 + The static API provides a clear path for adding new OpenGL ES 1.1 extensions
   and OpenGL ES 2.0 APIs, neither of which currently have a JSR standard.

Example:

  import static android.opengl.GLES10.*;

  ...

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Note that it is possible to mix-and-match calls to both the static and JSR239 APIs.
This works because neither API maintains state. They both call through to the same underlying
C OpenGL ES APIs.

Implementation details:

This change enhances the "glgen" "gen" script to generate both the original JSR239 and
new static OpenGL ES APIs. The contents of the generated JSR239 classes remained the same as before,
so there is no need to check in new versions of the generated JSR239 classes.

As part of this work the gen script was updated to be somewhat more robust, and to
work with git instead of perforce. The script prints out commands to git add the generated files,
but leaves it up to the script runner to actually execute those commands.
57 files changed:
api/current.xml
core/jni/Android.mk
core/jni/AndroidRuntime.cpp
core/jni/android_opengl_GLES10.cpp [new file with mode: 0644]
core/jni/android_opengl_GLES10Ext.cpp [new file with mode: 0644]
core/jni/android_opengl_GLES11.cpp [new file with mode: 0644]
core/jni/android_opengl_GLES11Ext.cpp [new file with mode: 0644]
core/jni/com_google_android_gles_jni_GLImpl.cpp
opengl/java/android/opengl/GLES10.java [new file with mode: 0644]
opengl/java/android/opengl/GLES10Ext.java [new file with mode: 0644]
opengl/java/android/opengl/GLES11.java [new file with mode: 0644]
opengl/java/android/opengl/GLES11Ext.java [new file with mode: 0644]
opengl/tools/glgen/.gitignore [new file with mode: 0644]
opengl/tools/glgen/gen
opengl/tools/glgen/specs/gles11/GLES10.spec [new file with mode: 0644]
opengl/tools/glgen/specs/gles11/GLES10Ext.spec [new file with mode: 0644]
opengl/tools/glgen/specs/gles11/GLES11.spec [new file with mode: 0644]
opengl/tools/glgen/specs/gles11/GLES11Ext.spec [new file with mode: 0644]
opengl/tools/glgen/specs/gles11/checks.spec [new file with mode: 0644]
opengl/tools/glgen/specs/jsr239/glspec-1.0 [moved from opengl/tools/glgen/glspec-1.0 with 100% similarity]
opengl/tools/glgen/specs/jsr239/glspec-1.0ext [moved from opengl/tools/glgen/glspec-1.0ext with 100% similarity]
opengl/tools/glgen/specs/jsr239/glspec-1.1 [moved from opengl/tools/glgen/glspec-1.1 with 100% similarity]
opengl/tools/glgen/specs/jsr239/glspec-1.1ext [moved from opengl/tools/glgen/glspec-1.1ext with 100% similarity]
opengl/tools/glgen/specs/jsr239/glspec-1.1extpack [moved from opengl/tools/glgen/glspec-1.1extpack with 100% similarity]
opengl/tools/glgen/specs/jsr239/glspec-checks [moved from opengl/tools/glgen/glspec-checks with 100% similarity]
opengl/tools/glgen/src/GLESCodeEmitter.java [new file with mode: 0644]
opengl/tools/glgen/src/GenerateGL.java
opengl/tools/glgen/src/GenerateGLES.java [new file with mode: 0644]
opengl/tools/glgen/src/JFunc.java
opengl/tools/glgen/src/JType.java
opengl/tools/glgen/src/JniCodeEmitter.java
opengl/tools/glgen/src/Jsr239CodeEmitter.java
opengl/tools/glgen/stubs/gles11/GLES10ExtHeader.java-if [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES10Header.java-if [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES11ExtHeader.java-if [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES11Header.java-if [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp [new file with mode: 0644]
opengl/tools/glgen/stubs/gles11/glGetString.cpp [moved from opengl/tools/glgen/stubs/glGetString.cpp with 93% similarity]
opengl/tools/glgen/stubs/gles11/glGetString.java [moved from opengl/tools/glgen/stubs/glGetString.java-impl with 100% similarity]
opengl/tools/glgen/stubs/gles11/glGetString.nativeReg [moved from opengl/tools/glgen/stubs/glGetString.nativeReg with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL10ExtHeader.java-if [moved from opengl/tools/glgen/stubs/GL10ExtHeader.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL10Header.java-if [moved from opengl/tools/glgen/stubs/GL10Header.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL11ExtHeader.java-if [moved from opengl/tools/glgen/stubs/GL11ExtHeader.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL11ExtensionPackHeader.java-if [moved from opengl/tools/glgen/stubs/GL11ExtensionPackHeader.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL11Header.java-if [moved from opengl/tools/glgen/stubs/GL11Header.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GL11ImplHeader.java-impl [moved from opengl/tools/glgen/stubs/GL11ImplHeader.java-impl with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp [moved from opengl/tools/glgen/stubs/GLCHeader.cpp with 99% similarity]
opengl/tools/glgen/stubs/jsr239/GLHeader.java-if [moved from opengl/tools/glgen/stubs/GLHeader.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl [moved from opengl/tools/glgen/stubs/GLImplHeader.java-impl with 100% similarity]
opengl/tools/glgen/stubs/jsr239/glGetString.cpp [new file with mode: 0644]
opengl/tools/glgen/stubs/jsr239/glGetString.java-10-if [moved from opengl/tools/glgen/stubs/glGetString.java-10-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/glGetString.java-if [moved from opengl/tools/glgen/stubs/glGetString.java-if with 100% similarity]
opengl/tools/glgen/stubs/jsr239/glGetString.java-impl [new file with mode: 0644]
opengl/tools/glgen/stubs/jsr239/glGetString.nativeReg [new file with mode: 0644]