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.
onTouchEvent was previously incorrectly handled in GLSurfaceView; move it
to View so that it works properly with any of it's descendants.
This is done by reusing the existing setOnTouchListener implementation
and changing it to use GtkEventControllerLegacy which provides motion
events.
Technically some of the code is in WrapperWidget.c since every widget
calls wrapper_widget_set_jobject and we already have related code
there.
The current implementation requires a VA-API driver and a Wayland
compositor with YUV-buffer support. GNOME supports YUV-buffers
since the recent version 45 release