Merge "Modify for N_SE-40500, Did not appear empty text when empty text has set in...
authorwonyoung12.lee <wonyoung12.lee@samsung.com>
Mon, 10 Jun 2013 04:43:10 +0000 (13:43 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 10 Jun 2013 04:43:10 +0000 (13:43 +0900)
src/graphics/opengl/FGrpEgl.cpp
src/ui/FUi_DimmingManager.cpp
src/ui/FUi_EcoreEvas.cpp
src/ui/animations/FUiAnim_VisualElementImpl.cpp

index 59e3210..9925c9b 100644 (file)
@@ -27,6 +27,7 @@
 #include <X11/Xlib.h>
 #include <X11/Xmd.h>
 #include <EGL/egl.h>
+#include <EGL/eglext.h>
 
 #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);
 }
 
index 4418b00..c3fd4e7 100644 (file)
@@ -137,6 +137,17 @@ _DimmingManager::UnRegisterWindow(_Window* pWindow)
 result
 _DimmingManager::CreateDimmingLayer(_Window* pWindow)
 {
+       if (!pWindow)
+       {
+               return E_SUCCESS;
+       }
+
+       _DimmingLayer* pPrevDimmingLayer = pWindow->GetDimmingLayer();
+       if (pPrevDimmingLayer)
+       {
+               return E_SUCCESS;
+       }
+
        result r = E_SUCCESS;
 
        _DimmingLayer* pDimmingLayer = new (std::nothrow) _DimmingLayer();
index 3fbf51b..72a5399 100644 (file)
@@ -1368,20 +1368,20 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                if (rotateEvas == true)
                {
                        ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
-               }
 
-               evas_object_move(pWinObj, 0, 0);
+                       evas_object_move(pWinObj, 0, 0);
 
-               if ((orientation == 0) || (orientation == 180))
-               {
-                       evas_object_resize(pWinObj, rootW, rootH);
-               }
-               else
-               {
-                       evas_object_resize(pWinObj, rootH, rootW);
-               }
+                       if ((orientation == 0) || (orientation == 180))
+                       {
+                               evas_object_resize(pWinObj, rootW, rootH);
+                       }
+                       else
+                       {
+                               evas_object_resize(pWinObj, rootH, rootW);
+                       }
 
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+               }
        }
        else
        {
index ff4076c..a86708e 100644 (file)
@@ -484,26 +484,6 @@ _VisualElementImpl::FlushI(void)
        return _DisplayManager::GetInstance()->Flush();
 }
 
-result
-_VisualElementImpl::SetImageSource(const String& filePath)
-{
-       result r = E_SUCCESS;
-       RebuildHierarchyProps(0, true, true);
-
-       SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
-
-       if (!filePath.IsEmpty())
-       {
-               r = GetSharedData().SetImage(filePath);
-               SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
-       }
-
-       __imageFilePath = filePath;
-
-       return r;
-}
-
-
 bool
 _VisualElementImpl::CreateImplicitAnimationIfNeeded( const String& property,
                const Variant& newValue, const Variant& currentPresentationValue, const String** pSubProperties)
@@ -986,6 +966,41 @@ _VisualElementImpl::SetSurface(const VisualElementSurface* pSurface)
        return E_SUCCESS;
 }
 
+result
+_VisualElementImpl::SetImageSource(const String& filePath)
+{
+       result r = E_SUCCESS;
+
+       // Delete the old surface
+       if (GetSharedData().pSurface)
+       {
+               delete GetSharedData().pSurface;
+       }
+
+       __needRecreateSurface = true;
+
+       GetSharedData().pSurface = null;
+       GetSharedData().fixedSurfaceSize = false;
+
+       // Fully invalidate because new surface should be allocated and redrawn
+       GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, __bounds.width, __bounds.height);
+
+
+       RebuildHierarchyProps(0, true, true);
+
+       SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
+
+       if (!filePath.IsEmpty())
+       {
+               r = GetSharedData().SetImage(filePath);
+               SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
+       }
+
+       __imageFilePath = filePath;
+
+       return r;
+}
+
 void
 _VisualElementImpl::SetSurfaceChanged(void)
 {