From 5b5bd2418b58541282f5627b69bf7dbddb1c4330 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Fri, 20 Jan 2012 23:45:16 +0530 Subject: [PATCH] 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 --- libqcomui/qcom_ui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libqcomui/qcom_ui.cpp b/libqcomui/qcom_ui.cpp index a528391..e28fb02 100644 --- a/libqcomui/qcom_ui.cpp +++ b/libqcomui/qcom_ui.cpp @@ -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(buffer_handle); - if (hnd->size < size) { + if (hnd->size != size) { return reallocate_memory(hnd, size, usage); } - return 0; }