diff options
author | David Stevens <stevensd@chromium.org> | 2020-11-26 13:52:58 +0900 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-12-15 06:05:27 +0000 |
commit | a2fb87eea6d45ac02c9e669699481711ae70ef50 (patch) | |
tree | a6969d4f11ea7737baba3558ae5a1baa0e049eb4 /src/android_stub | |
parent | a1cf065e0a1aba0deb7c1fee0ed4e720468d28c9 (diff) |
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>
Diffstat (limited to 'src/android_stub')
-rw-r--r-- | src/android_stub/meson.build | 2 | ||||
-rw-r--r-- | src/android_stub/nativewindow_stub.cpp | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/android_stub/meson.build b/src/android_stub/meson.build index a4dc349d28f..86f88caea34 100644 --- a/src/android_stub/meson.build +++ b/src/android_stub/meson.build @@ -1,7 +1,7 @@ if with_android_stub stub_libs = [] - foreach lib : ['backtrace', 'cutils', 'hardware', 'log', 'sync'] + foreach lib : ['backtrace', 'cutils', 'hardware', 'log', 'nativewindow', 'sync'] stub_libs += shared_library( lib, files(lib + '_stub.cpp'), diff --git a/src/android_stub/nativewindow_stub.cpp b/src/android_stub/nativewindow_stub.cpp new file mode 100644 index 00000000000..dc0ea675560 --- /dev/null +++ b/src/android_stub/nativewindow_stub.cpp @@ -0,0 +1,15 @@ +#include <vndk/window.h> + +extern "C" { + +AHardwareBuffer* ANativeWindowBuffer_getHardwareBuffer(ANativeWindowBuffer* anwb) { + return nullptr; +} + +void AHardwareBuffer_acquire(AHardwareBuffer* buffer) { +} + +void AHardwareBuffer_release(AHardwareBuffer* buffer) { +} + +} |