summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-04-27 11:06:01 -0700
committerDan Stoza <stoza@google.com>2015-04-27 11:45:58 -0700
commitd9c4971da2f2c4f980a748006bd40469c3332a13 (patch)
tree8b8b09aa864be49e6d3783e0c528babede21a808
parent63a0f428230208b9f3601eb7c99a08100c6f3a0b (diff)
downloadframeworks_native-d9c4971da2f2c4f980a748006bd40469c3332a13.zip
frameworks_native-d9c4971da2f2c4f980a748006bd40469c3332a13.tar.gz
frameworks_native-d9c4971da2f2c4f980a748006bd40469c3332a13.tar.bz2
libgui: Change detachNextBuffer to return sp<GB>
Changes Surface::detachNextBuffer to return an sp<GraphicBuffer> instead of an ANativeWindowBuffer* to ensure that reference counting works correctly. Bug: 20092217 Change-Id: I3979ea6121aaf14845f0554477b778770413581e (cherry picked from commit 8b2daa3ca29492b181fb67840640d771c4a2b3ac)
-rw-r--r--include/gui/Surface.h2
-rw-r--r--libs/gui/Surface.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index a9f78cf..fd6d48c 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -179,7 +179,7 @@ public:
virtual int unlockAndPost();
virtual int connect(int api, const sp<IProducerListener>& listener);
- virtual int detachNextBuffer(ANativeWindowBuffer** outBuffer,
+ virtual int detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence);
virtual int attachBuffer(ANativeWindowBuffer*);
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index b8acad2..5d81f10 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -651,7 +651,7 @@ int Surface::disconnect(int api) {
return err;
}
-int Surface::detachNextBuffer(ANativeWindowBuffer** outBuffer,
+int Surface::detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence) {
ATRACE_CALL();
ALOGV("Surface::detachNextBuffer");
@@ -670,7 +670,7 @@ int Surface::detachNextBuffer(ANativeWindowBuffer** outBuffer,
return result;
}
- *outBuffer = buffer.get();
+ *outBuffer = buffer;
if (fence != NULL && fence->isValid()) {
*outFence = fence;
} else {