egl/android: implement image cleanup callback
authorDavid Stevens <stevensd@chromium.org>
Thu, 26 Nov 2020 04:52:58 +0000 (13:52 +0900)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Dec 2020 06:05:27 +0000 (06:05 +0000)
commita2fb87eea6d45ac02c9e669699481711ae70ef50
treea6969d4f11ea7737baba3558ae5a1baa0e049eb4
parenta1cf065e0a1aba0deb7c1fee0ed4e720468d28c9
egl/android: implement image cleanup callback

According to ANDROID_get_native_client_buffer, EGL implementations must
guarantee that the lifetime of an EGLClientBuffer returned by
eglGetNativeClientBufferANDROID is at least as long as that of the
EGLImage which is bound to. Do this by acquiring a reference to the
underlying AHardwareBuffer for all ANativeWindowBuffers which are bound
to an _EGLImage.

Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
src/android_stub/meson.build
src/android_stub/nativewindow_stub.cpp [new file with mode: 0644]
src/egl/drivers/dri2/platform_android.c