Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7651189a authored by Mathias Agopian's avatar Mathias Agopian Committed by android-build-merger
Browse files

Merge "Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer" into oc-dev

am: 31ee0e6a

Change-Id: I3b3f6869f4977b37fbdcbe56808d0f7aebf34c9e
parents 0cb54438 31ee0e6a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@

#include <private/android/AHardwareBufferHelpers.h>

#include <ui/GraphicBuffer.h>

using namespace android;

static int32_t query(ANativeWindow* window, int what) {
@@ -105,6 +107,10 @@ int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transfo
 * vndk-stable
 **************************************************************************************************/

AHardwareBuffer* ANativeWindowBuffer_getHardwareBuffer(ANativeWindowBuffer* anwb) {
    return AHardwareBuffer_from_GraphicBuffer(static_cast<GraphicBuffer*>(anwb));
}

int ANativeWindow_OemStorageSet(ANativeWindow* window, uint32_t slot, intptr_t value) {
    if (slot < 4) {
        window->oem[slot] = value;
+5 −1
Original line number Diff line number Diff line
@@ -99,8 +99,12 @@ typedef struct ANativeWindowBuffer

typedef struct ANativeWindowBuffer ANativeWindowBuffer;

/*****************************************************************************/
/*
 * Convert this ANativeWindowBuffer into a AHardwareBuffer
 */
AHardwareBuffer* ANativeWindowBuffer_getHardwareBuffer(ANativeWindowBuffer* anwb);

/*****************************************************************************/

/*
 * Stores a value into one of the 4 available slots