GLSurfaceView: remove old implementation, import the one from AOSP

Now that we have a reasonably well working SurfaceView implementation,
it is actually cleaner to just implement GLSurfaceView the way AOSP
does. In fact, their code doesn't have any weird dependencies, and
can mostly be used as-is.

The AOSP code is pure Java, which means we had to implement some
EGL wrappers.

This change fixes issues with Wayland (it only ever worked because
the pbuffers were allocated using an XWayland EGLDisplay), and
with resizing (which we simply didn't support), all while getting
rid of quite some (arguably not very readable) LoC.
This commit is contained in:
Mis012
2023-10-20 20:54:37 +02:00
parent 621cb866c1
commit 9ef2151c5e
19 changed files with 2140 additions and 879 deletions

View File

@@ -91,9 +91,9 @@ public interface EGL10 extends EGL {
int EGL_WINDOW_BIT = 0x04;
Object EGL_DEFAULT_DISPLAY = null;
EGLDisplay EGL_NO_DISPLAY = null; // new com.google.android.gles_jni.EGLDisplayImpl(0);
EGLContext EGL_NO_CONTEXT = null; // new com.google.android.gles_jni.EGLContextImpl(0);
EGLSurface EGL_NO_SURFACE = null; // new com.google.android.gles_jni.EGLSurfaceImpl(0);
EGLDisplay EGL_NO_DISPLAY = new javax.microedition.khronos.egl.EGLDisplay(0);
EGLContext EGL_NO_CONTEXT = new javax.microedition.khronos.egl.EGLContext(0);
EGLSurface EGL_NO_SURFACE = new com.google.android.gles_jni.EGLSurfaceImpl(0);
boolean eglChooseConfig(EGLDisplay display, int[] attrib_list, EGLConfig[] configs, int config_size, int[] num_config);
boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface, Object native_pixmap);