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

Commit 31ee0e6a authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

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

parents 3db84126 453effd1
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