From b6e5a8d60b8c63983000b41711941dc1c5b38102 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 8 Nov 2023 17:37:06 +0100 Subject: android: Use local var instead of 'mGL' member It's never used except where it's also previously assigned, so use a local variable instead. Even the getter `GLController#getGL` gets it from the EGLContext instead of using the member. Change-Id: Icec909f6e3e508a16fb455e81474bb336dc09362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159181 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- .../src/java/org/mozilla/gecko/gfx/GLController.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java index 2c503ab8b302..57ec2589b857 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/GLController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/GLController.java @@ -28,8 +28,6 @@ public class GLController { private EGLContext mEGLContext; private EGLSurface mEGLSurface; - private GL mGL; - private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4; private static final int[] CONFIG_SPEC = { @@ -82,7 +80,6 @@ public class GLController { getEGLError()); } - mGL = null; mEGLContext = null; } } @@ -111,7 +108,6 @@ public class GLController { mEGLConfig = null; mEGLContext = null; mEGLSurface = null; - mGL = null; return true; } public synchronized int getWidth() { @@ -159,11 +155,10 @@ public class GLController { getEGLError()); } - mGL = mEGLContext.getGL(); - if (mView.getRenderer() != null) { - mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig); - mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight); + GL10 gl = (GL10) mEGLContext.getGL(); + mView.getRenderer().onSurfaceCreated(gl, mEGLConfig); + mView.getRenderer().onSurfaceChanged(gl, mWidth, mHeight); } } @@ -208,11 +203,10 @@ public class GLController { "surface! " + getEGLError()); } - mGL = mEGLContext.getGL(); - if (mView.getRenderer() != null) { - mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig); - mView.getRenderer().onSurfaceChanged((GL10)mGL, mView.getWidth(), mView.getHeight()); + GL10 gl = (GL10) mEGLContext.getGL(); + mView.getRenderer().onSurfaceCreated(gl, mEGLConfig); + mView.getRenderer().onSurfaceChanged(gl, mView.getWidth(), mView.getHeight()); } } -- cgit