summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-05-29 12:48:04 -0700
committerDan Stoza <stoza@google.com>2015-05-29 19:52:43 +0000
commitb8efdc40039e4900ae2c64fbdfa03906c867ec84 (patch)
treec80b6d9384939c6453bafbb9575334c0398e9007 /libs/ui
parent1c4537e2e80aa776a61517be8b1605e36432287a (diff)
downloadframeworks_native-b8efdc40039e4900ae2c64fbdfa03906c867ec84.zip
frameworks_native-b8efdc40039e4900ae2c64fbdfa03906c867ec84.tar.gz
frameworks_native-b8efdc40039e4900ae2c64fbdfa03906c867ec84.tar.bz2
libui: Apply GRALLOC_USAGE_ALLOC_MASK during alloc
Applies GRALLOC_USAGE_ALLOC_MASK to the incoming usage bits before calling alloc on the gralloc module. This filters out the new flag GRALLOC_USAGE_FOREIGN_BUFFERS, which is used to send a hint to the producer, but which does not affect the allocation of buffers. Bug: 19801661 Change-Id: Ia37a3eddba2e97598e50ac3e10877430adfa9247
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/GraphicBufferAllocator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index 85e9675..9b265af 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -104,6 +104,9 @@ status_t GraphicBufferAllocator::alloc(uint32_t width, uint32_t height,
// we have a h/w allocator and h/w buffer is requested
status_t err;
+ // Filter out any usage bits that should not be passed to the gralloc module
+ usage &= GRALLOC_USAGE_ALLOC_MASK;
+
int outStride = 0;
err = mAllocDev->alloc(mAllocDev, static_cast<int>(width),
static_cast<int>(height), format, static_cast<int>(usage), handle,