mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-05 21:38:12 +00:00
ipc/client: Use Android allocator on client side.
This commit is contained in:
parent
a57507518d
commit
7c0df6506b
1
doc/changes/ipc/mr.493.md
Normal file
1
doc/changes/ipc/mr.493.md
Normal file
|
@ -0,0 +1 @@
|
|||
Use a native AHardwareBuffer allocator on the client side when building for recent-enough Android.
|
|
@ -52,7 +52,11 @@ target_include_directories(ipc_client PRIVATE
|
|||
target_link_libraries(ipc_client PRIVATE
|
||||
aux_util
|
||||
)
|
||||
|
||||
if(ANDROID)
|
||||
target_link_libraries(ipc_client PRIVATE
|
||||
aux_android
|
||||
)
|
||||
endif()
|
||||
|
||||
###
|
||||
# Server
|
||||
|
|
|
@ -129,9 +129,16 @@ ipc_client_instance_create_native_compositor(
|
|||
{
|
||||
struct ipc_client_instance *ii = ipc_client_instance(xinst);
|
||||
struct xrt_compositor_native *xcn = NULL;
|
||||
struct xrt_image_native_allocator *xina = NULL;
|
||||
|
||||
int ret = ipc_client_compositor_create(&ii->ipc_c, NULL, xdev, &xcn);
|
||||
#ifdef XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER
|
||||
// On Android, we allocate images natively on the client side.
|
||||
xina = android_ahardwarebuffer_allocator_create();
|
||||
#endif // XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER
|
||||
|
||||
int ret = ipc_client_compositor_create(&ii->ipc_c, xina, xdev, &xcn);
|
||||
if (ret < 0 || xcn == NULL) {
|
||||
xrt_images_destroy(&xina);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue