LG8n:libshims: Add android::GraphicBufferMapper::lock shim

Signed-off-by: Shirayuki39 <lorddemecrius83@proton.me>
This commit is contained in:
R0rt1z2 2024-07-28 19:47:58 +08:00 committed by Shirayuki39
parent 773cecf070
commit d5230ff22d
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,17 @@
//
// Copyright (C) 2024 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
cc_library_shared {
name: "libshim_ui",
shared_libs: [
"libui",
"libutils",
],
srcs: [
"GraphicBufferMapper.cpp",
],
system_ext_specific: true,
}

View file

@ -0,0 +1,22 @@
/*
* Copyright (C) 2024 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <ui/GraphicBufferMapper.h>
#include <ui/Rect.h>
#include <utils/Errors.h>
using android::Rect;
using android::status_t;
extern "C" {
status_t _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPvPiS9_(
void* thisptr, buffer_handle_t handle, uint32_t usage, const Rect& bounds, void** vaddr,
int32_t* /*outBytesPerPixel*/, int32_t* /*outBytesPerStride*/) {
auto* gpm = static_cast<android::GraphicBufferMapper*>(thisptr);
return gpm->lock(handle, usage, bounds, vaddr);
}
}