Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27f8002e authored by Jack Palevich's avatar Jack Palevich
Browse files

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.
parent f5bfda1f
Loading
Loading
Loading
Loading
+10420 −1

File changed.

File size exceeds preview limit.

+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,10 @@ LOCAL_SRC_FILES:= \
	CursorWindow.cpp \
	com_google_android_gles_jni_EGLImpl.cpp \
	com_google_android_gles_jni_GLImpl.cpp.arm \
	android_opengl_GLES10.cpp \
	android_opengl_GLES10Ext.cpp \
	android_opengl_GLES11.cpp \
	android_opengl_GLES11Ext.cpp \
	android_database_CursorWindow.cpp \
	android_database_SQLiteDebug.cpp \
	android_database_SQLiteDatabase.cpp \
+8 −0
Original line number Diff line number Diff line
@@ -66,6 +66,10 @@ extern int register_android_graphics_Typeface(JNIEnv* env);

extern int register_com_google_android_gles_jni_EGLImpl(JNIEnv* env);
extern int register_com_google_android_gles_jni_GLImpl(JNIEnv* env);
extern int register_android_opengl_jni_GLES10(JNIEnv* env);
extern int register_android_opengl_jni_GLES10Ext(JNIEnv* env);
extern int register_android_opengl_jni_GLES11(JNIEnv* env);
extern int register_android_opengl_jni_GLES11Ext(JNIEnv* env);

extern int register_android_hardware_Camera(JNIEnv *env);

@@ -1042,6 +1046,10 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_view_ViewRoot),
    REG_JNI(register_com_google_android_gles_jni_EGLImpl),
    REG_JNI(register_com_google_android_gles_jni_GLImpl),
    REG_JNI(register_android_opengl_jni_GLES10),
    REG_JNI(register_android_opengl_jni_GLES10Ext),
    REG_JNI(register_android_opengl_jni_GLES11),
    REG_JNI(register_android_opengl_jni_GLES11Ext),

    REG_JNI(register_android_graphics_Bitmap),
    REG_JNI(register_android_graphics_BitmapFactory),
Loading