Loading core/jni/android_opengl_EGL14.cpp +44 −19 Original line number Diff line number Diff line Loading @@ -69,22 +69,22 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) jclass eglconfigClassLocal = _env->FindClass("android/opengl/EGLConfig"); eglconfigClass = (jclass) _env->NewGlobalRef(eglconfigClassLocal); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getHandle", "()I"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getHandle", "()I"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getHandle", "()I"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getHandle", "()I"); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getNativeHandle", "()J"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getNativeHandle", "()J"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getNativeHandle", "()J"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getNativeHandle", "()J"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(I)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(I)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(I)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(I)V"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(J)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(J)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, (jint)EGL_NO_CONTEXT); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, (jint)EGL_NO_DISPLAY); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, (jint)EGL_NO_SURFACE); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); Loading @@ -106,7 +106,8 @@ fromEGLHandle(JNIEnv *_env, jmethodID mid, jobject obj) { "Object is set to null."); } return (void*) (_env->CallIntMethod(obj, mid)); jlong handle = _env->CallLongMethod(obj, mid); return reinterpret_cast<void*>(handle); } static jobject Loading @@ -126,7 +127,7 @@ toEGLHandle(JNIEnv *_env, jclass cls, jmethodID con, void * handle) { return eglNoSurfaceObject; } return _env->NewObject(cls, con, (jint)handle); return _env->NewObject(cls, con, reinterpret_cast<jlong>(handle)); } // -------------------------------------------------------------------------- Loading @@ -142,14 +143,26 @@ android_eglGetError /* EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) */ static jobject android_eglGetDisplay (JNIEnv *_env, jobject _this, jint display_id) { (JNIEnv *_env, jobject _this, jlong display_id) { EGLDisplay _returnValue = (EGLDisplay) 0; _returnValue = eglGetDisplay( (EGLNativeDisplayType)display_id reinterpret_cast<EGLNativeDisplayType>(display_id) ); return toEGLHandle(_env, egldisplayClass, egldisplayConstructor, _returnValue); } /* EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) */ static jobject android_eglGetDisplayInt (JNIEnv *_env, jobject _this, jint display_id) { if (sizeof(void*) != sizeof(uint32_t)) { jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglGetDisplay"); return 0; } return android_eglGetDisplay(_env, _this, display_id); } /* EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) */ static jboolean android_eglInitialize Loading Loading @@ -852,7 +865,7 @@ android_eglReleaseThread /* EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) */ static jobject android_eglCreatePbufferFromClientBuffer (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) { (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jlong buffer, jobject config, jintArray attrib_list_ref, jint offset) { jint _exception = 0; const char * _exceptionType = NULL; const char * _exceptionMessage = NULL; Loading Loading @@ -897,7 +910,7 @@ android_eglCreatePbufferFromClientBuffer _returnValue = eglCreatePbufferFromClientBuffer( (EGLDisplay)dpy_native, (EGLenum)buftype, (EGLClientBuffer)buffer, reinterpret_cast<EGLClientBuffer>(buffer), (EGLConfig)config_native, (EGLint *)attrib_list ); Loading @@ -913,6 +926,16 @@ exit: return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, _returnValue); } static jobject android_eglCreatePbufferFromClientBufferInt (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) { if(sizeof(void*) != sizeof(uint32_t)) { jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglCreatePbufferFromClientBuffer"); return 0; } return android_eglCreatePbufferFromClientBuffer(_env, _this, dpy, buftype, buffer, config, attrib_list_ref, offset); } /* EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) */ static jboolean android_eglSurfaceAttrib Loading Loading @@ -1207,7 +1230,8 @@ static const char *classPathName = "android/opengl/EGL14"; static JNINativeMethod methods[] = { {"_nativeClassInit", "()V", (void*)nativeClassInit }, {"eglGetError", "()I", (void *) android_eglGetError }, {"eglGetDisplay", "(I)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplay }, {"eglGetDisplay", "(I)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplayInt }, {"eglGetDisplay", "(J)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplay }, {"eglInitialize", "(Landroid/opengl/EGLDisplay;[II[II)Z", (void *) android_eglInitialize }, {"eglTerminate", "(Landroid/opengl/EGLDisplay;)Z", (void *) android_eglTerminate }, {"eglQueryString", "(Landroid/opengl/EGLDisplay;I)Ljava/lang/String;", (void *) android_eglQueryString__Landroind_opengl_EGLDisplay_2I }, Loading @@ -1224,7 +1248,8 @@ static JNINativeMethod methods[] = { {"eglQueryAPI", "()I", (void *) android_eglQueryAPI }, {"eglWaitClient", "()Z", (void *) android_eglWaitClient }, {"eglReleaseThread", "()Z", (void *) android_eglReleaseThread }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IILandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBuffer }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IILandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBufferInt }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IJLandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBuffer }, {"eglSurfaceAttrib", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;II)Z", (void *) android_eglSurfaceAttrib }, {"eglBindTexImage", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;I)Z", (void *) android_eglBindTexImage }, {"eglReleaseTexImage", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;I)Z", (void *) android_eglReleaseTexImage }, Loading core/jni/android_opengl_EGLExt.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -70,22 +70,22 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) jclass eglconfigClassLocal = _env->FindClass("android/opengl/EGLConfig"); eglconfigClass = (jclass) _env->NewGlobalRef(eglconfigClassLocal); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getHandle", "()I"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getHandle", "()I"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getHandle", "()I"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getHandle", "()I"); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getNativeHandle", "()J"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getNativeHandle", "()J"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getNativeHandle", "()J"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getNativeHandle", "()J"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(I)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(I)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(I)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(I)V"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(J)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(J)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, (jint)EGL_NO_CONTEXT); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, (jint)EGL_NO_DISPLAY); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, (jint)EGL_NO_SURFACE); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); Loading @@ -107,7 +107,7 @@ fromEGLHandle(JNIEnv *_env, jmethodID mid, jobject obj) { "Object is set to null."); } return (void*) (_env->CallIntMethod(obj, mid)); return reinterpret_cast<void*>(_env->CallLongMethod(obj, mid)); } static jobject Loading @@ -127,7 +127,7 @@ toEGLHandle(JNIEnv *_env, jclass cls, jmethodID con, void * handle) { return eglNoSurfaceObject; } return _env->NewObject(cls, con, (jint)handle); return _env->NewObject(cls, con, reinterpret_cast<jlong>(handle)); } // -------------------------------------------------------------------------- Loading opengl/java/android/opengl/EGL14.java +21 −1 Original line number Diff line number Diff line Loading @@ -155,10 +155,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) // TODO Deprecate the eglGetDisplay(int) API method public static native EGLDisplay eglGetDisplay( int display_id ); // TODO Unhide the eglGetDisplay(long) API method /** * {@hide} */ public static native EGLDisplay eglGetDisplay( long display_id ); // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) Loading Loading @@ -324,7 +332,7 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) // TODO Deprecate the below method public static native EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, Loading @@ -333,6 +341,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; int[] attrib_list, int offset ); // TODO Unhide the below method /** * {@hide} */ public static native EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, long buffer, EGLConfig config, int[] attrib_list, int offset ); // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) Loading opengl/java/android/opengl/EGLConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLConfig extends EGLObjectHandle { private EGLConfig(int handle) { private EGLConfig(long handle) { super(handle); } Loading @@ -32,6 +32,6 @@ public class EGLConfig extends EGLObjectHandle { if (!(o instanceof EGLConfig)) return false; EGLConfig that = (EGLConfig) o; return getHandle() == that.getHandle(); return getNativeHandle() == that.getNativeHandle(); } } opengl/java/android/opengl/EGLContext.java +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLContext extends EGLObjectHandle { private EGLContext(int handle) { private EGLContext(long handle) { super(handle); } Loading @@ -32,6 +32,6 @@ public class EGLContext extends EGLObjectHandle { if (!(o instanceof EGLContext)) return false; EGLContext that = (EGLContext) o; return getHandle() == that.getHandle(); return getNativeHandle() == that.getNativeHandle(); } } Loading
core/jni/android_opengl_EGL14.cpp +44 −19 Original line number Diff line number Diff line Loading @@ -69,22 +69,22 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) jclass eglconfigClassLocal = _env->FindClass("android/opengl/EGLConfig"); eglconfigClass = (jclass) _env->NewGlobalRef(eglconfigClassLocal); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getHandle", "()I"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getHandle", "()I"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getHandle", "()I"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getHandle", "()I"); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getNativeHandle", "()J"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getNativeHandle", "()J"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getNativeHandle", "()J"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getNativeHandle", "()J"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(I)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(I)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(I)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(I)V"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(J)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(J)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, (jint)EGL_NO_CONTEXT); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, (jint)EGL_NO_DISPLAY); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, (jint)EGL_NO_SURFACE); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); Loading @@ -106,7 +106,8 @@ fromEGLHandle(JNIEnv *_env, jmethodID mid, jobject obj) { "Object is set to null."); } return (void*) (_env->CallIntMethod(obj, mid)); jlong handle = _env->CallLongMethod(obj, mid); return reinterpret_cast<void*>(handle); } static jobject Loading @@ -126,7 +127,7 @@ toEGLHandle(JNIEnv *_env, jclass cls, jmethodID con, void * handle) { return eglNoSurfaceObject; } return _env->NewObject(cls, con, (jint)handle); return _env->NewObject(cls, con, reinterpret_cast<jlong>(handle)); } // -------------------------------------------------------------------------- Loading @@ -142,14 +143,26 @@ android_eglGetError /* EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) */ static jobject android_eglGetDisplay (JNIEnv *_env, jobject _this, jint display_id) { (JNIEnv *_env, jobject _this, jlong display_id) { EGLDisplay _returnValue = (EGLDisplay) 0; _returnValue = eglGetDisplay( (EGLNativeDisplayType)display_id reinterpret_cast<EGLNativeDisplayType>(display_id) ); return toEGLHandle(_env, egldisplayClass, egldisplayConstructor, _returnValue); } /* EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) */ static jobject android_eglGetDisplayInt (JNIEnv *_env, jobject _this, jint display_id) { if (sizeof(void*) != sizeof(uint32_t)) { jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglGetDisplay"); return 0; } return android_eglGetDisplay(_env, _this, display_id); } /* EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) */ static jboolean android_eglInitialize Loading Loading @@ -852,7 +865,7 @@ android_eglReleaseThread /* EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) */ static jobject android_eglCreatePbufferFromClientBuffer (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) { (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jlong buffer, jobject config, jintArray attrib_list_ref, jint offset) { jint _exception = 0; const char * _exceptionType = NULL; const char * _exceptionMessage = NULL; Loading Loading @@ -897,7 +910,7 @@ android_eglCreatePbufferFromClientBuffer _returnValue = eglCreatePbufferFromClientBuffer( (EGLDisplay)dpy_native, (EGLenum)buftype, (EGLClientBuffer)buffer, reinterpret_cast<EGLClientBuffer>(buffer), (EGLConfig)config_native, (EGLint *)attrib_list ); Loading @@ -913,6 +926,16 @@ exit: return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, _returnValue); } static jobject android_eglCreatePbufferFromClientBufferInt (JNIEnv *_env, jobject _this, jobject dpy, jint buftype, jint buffer, jobject config, jintArray attrib_list_ref, jint offset) { if(sizeof(void*) != sizeof(uint32_t)) { jniThrowException(_env, "java/lang/UnsupportedOperationException", "eglCreatePbufferFromClientBuffer"); return 0; } return android_eglCreatePbufferFromClientBuffer(_env, _this, dpy, buftype, buffer, config, attrib_list_ref, offset); } /* EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) */ static jboolean android_eglSurfaceAttrib Loading Loading @@ -1207,7 +1230,8 @@ static const char *classPathName = "android/opengl/EGL14"; static JNINativeMethod methods[] = { {"_nativeClassInit", "()V", (void*)nativeClassInit }, {"eglGetError", "()I", (void *) android_eglGetError }, {"eglGetDisplay", "(I)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplay }, {"eglGetDisplay", "(I)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplayInt }, {"eglGetDisplay", "(J)Landroid/opengl/EGLDisplay;", (void *) android_eglGetDisplay }, {"eglInitialize", "(Landroid/opengl/EGLDisplay;[II[II)Z", (void *) android_eglInitialize }, {"eglTerminate", "(Landroid/opengl/EGLDisplay;)Z", (void *) android_eglTerminate }, {"eglQueryString", "(Landroid/opengl/EGLDisplay;I)Ljava/lang/String;", (void *) android_eglQueryString__Landroind_opengl_EGLDisplay_2I }, Loading @@ -1224,7 +1248,8 @@ static JNINativeMethod methods[] = { {"eglQueryAPI", "()I", (void *) android_eglQueryAPI }, {"eglWaitClient", "()Z", (void *) android_eglWaitClient }, {"eglReleaseThread", "()Z", (void *) android_eglReleaseThread }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IILandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBuffer }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IILandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBufferInt }, {"eglCreatePbufferFromClientBuffer", "(Landroid/opengl/EGLDisplay;IJLandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;", (void *) android_eglCreatePbufferFromClientBuffer }, {"eglSurfaceAttrib", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;II)Z", (void *) android_eglSurfaceAttrib }, {"eglBindTexImage", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;I)Z", (void *) android_eglBindTexImage }, {"eglReleaseTexImage", "(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;I)Z", (void *) android_eglReleaseTexImage }, Loading
core/jni/android_opengl_EGLExt.cpp +13 −13 Original line number Diff line number Diff line Loading @@ -70,22 +70,22 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) jclass eglconfigClassLocal = _env->FindClass("android/opengl/EGLConfig"); eglconfigClass = (jclass) _env->NewGlobalRef(eglconfigClassLocal); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getHandle", "()I"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getHandle", "()I"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getHandle", "()I"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getHandle", "()I"); egldisplayGetHandleID = _env->GetMethodID(egldisplayClass, "getNativeHandle", "()J"); eglcontextGetHandleID = _env->GetMethodID(eglcontextClass, "getNativeHandle", "()J"); eglsurfaceGetHandleID = _env->GetMethodID(eglsurfaceClass, "getNativeHandle", "()J"); eglconfigGetHandleID = _env->GetMethodID(eglconfigClass, "getNativeHandle", "()J"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(I)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(I)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(I)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(I)V"); egldisplayConstructor = _env->GetMethodID(egldisplayClass, "<init>", "(J)V"); eglcontextConstructor = _env->GetMethodID(eglcontextClass, "<init>", "(J)V"); eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, (jint)EGL_NO_CONTEXT); jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, (jint)EGL_NO_DISPLAY); jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, (jint)EGL_NO_SURFACE); jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); Loading @@ -107,7 +107,7 @@ fromEGLHandle(JNIEnv *_env, jmethodID mid, jobject obj) { "Object is set to null."); } return (void*) (_env->CallIntMethod(obj, mid)); return reinterpret_cast<void*>(_env->CallLongMethod(obj, mid)); } static jobject Loading @@ -127,7 +127,7 @@ toEGLHandle(JNIEnv *_env, jclass cls, jmethodID con, void * handle) { return eglNoSurfaceObject; } return _env->NewObject(cls, con, (jint)handle); return _env->NewObject(cls, con, reinterpret_cast<jlong>(handle)); } // -------------------------------------------------------------------------- Loading
opengl/java/android/opengl/EGL14.java +21 −1 Original line number Diff line number Diff line Loading @@ -155,10 +155,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id ) // TODO Deprecate the eglGetDisplay(int) API method public static native EGLDisplay eglGetDisplay( int display_id ); // TODO Unhide the eglGetDisplay(long) API method /** * {@hide} */ public static native EGLDisplay eglGetDisplay( long display_id ); // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor ) Loading Loading @@ -324,7 +332,7 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; ); // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list ) // TODO Deprecate the below method public static native EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, Loading @@ -333,6 +341,18 @@ public static final int EGL_CORE_NATIVE_ENGINE = 0x305B; int[] attrib_list, int offset ); // TODO Unhide the below method /** * {@hide} */ public static native EGLSurface eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, long buffer, EGLConfig config, int[] attrib_list, int offset ); // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value ) Loading
opengl/java/android/opengl/EGLConfig.java +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLConfig extends EGLObjectHandle { private EGLConfig(int handle) { private EGLConfig(long handle) { super(handle); } Loading @@ -32,6 +32,6 @@ public class EGLConfig extends EGLObjectHandle { if (!(o instanceof EGLConfig)) return false; EGLConfig that = (EGLConfig) o; return getHandle() == that.getHandle(); return getNativeHandle() == that.getNativeHandle(); } }
opengl/java/android/opengl/EGLContext.java +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ package android.opengl; * */ public class EGLContext extends EGLObjectHandle { private EGLContext(int handle) { private EGLContext(long handle) { super(handle); } Loading @@ -32,6 +32,6 @@ public class EGLContext extends EGLObjectHandle { if (!(o instanceof EGLContext)) return false; EGLContext that = (EGLContext) o; return getHandle() == that.getHandle(); return getNativeHandle() == that.getNativeHandle(); } }