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
This commit is contained in:
Neti Ravi Kumar 2011-12-23 21:27:14 +05:30 committed by Giulio Cervera
parent 6db0f47326
commit ada9e68943

View File

@ -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);
}