diff --git a/mobile/android/base/gfx/GLController.java b/mobile/android/base/gfx/GLController.java index 0498e8def9c6..83d86f9a5241 100644 --- a/mobile/android/base/gfx/GLController.java +++ b/mobile/android/base/gfx/GLController.java @@ -6,7 +6,6 @@ package org.mozilla.gecko.gfx; import javax.microedition.khronos.egl.EGL10; -import javax.microedition.khronos.egl.EGL11; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; @@ -24,7 +23,6 @@ public class GLController { private EGL10 mEGL; private EGLDisplay mEGLDisplay; private EGLConfig mEGLConfig; - private EGLSurface mEGLSurface; private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4; @@ -37,42 +35,19 @@ public class GLController { EGL10.EGL_NONE }; - public GLController(LayerView view) { + GLController(LayerView view) { mView = view; mGLVersion = 2; mSurfaceValid = false; } - public void setGLVersion(int version) { + /* This function is invoked by JNI */ + void setGLVersion(int version) { mGLVersion = version; } - public EGLDisplay getEGLDisplay() { return mEGLDisplay; } - public EGLConfig getEGLConfig() { return mEGLConfig; } - public EGLSurface getEGLSurface() { return mEGLSurface; } - public LayerView getView() { return mView; } - - public boolean hasSurface() { - return mEGLSurface != null; - } - - public boolean swapBuffers() { - return mEGL.eglSwapBuffers(mEGLDisplay, mEGLSurface); - } - - public boolean checkForLostContext() { - if (mEGL.eglGetError() != EGL11.EGL_CONTEXT_LOST) { - return false; - } - - mEGLDisplay = null; - mEGLConfig = null; - mEGLSurface = null; - return true; - } - - // This function is invoked by JNI - public void resumeCompositorIfValid() { + /* This function is invoked by JNI */ + void resumeCompositorIfValid() { synchronized (this) { if (!mSurfaceValid) { return; @@ -81,9 +56,10 @@ public class GLController { mView.getListener().compositionResumeRequested(mWidth, mHeight); } - // Wait until we are allowed to use EGL functions on the Surface backing - // this window. This function is invoked by JNI - public synchronized void waitForValidSurface() { + /* Wait until we are allowed to use EGL functions on the Surface backing + * this window. + * This function is invoked by JNI */ + synchronized void waitForValidSurface() { while (!mSurfaceValid) { try { wait(); @@ -93,14 +69,6 @@ public class GLController { } } - public synchronized int getWidth() { - return mWidth; - } - - public synchronized int getHeight() { - return mHeight; - } - synchronized void surfaceDestroyed() { mSurfaceValid = false; notifyAll(); @@ -164,7 +132,7 @@ public class GLController { * Provides an EGLSurface without assuming ownership of this surface. * This class does not keep a reference to the provided EGL surface; the * caller assumes ownership of the surface once it is returned. - */ + * This function is invoked by JNI */ private EGLSurface provideEGLSurface() { if (mEGL == null) { initEGL();