summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2013-03-05 17:48:38 -0500
committerSteve Kondik <shade@chemlab.org>2013-03-15 11:09:23 -0700
commitf4080b43069036ad896a66aea8a98ece0545e80c (patch)
tree5c51faf1f66ad1e224037cd3f151ace4979cd3a4
parentbbef29560e318cbdb0d4107b7fce6a2a64fd641b (diff)
downloadframeworks_native-f4080b43069036ad896a66aea8a98ece0545e80c.zip
frameworks_native-f4080b43069036ad896a66aea8a98ece0545e80c.tar.gz
frameworks_native-f4080b43069036ad896a66aea8a98ece0545e80c.tar.bz2
ui: Allocate the custom buffer size in the failure case also
The custom buffer size was not being honored if memory allocation failed in the first pass. Also - removing an unnecessary check. Change-Id: Ie501b2dda3843454405fec05fc898fec5912bd06
-rw-r--r--libs/ui/GraphicBufferAllocator.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index 9ad314a..470f58a 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -228,17 +228,21 @@ status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h,
BufferLiberatorThread::maybeWaitForLiberation();
#ifdef QCOM_BSP
- if (bufferSize)
- err = mAllocDev->allocSize(mAllocDev, w, h,
+ err = mAllocDev->allocSize(mAllocDev, w, h,
format, usage, handle, stride, bufferSize);
- else
+#else
+ err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
#endif
- err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
if (err != NO_ERROR) {
ALOGW("WOW! gralloc alloc failed, waiting for pending frees!");
BufferLiberatorThread::waitForLiberation();
+#ifdef QCOM_BSP
+ err = mAllocDev->allocSize(mAllocDev, w, h,
+ format, usage, handle, stride, bufferSize);
+#else
err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
+#endif
}
#ifdef QCOM_BSP