From ada9e68943604cdad396afb62e660644189fcd1a Mon Sep 17 00:00:00 2001 From: Neti Ravi Kumar Date: Fri, 23 Dec 2011 21:27:14 +0530 Subject: [PATCH] Display/libqcomUI:Choosing memset according to pixel format For 2 bytes per pixel format the width might be not alligned to 4 So for such cases we need to use memset16 Change-Id: I22a6c673439c44447ce33faf2ed0615febd70a28 --- libqcomui/qcom_ui.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libqcomui/qcom_ui.cpp b/libqcomui/qcom_ui.cpp index 107827f..58f4ffb 100644 --- a/libqcomui/qcom_ui.cpp +++ b/libqcomui/qcom_ui.cpp @@ -399,12 +399,11 @@ int qcomuiClearRegion(Region region, EGLDisplay dpy, EGLSurface sur) (r.left + r.top*renderBuffer->stride)*bytesPerPixel; int w = r.width()*bytesPerPixel; int h = r.height(); - if(((int)dst + w ) > (fbHandle->base + renderBuffer->stride*bytesPerPixel)){ - LOGE("%s: Excedding the framebuffer limit",__FUNCTION__ ) ; - return -1; - } do { - android_memset32((uint32_t*)dst, 0, w); + if(4 == bytesPerPixel) + android_memset32((uint32_t*)dst, 0, w); + else + android_memset16((uint16_t*)dst, 0, w); dst += stride; } while(--h); }