From 12973d5ad43dcbb5a36201c43b17ce74f90360ad Mon Sep 17 00:00:00 2001 From: Nolen Johnson Date: Tue, 20 Sep 2022 19:09:13 -0400 Subject: [PATCH] Provide a shim for libui Co-authored-by: Erfan Abdi Co-authored-by: Quallenauge Change-Id: I27d511340f0f2497bbeb2b046c18b66606610040 --- Android.bp | 7 +++++++ libui/GraphicBuffer.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 libui/GraphicBuffer.cpp diff --git a/Android.bp b/Android.bp index 30f7477..a2969b1 100644 --- a/Android.bp +++ b/Android.bp @@ -270,3 +270,10 @@ cc_library { }, vendor: true, } + +cc_library_shared { + name: "libui_shim", + shared_libs: ["libui"], + srcs: ["libui/GraphicBuffer.cpp"], + compile_multilib: "64", +} diff --git a/libui/GraphicBuffer.cpp b/libui/GraphicBuffer.cpp new file mode 100644 index 0000000..4b4b61a --- /dev/null +++ b/libui/GraphicBuffer.cpp @@ -0,0 +1,25 @@ +/* + Copyright 2022, The LineageOS Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(void* thisptr, uint32_t inUsage, + void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); + +extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(void* thisptr, uint32_t inUsage, + void** vaddr) { + _ZN7android13GraphicBuffer4lockEjPPvPiS3_(thisptr, inUsage, vaddr, nullptr, nullptr); +}