qcomui: Let the client decide the reallocation size
Always set the size the client wants, even if the gralloc calculated size is larger Change-Id: I31231f36ed0752db350d4fe62f8b04c7a84c6155
This commit is contained in:
parent
a8e088800a
commit
5b5bd2418b
@ -158,7 +158,7 @@ bool isGPUSupportedFormat(int format) {
|
||||
int checkBuffer(native_handle_t *buffer_handle, int size, int usage)
|
||||
{
|
||||
// If the client hasn't set a size, return
|
||||
if (0 == size) {
|
||||
if (0 >= size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -170,10 +170,9 @@ int checkBuffer(native_handle_t *buffer_handle, int size, int usage)
|
||||
|
||||
// Obtain the private_handle from the native handle
|
||||
private_handle_t *hnd = reinterpret_cast<private_handle_t*>(buffer_handle);
|
||||
if (hnd->size < size) {
|
||||
if (hnd->size != size) {
|
||||
return reallocate_memory(hnd, size, usage);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user