From 8f798b39ee9f55f61a5cca5baebd880e81a3b22c Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Mon, 25 Feb 2019 08:37:03 +0000 Subject: [PATCH 1/2] Remove unnecessary field lookups in getPointer getNativeHandle fields are resolved in nativeClassInit. Bug: 124338141 Test: m -j100 Change-Id: I637975f9835027ec87f0e76ca6528797efa06e5d --- core/jni/android_opengl_EGL15.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/jni/android_opengl_EGL15.cpp b/core/jni/android_opengl_EGL15.cpp index 2abd95020f1c4..2a599dc0860df 100644 --- a/core/jni/android_opengl_EGL15.cpp +++ b/core/jni/android_opengl_EGL15.cpp @@ -171,8 +171,6 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *o *array = NULL; return reinterpret_cast(pointer); } - eglimageGetHandleID = _env->GetMethodID(eglimageClass, "getNativeHandle", "()J"); - eglsyncGetHandleID = _env->GetMethodID(eglsyncClass, "getNativeHandle", "()J"); *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); From 475468490d4e290c7b3e24dd958341ab4e451998 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Mon, 25 Feb 2019 15:01:32 +0000 Subject: [PATCH 2/2] Remove unused static variables Bug: 124338141 Test: m -j100 Change-Id: I84b30fc5e9fce9a4f51725b0dffd8848a6922512 --- core/jni/android_opengl_EGL14.cpp | 2 -- core/jni/android_opengl_EGL15.cpp | 2 -- core/jni/android_opengl_EGLExt.cpp | 2 -- core/jni/android_opengl_GLES10.cpp | 2 -- core/jni/android_opengl_GLES10Ext.cpp | 2 -- core/jni/android_opengl_GLES11.cpp | 2 -- core/jni/android_opengl_GLES11Ext.cpp | 2 -- core/jni/android_opengl_GLES20.cpp | 2 -- core/jni/android_opengl_GLES30.cpp | 2 -- core/jni/android_opengl_GLES31.cpp | 2 -- core/jni/android_opengl_GLES31Ext.cpp | 2 -- core/jni/android_opengl_GLES32.cpp | 2 -- core/jni/com_google_android_gles_jni_GLImpl.cpp | 2 -- 13 files changed, 26 deletions(-) diff --git a/core/jni/android_opengl_EGL14.cpp b/core/jni/android_opengl_EGL14.cpp index 15d1944205b60..13b059830eb95 100644 --- a/core/jni/android_opengl_EGL14.cpp +++ b/core/jni/android_opengl_EGL14.cpp @@ -35,8 +35,6 @@ #include -static int initialized = 0; - static jclass egldisplayClass; static jclass eglcontextClass; static jclass eglsurfaceClass; diff --git a/core/jni/android_opengl_EGL15.cpp b/core/jni/android_opengl_EGL15.cpp index 2a599dc0860df..563f5db011e7f 100644 --- a/core/jni/android_opengl_EGL15.cpp +++ b/core/jni/android_opengl_EGL15.cpp @@ -27,8 +27,6 @@ #include -static int initialized = 0; - // classes from EGL 1.4 static jclass egldisplayClass; static jclass eglsurfaceClass; diff --git a/core/jni/android_opengl_EGLExt.cpp b/core/jni/android_opengl_EGLExt.cpp index 75a25fe95e09a..1eb110135bf5e 100644 --- a/core/jni/android_opengl_EGLExt.cpp +++ b/core/jni/android_opengl_EGLExt.cpp @@ -36,8 +36,6 @@ #include -static int initialized = 0; - static jclass egldisplayClass; static jclass eglcontextClass; static jclass eglsurfaceClass; diff --git a/core/jni/android_opengl_GLES10.cpp b/core/jni/android_opengl_GLES10.cpp index ee5b5941202db..a4ab5db8c8d70 100644 --- a/core/jni/android_opengl_GLES10.cpp +++ b/core/jni/android_opengl_GLES10.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES10Ext.cpp b/core/jni/android_opengl_GLES10Ext.cpp index da7d0f01928ff..ee82fc71ce8d4 100644 --- a/core/jni/android_opengl_GLES10Ext.cpp +++ b/core/jni/android_opengl_GLES10Ext.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES11.cpp b/core/jni/android_opengl_GLES11.cpp index 391ae5366a3bc..be86a037bfbde 100644 --- a/core/jni/android_opengl_GLES11.cpp +++ b/core/jni/android_opengl_GLES11.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES11Ext.cpp b/core/jni/android_opengl_GLES11Ext.cpp index 09dce32b9e56b..d28d9a387b5e5 100644 --- a/core/jni/android_opengl_GLES11Ext.cpp +++ b/core/jni/android_opengl_GLES11Ext.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES20.cpp b/core/jni/android_opengl_GLES20.cpp index 99922cfe401df..ff4536ee17de6 100644 --- a/core/jni/android_opengl_GLES20.cpp +++ b/core/jni/android_opengl_GLES20.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES30.cpp b/core/jni/android_opengl_GLES30.cpp index adc635ed4eeac..9aca86672fb96 100644 --- a/core/jni/android_opengl_GLES30.cpp +++ b/core/jni/android_opengl_GLES30.cpp @@ -29,8 +29,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES31.cpp b/core/jni/android_opengl_GLES31.cpp index 512f562062e6d..4c51e2dc5f377 100644 --- a/core/jni/android_opengl_GLES31.cpp +++ b/core/jni/android_opengl_GLES31.cpp @@ -27,8 +27,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES31Ext.cpp b/core/jni/android_opengl_GLES31Ext.cpp index 5543fcadaed09..5b671c8e55fb4 100644 --- a/core/jni/android_opengl_GLES31Ext.cpp +++ b/core/jni/android_opengl_GLES31Ext.cpp @@ -28,8 +28,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/android_opengl_GLES32.cpp b/core/jni/android_opengl_GLES32.cpp index 2f1e31e7fab91..d59d25c2c4835 100644 --- a/core/jni/android_opengl_GLES32.cpp +++ b/core/jni/android_opengl_GLES32.cpp @@ -27,8 +27,6 @@ #include #include -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jmethodID getBasePointerID; diff --git a/core/jni/com_google_android_gles_jni_GLImpl.cpp b/core/jni/com_google_android_gles_jni_GLImpl.cpp index 40ff7e4c55172..ee14a89b54ef7 100644 --- a/core/jni/com_google_android_gles_jni_GLImpl.cpp +++ b/core/jni/com_google_android_gles_jni_GLImpl.cpp @@ -65,8 +65,6 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer, GLsizei count); } -static int initialized = 0; - static jclass nioAccessClass; static jclass bufferClass; static jclass G11ImplClass;