From: Sukwon Suh Date: Mon, 10 Jun 2013 01:25:02 +0000 (+0900) Subject: merge from tizen.2.1 X-Git-Tag: submit/tizen_2.2/20130714.153149~587 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce6c469a7753ca65b0c507e60795ff4d6675a8c4;p=framework%2Fosp%2Fuifw.git merge from tizen.2.1 Change-Id: I542d0cac6a83603c57232401cb9e9a1f023d4c87 Signed-off-by: Sukwon Suh --- diff --git a/src/graphics/opengl/FGrpEgl.cpp b/src/graphics/opengl/FGrpEgl.cpp index 59e3210..9925c9b 100644 --- a/src/graphics/opengl/FGrpEgl.cpp +++ b/src/graphics/opengl/FGrpEgl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #if defined(_OSP_EMUL_) #define FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER @@ -173,6 +174,8 @@ public: , swapDone(false) , isFirstSwap(true) , pSecondSglInfo(null) + , pBitmapPointer(null) + , pBitmapLocked(null) { } @@ -267,6 +270,8 @@ public: bool swapDone; bool isFirstSwap; _SglInfo* pSecondSglInfo; + void* pBitmapPointer; + Bitmap* pBitmapLocked; private: _SglInfo(const _SglInfo& sglInfo); @@ -1699,7 +1704,17 @@ _SglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* p return eglQuerySurface(dpy, EGL_NO_SURFACE, attribute, pValue); } - EGLBoolean ret = eglQuerySurface(dpy, pSglInfo->surface, attribute, pValue); + EGLBoolean ret = EGL_FALSE; + if (attribute == EGL_BITMAP_POINTER_KHR) + { + *pValue = (EGLint)pSglInfo->pBitmapPointer; + ret = EGL_TRUE; + } + else + { + ret = eglQuerySurface(dpy, pSglInfo->surface, attribute, pValue); + } + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); return ret; @@ -2086,9 +2101,73 @@ _SglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) typedef void (*__EglMustCastToProperFunctionPointerType)(void); +EGLBoolean _SglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list) +{ + _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance(); + + _SglIndex sglIndex = (_SglIndex)surface; + _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); + + if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null || pSglInfo->pBitmap == null || pSglInfo->pBitmapLocked != null) + { + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); + SysLog(NID_GRP, "_SglLockSurfaceKHR failed!! dpy:%#x sglIndex:%#x", (unsigned int)display + , (unsigned int)surface); + return EGL_FALSE; + } + + _SglInfo* pSglInfoLock = pSglInfo; + BufferInfo bufferInfo; + if(!pSglInfo->isBackbuffer && pSglInfo->pSecondSglInfo != null) + { + pSglInfoLock = pSglInfo->pSecondSglInfo; + } + + pSglInfoLock->pBitmap->Lock(bufferInfo); + pSglInfo->pBitmapPointer = bufferInfo.pPixels; + pSglInfo->pBitmapLocked = pSglInfoLock->pBitmap; + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); + + return EGL_TRUE; +} + +EGLBoolean _SglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface) +{ + _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance(); + + _SglIndex sglIndex = (_SglIndex)surface; + _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); + + if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null || pSglInfo->pBitmap == null || pSglInfo->pBitmapLocked == null) + { + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); + SysLog(NID_GRP, "_SglUnlockSurfaceKHR failed!! dpy:%#x sglIndex:%#x", (unsigned int)display + , (unsigned int)surface); + return EGL_FALSE; + } + + pSglInfo->pBitmapLocked->Unlock(); + pSglInfo->pBitmapPointer = null; + pSglInfo->pBitmapLocked = null; + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); + + return EGL_TRUE; +} + __EglMustCastToProperFunctionPointerType _SglGetProcAddress(const char* pProcName) { + String name(pProcName); + + if (name.CompareTo(String("eglLockSurfaceKHR")) == 0) + { + return (__EglMustCastToProperFunctionPointerType)_SglLockSurfaceKHR; + } + else if (name.CompareTo(String("eglUnlockSurfaceKHR")) == 0) + { + return (__EglMustCastToProperFunctionPointerType)_SglUnlockSurfaceKHR; + } + return eglGetProcAddress(pProcName); }