diff options
author | Sangkyu Lee <sk82.lee@lge.com> | 2014-11-07 18:55:07 +0900 |
---|---|---|
committer | Sangkyu Lee <sk82.lee@lge.com> | 2014-11-25 10:46:06 +0900 |
commit | 7290c24354ccf7efd7afa8fa6ba06689a852fae6 (patch) | |
tree | 16f1d8013b61700f89626b79ec2d0e8e0c6bcc2c | |
parent | c90b7d9c0f1df1cec8afbfebad0f111d878113e7 (diff) | |
download | frameworks_native-7290c24354ccf7efd7afa8fa6ba06689a852fae6.zip frameworks_native-7290c24354ccf7efd7afa8fa6ba06689a852fae6.tar.gz frameworks_native-7290c24354ccf7efd7afa8fa6ba06689a852fae6.tar.bz2 |
Avoid overwriting EGL14.EGL_NO_SURFACE
Both EGL14 and EGLExt have the same initialization codes for
EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY.
Since EGLExt is initialized later, they are overwritten by EGLExt's
initialization codes.
Therefore, EGL_NO_SURFACE returned by methods in EGL14 is not
actually EGL14.EGL_NO_SURFACE object and it makes several problems in
handling error cases.
For instance, "Let's fish" game application cannot be run on L.
To solve the problem, this patch makes EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY initialized just once.
Change-Id: Icce878164ff0b715ad2b5a2cd038a9616c7cf1e9
-rw-r--r-- | opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp index b5c19df..7976d2d 100644 --- a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp +++ b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp @@ -81,23 +81,19 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass) eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V"); eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V"); - jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT)); - eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); - jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY)); - eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); - jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE)); - eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); - jclass eglClass = _env->FindClass("android/opengl/EGL14"); jfieldID noContextFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_CONTEXT", "Landroid/opengl/EGLContext;"); - _env->SetStaticObjectField(eglClass, noContextFieldID, eglNoContextObject); + jobject localeglNoContextObject = _env->GetStaticObjectField(eglClass, noContextFieldID); + eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject); jfieldID noDisplayFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_DISPLAY", "Landroid/opengl/EGLDisplay;"); - _env->SetStaticObjectField(eglClass, noDisplayFieldID, eglNoDisplayObject); + jobject localeglNoDisplayObject = _env->GetStaticObjectField(eglClass, noDisplayFieldID); + eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject); jfieldID noSurfaceFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_SURFACE", "Landroid/opengl/EGLSurface;"); - _env->SetStaticObjectField(eglClass, noSurfaceFieldID, eglNoSurfaceObject); + jobject localeglNoSurfaceObject = _env->GetStaticObjectField(eglClass, noSurfaceFieldID); + eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject); } static void * |