From 1ff8f60e4d8e8be84d99292fffdda15bbe1490c0 Mon Sep 17 00:00:00 2001 From: Sukwon Suh Date: Fri, 22 Mar 2013 18:42:01 +0900 Subject: [PATCH] clean surface when creating and fix bugs Change-Id: I4a3c9bbb49725b6f8f5a236b26e02a68fd0b6892 Signed-off-by: Sukwon Suh --- src/graphics/opengl/FGrpEgl.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/graphics/opengl/FGrpEgl.cpp b/src/graphics/opengl/FGrpEgl.cpp index e2b3378..f449196 100644 --- a/src/graphics/opengl/FGrpEgl.cpp +++ b/src/graphics/opengl/FGrpEgl.cpp @@ -1208,11 +1208,6 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi sglIndex = (_SglIndex)_SglCreatePixmapSurface(dpy, config, (EGLNativePixmapType)bitmap.get(), null); SysTryReturn(NID_GRP, sglIndex > INVALID_SGL_INDEX, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - BufferInfo bufferInfo; - bitmap.get()->Lock(bufferInfo); - memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); - bitmap.get()->Unlock(); - _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); pSglInfo->sglIndex = sglIndex; pSglInfo->display = dpy; @@ -1249,10 +1244,6 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi sglIndex = (_SglIndex)_SglCreatePixmapSurface(dpy, config, (EGLNativePixmapType)bitmapSecond.get(), null); SysTryReturn(NID_GRP, sglIndex > INVALID_SGL_INDEX, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - bitmapSecond.get()->Lock(bufferInfo); - memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); - bitmapSecond.get()->Unlock(); - _SglInfo* pSglInfoSecond = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); pSglInfoSecond->sglIndex = sglIndex; pSglInfoSecond->display = dpy; @@ -1498,6 +1489,10 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) #endif //#if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER) #endif //#if defined(FGRAPHICS_INTERNAL_USE_DRM) + pBitmap->Lock(bufferInfo); + memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); + pBitmap->Unlock(); + return (EGLNativePixmapType)pPixmapInfo->nativePixmap; CATCH_06: @@ -1641,8 +1636,8 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI bufferInfo.bitsPerPixel = 32; bufferInfo.pixelFormat = PIXEL_FORMAT_ARGB8888; - bufferInfo.pitch = bufferInfo.width * bufferInfo.bitsPerPixel / 4; - memset(bufferInfo.pPixels, 0, bufferInfo.width * bufferInfo.height * 4); + bufferInfo.pitch = bufferInfo.width * bufferInfo.bitsPerPixel / 8; + memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); r = pBitmapImpl->Construct(bufferInfo); if (r != E_SUCCESS) { -- 2.7.4