libgralloc: Add support for custom buffer size.
Init allocSize hook function with alloc_size function Change-Id: I514d47928f10b6c41404aa19d8b704f64327211b
This commit is contained in:
@@ -43,6 +43,7 @@ gpu_context_t::gpu_context_t(const private_module_t* module,
|
||||
common.module = const_cast<hw_module_t*>(&module->base.common);
|
||||
common.close = gralloc_close;
|
||||
alloc = gralloc_alloc;
|
||||
allocSize = gralloc_alloc_size;
|
||||
free = gralloc_free;
|
||||
|
||||
}
|
||||
@@ -219,7 +220,7 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage,
|
||||
|
||||
if ((ssize_t)size <= 0)
|
||||
return -EINVAL;
|
||||
size = (bufferSize >= size)? bufferSize : size;
|
||||
size = (bufferSize != 0)? bufferSize : size;
|
||||
|
||||
// All buffers marked as protected or for external
|
||||
// display need to go to overlay
|
||||
|
||||
Reference in New Issue
Block a user