summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2017-04-03 15:34:13 -0700
committer Mathias Agopian <mathias@google.com> 2017-04-03 15:34:13 -0700
commit453effd1f144fb5a6ae89a7c377d20a845c49080 (patch)
tree25117a2bc1ae6fc357fbea373048c313278583db /libs/nativewindow/ANativeWindow.cpp
parent623912183d8314595b37cdedc7c193a21c345bdb (diff)
Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer
this is to allow vendors to use AHardwareBuffer’s lock/unlock on buffer dequeued from an ANativeWindow. Test: compiled Bug: 36866217 Change-Id: If630105572ae0e57f6fda19c13e82150f415ed6b
Diffstat (limited to 'libs/nativewindow/ANativeWindow.cpp')
-rw-r--r--libs/nativewindow/ANativeWindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index c0c4ac0f04..6c67cf8dc6 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -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;