Removed workaround code regarding window rotation
authorBongjoo Seo <bongjoo.seo@samsung.com>
Fri, 12 Jul 2013 03:24:17 +0000 (12:24 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Fri, 12 Jul 2013 03:32:34 +0000 (12:32 +0900)
Change-Id: I61151e9d27e68360e039065abaf803719e776934
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/FUi_EcoreEvas.cpp
src/ui/animations/FUiAnim_EflLayer.cpp
src/ui/inc/FUiAnim_EflLayer.h

index 9a3fceb..e3dd0b8 100644 (file)
@@ -1356,7 +1356,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                rotatePartial = false;
        }
 
-       Evas_Object* pWinObj = pLayer->GetElmWin();
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
        int rootW = 0;
@@ -1369,15 +1368,14 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                {
                        ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
 
-                       evas_object_move(pWinObj, 0, 0);
 
                        if ((orientation == 0) || (orientation == 180))
                        {
-                               evas_object_resize(pWinObj, rootW, rootH);
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
                        }
                        else
                        {
-                               evas_object_resize(pWinObj, rootH, rootW);
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootH, rootW));
                        }
 
                        SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, FULL SCREEN] Rotate bounds(ROT %d).", win, orientation);
@@ -1393,7 +1391,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
                int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-
                int winX = winBounds.x;
                int winY = winBounds.y;
 
@@ -1421,15 +1418,15 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                int h = 0;
                Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-               evas_object_move(pWinObj, winX, winY);
 
                if (ret == EINA_FALSE)
                {
-                       evas_object_resize(pWinObj, winBounds.width, winBounds.height);
+                       pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
                        SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
                }
                else
                {
+                       pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
                        SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
                }
        }
@@ -2415,16 +2412,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               evas_object_resize(pWinObject, winBounds.width, winBounds.height);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
                SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2503,16 +2500,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               evas_object_resize(pWinObject, winBounds.width, winBounds.height);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
                SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
index 07da1fe..73369a6 100644 (file)
@@ -44,14 +44,10 @@ using namespace Tizen::Graphics;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
 
-//#define _NEED_DAMAGE_HANDER_
-
-//#define PRINT printf
+//#define PRINT(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
 #define PRINT(...)
 
 
-
-
 namespace
 {
 #define __UNUSED__
@@ -59,62 +55,20 @@ namespace
 
 Ecore_Idle_Enterer* __pOnIdleLoopIterator = null;
 
-
-//static const double fpsLimitInterval = 1.0 / 55.0;
-static bool __needPreRender = false;
-Eina_Bool
-OnIdleLoopIterate(void* pData)
-{
-       _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
-
-//     PRINT("OnIdleLoopIterate()\n");
-
-
-       if (!pDisplayManager)
-       {
-               return ECORE_CALLBACK_CANCEL; // for remove callback
-       }
-
-       Tizen::Ui::Animations::_AnimationManager* pAnimationManager = Tizen::Ui::Animations::_AnimationManager::GetInstance();
-
-       if (!pAnimationManager)
-       {
-               return ECORE_CALLBACK_CANCEL; // for remove callback
-       }
-
-       //CHECK ME : how about the performance?
-//     double currentTime = ecore_time_get();
-//     static double prevFlushTime = 0;
-
-//     if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
-       {
-               pAnimationManager->ProcessAnimationTick();
-
-//             prevFlushTime = currentTime;
-
-               pDisplayManager->RenderAll();
-
-               pDisplayManager->Flush();
-       }
-
-       return ECORE_CALLBACK_RENEW;
-}
-
-// WARNING: Without this, idle-enterer will be called after evas destroyed which may cause crash while accessing ecore-evas.
+#ifdef USE_WORKAROUND
 void
-OnEcoreEvasFree(Ecore_Evas* pEcoreEvas)
+OnRenderFlushPost(void* pData, Evas* pEvas, void* ev)
 {
-       ecore_evas_manual_render_set(pEcoreEvas, EINA_FALSE);
+//     _EflLayer* pLayer = (_EflLayer*)pData;
+//     int w, h;
+//     evas_output_size_get(pLayer->GetEvas(), &w, &h);
+//     int rotate = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
+//     PRINT("[%#x] OnRenderFlushPost size(%d,%d) rotate=%d\n", (unsigned int)pData, w, h, rotate);
 }
-#endif
-
-
-#ifdef _NEED_DAMAGE_HANDER_
 
 Eina_Bool
 OnXWindowDamaged(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
 {
-#if 1
        _Ecore_X_Event_Window_Damage* pEvent = (_Ecore_X_Event_Window_Damage*)pEventInfo;
 
        if (pData)
@@ -123,24 +77,15 @@ OnXWindowDamaged(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
 
                if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
                {
-                       FloatRectangle bounds = pLayer->GetBounds();
-
-                       evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
-                       pLayer->SetEvasRenderNeeded();
-
-                       _DisplayManager::GetInstance()->AddWakeUpEvent();
-
-                       PRINT("OnXWindowDamaged(%p)[%d,%d,%d,%d]------------\n", pLayer->GetEvas(), pEvent->x, pEvent->y, pEvent->w, pEvent->h);
+                       PRINT("[%#x] OnXWindowDamaged[%d,%d,%d,%d]------------\n", (unsigned int)pLayer, pEvent->x, pEvent->y, pEvent->w, pEvent->h);
                }
        }
-#endif
        return EINA_TRUE;
 }
 
 Eina_Bool
 OnXWindowConfigured(void* pData, int type, void* pEventInfo)
 {
-#if 0
        _Ecore_X_Event_Window_Configure* pEvent = (_Ecore_X_Event_Window_Configure*)pEventInfo;
 
        if (pData)
@@ -149,17 +94,12 @@ OnXWindowConfigured(void* pData, int type, void* pEventInfo)
 
                if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
                {
-                       FloatRectangle bounds = pLayer->GetBounds();
-
-                       evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
-                       pLayer->SetEvasRenderNeeded();
+                       int w, h;
+                       evas_output_size_get(pLayer->GetEvas(), &w, &h);
+                       PRINT("[%#x] OnXWindowConfigured[%d,%d,%d,%d]       evas(%d,%d)------------\n", (unsigned int)pLayer, pEvent->x, pEvent->y, pEvent->w, pEvent->h, w, h);
 
-                       _DisplayManager::GetInstance()->AddWakeUpEvent();
-
-                       PRINT("OnXWindowConfigured(%p)[%d,%d,%d,%d]------------\n", pLayer->GetEvas(), pEvent->x, pEvent->y, pEvent->w, pEvent->h);
                }
        }
-#endif
 
        return EINA_TRUE;
 }
@@ -175,13 +115,9 @@ OnXWindowHidden(void* pData, int type, void* pEventInfo)
        }
 
        _EflLayer* pLayer = (_EflLayer*)pData;
-       PRINT("############ Hidden (%p, 0x%x) \n" , pLayer, pEvent->win);
-
        if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
        {
-               PRINT("############ Hidden (%p) -> EventDone() \n" , pData);
-               pLayer->SetVisibilityChangeCompleted();
-               _DisplayManager::GetInstance()->AddWakeUpEvent();
+               PRINT("[%#x] ############ Hidden -> EventDone() \n" , (unsigned int)pData);
        }
 
        return EINA_TRUE;
@@ -198,25 +134,68 @@ OnXWindowShown(void* pData, int type, void* pEventInfo)
        }
 
        _EflLayer* pLayer = (_EflLayer*)pData;
-       PRINT("############ Shown (%p, 0x%x) \n" , pLayer, pEvent->win);
-
        if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
        {
-               PRINT("############ Shown (%p) -> EventDone() \n" , pData);
 
-               FloatRectangle bounds = pLayer->GetBounds();
+               //ecore_evas_rotation_set(pLayer->GetEcoreEvas(), 270);
+               PRINT("[%#x] ############ Shown -> EventDone() \n" , (unsigned int)pData);
+       }
+
+       return EINA_TRUE;
+}
+#endif // USE_WORKAROUND
+
+
+
+//static const double fpsLimitInterval = 1.0 / 55.0;
+static bool __needPreRender = false;
+Eina_Bool
+OnIdleLoopIterate(void* pData)
+{
+       _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+
+//     PRINT("OnIdleLoopIterate()\n");
+
+
+       if (!pDisplayManager)
+       {
+               return ECORE_CALLBACK_CANCEL; // for remove callback
+       }
 
-               evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
+       Tizen::Ui::Animations::_AnimationManager* pAnimationManager = Tizen::Ui::Animations::_AnimationManager::GetInstance();
 
-               pLayer->SetVisibilityChangeCompleted();
-               _DisplayManager::GetInstance()->AddWakeUpEvent();
+       if (!pAnimationManager)
+       {
+               return ECORE_CALLBACK_CANCEL; // for remove callback
        }
 
-       return EINA_TRUE;
+       //CHECK ME : how about the performance?
+//     double currentTime = ecore_time_get();
+//     static double prevFlushTime = 0;
+
+//     if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
+       {
+               pAnimationManager->ProcessAnimationTick();
+
+//             prevFlushTime = currentTime;
+
+               pDisplayManager->RenderAll();
+
+               pDisplayManager->Flush();
+       }
+
+       return ECORE_CALLBACK_RENEW;
 }
 
+// WARNING: Without this, idle-enterer will be called after evas destroyed which may cause crash while accessing ecore-evas.
+void
+OnEcoreEvasFree(Ecore_Evas* pEcoreEvas)
+{
+       ecore_evas_manual_render_set(pEcoreEvas, EINA_FALSE);
+}
 #endif
 
+
 void
 PreRenderCallback(Ecore_Evas* ee)
 {
@@ -237,7 +216,11 @@ PreRenderCallback(Ecore_Evas* ee)
                }
 #endif
 
-               _DisplayManager::GetInstance()->Render(*pEflLayer->GetRootVisualElement());
+               _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+               if (pDisplayManager)
+               {
+                       pDisplayManager->Render(*pEflLayer->GetRootVisualElement());
+               }
        }
 }
 
@@ -248,7 +231,11 @@ PostRenderCallback(Ecore_Evas* ee)
 
        if (pEflLayer && pEflLayer->GetRootVisualElement())
        {
-               _DisplayManager::GetInstance()->PostRender(*pEflLayer->GetRootVisualElement());
+               _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+               if (pDisplayManager)
+               {
+                       pDisplayManager->PostRender(*pEflLayer->GetRootVisualElement());
+               }
        }
 }
 
@@ -260,41 +247,43 @@ namespace Tizen { namespace Ui { namespace Animations
 int _EflLayer::_countOfLayer = 0;
 
 _EflLayer::_EflLayer(void)
-       : _pEvas(null)
+       : _pRootVisualElement(null)
+       , _pEvas(null)
        , _pEcoreEvas(null)
        , _pWindow(null)
-       , _pOnWindowDamagedHandler(null)
-       , _pOnWindowConfiguredHandler(null)
-       , _pOnWindowHideHandler(null)
-       , _pOnWindowShowHandler(null)
-       , _needEvasRender(0)
+       , _needBoundsChangeRequest(false)
        , _needShowStateChangeRequest(false)
        , _isShow(false)
-       , _isVisibilityChangeInProgress(false)
        , _needAsyncVisibilityChangeRequest(true)
        , _isMainType(true)
        , _needRender(true)
+       , _pOnWindowDamagedHandler(null)
+       , _pOnWindowConfiguredHandler(null)
+       , _pOnWindowHideHandler(null)
+       , _pOnWindowShowHandler(null)
        , __isWinObject(true)
+       , __bounds()
 {
        _countOfLayer++;
 }
 
 _EflLayer::_EflLayer(bool isMainType)
-       : _pEvas(null)
+       : _pRootVisualElement(null)
+       , _pEvas(null)
        , _pEcoreEvas(null)
        , _pWindow(null)
-       , _pOnWindowDamagedHandler(null)
-       , _pOnWindowConfiguredHandler(null)
-       , _pOnWindowHideHandler(null)
-       , _pOnWindowShowHandler(null)
-       , _needEvasRender(0)
+       , _needBoundsChangeRequest(false)
        , _needShowStateChangeRequest(false)
        , _isShow(false)
-       , _isVisibilityChangeInProgress(false)
        , _needAsyncVisibilityChangeRequest(true)
        , _isMainType(isMainType)
        , _needRender(true)
+       , _pOnWindowDamagedHandler(null)
+       , _pOnWindowConfiguredHandler(null)
+       , _pOnWindowHideHandler(null)
+       , _pOnWindowShowHandler(null)
        , __isWinObject(true)
+       , __bounds()
 {
        _countOfLayer++;
 }
@@ -314,7 +303,8 @@ _EflLayer::~_EflLayer(void)
                __pOnIdleLoopIterator = null;
 
        }
-#ifdef _NEED_DAMAGE_HANDER_
+
+#ifdef USE_WORKAROUND
        if (_pOnWindowDamagedHandler)
        {
                ecore_event_handler_del(_pOnWindowDamagedHandler);
@@ -337,7 +327,7 @@ _EflLayer::~_EflLayer(void)
                ecore_event_handler_del(_pOnWindowShowHandler);
                _pOnWindowShowHandler = null;
        }
-#endif
+#endif // USE_WORKAROUND
 
 #endif
 
@@ -371,10 +361,12 @@ _EflLayer::OnConstructed(void)
        if(_isMainType)
        {
                _pWindow = elm_win_add(NULL, NULL, ELM_WIN_BASIC);
+               PRINT("[%#x] CREATE WINDOW [MAIN TYPE]\n", (unsigned int)this);
        }
        else
        {
                _pWindow = elm_win_add(NULL, NULL, ELM_WIN_UTILITY);
+               PRINT("[%#x] CREATE WINDOW [UTIL TYPE]\n", (unsigned int)this);
        }
 
        SysTryReturnResult(NID_UI, _pWindow, E_SYSTEM, "A system error has been occurred.");
@@ -421,7 +413,8 @@ _EflLayer::Initialize(Evas_Object* pWindow)
        }
 
 // CHECK ME: Is this needed for GL mode?
-#ifdef _NEED_DAMAGE_HANDER_
+
+#ifdef USE_WORKAROUND
        if(_pOnWindowDamagedHandler == null)
        {
                _pOnWindowDamagedHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, OnXWindowDamaged, this);
@@ -441,8 +434,9 @@ _EflLayer::Initialize(Evas_Object* pWindow)
        {
                _pOnWindowShowHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnXWindowShown, this);
        }
+       evas_event_callback_add(_pEvas, EVAS_CALLBACK_RENDER_FLUSH_POST, OnRenderFlushPost, (void*)this);
+#endif // USE_WORKAROUND
 
-#endif
 
 #ifdef VE_VSYNC_UPDATE
        if(__pOnIdleLoopIterator == null)
@@ -484,11 +478,15 @@ _EflLayer::Configure(_RootVisualElement& rootElement)
 result
 _EflLayer::SetBounds(const FloatRectangle& bounds)
 {
-       if (_pWindow)
-       {
-               evas_object_move(_pWindow, bounds.x, bounds.y);
-               evas_object_resize(_pWindow, bounds.width, bounds.height);
-       }
+       if (__bounds == bounds)
+               return E_SUCCESS;
+
+       __bounds = bounds;
+       evas_object_move(_pWindow, __bounds.x, __bounds.y);
+       evas_object_resize(_pWindow, __bounds.width, __bounds.height);
+       PRINT("[%#x] Initialzing evas_object_move(%f, %f) \n", (unsigned int)this, __bounds.x, __bounds.y);
+       PRINT("[%#x] Initialzing evas_object_resize(%f, %f) \n", (unsigned int)this, __bounds.width, __bounds.height);
+
        return E_SUCCESS;
 }
 
@@ -497,19 +495,7 @@ _EflLayer::GetBounds(void) const
 {
        if (_pWindow)
        {
-               int x = 0;
-               int y = 0;
-               int w = 0;
-               int h = 0;
-
-               evas_object_geometry_get(_pWindow, null, null, &w, &h);
-
-               if (__isWinObject == true)
-               {
-                       elm_win_screen_position_get(_pWindow, &x, &y);
-               }
-
-               return FloatRectangle(x, y, w, h);
+               return __bounds;
        }
 
        return FloatRectangle();
@@ -518,7 +504,6 @@ _EflLayer::GetBounds(void) const
 result
 _EflLayer::SetShowState(bool show)
 {
-#ifdef ECORE_EVAS_ASYNC_VISIBILITY_BUG_HACK
        if (_isShow == show)
        {
                return E_SUCCESS;
@@ -528,29 +513,21 @@ _EflLayer::SetShowState(bool show)
        {
                // Show State is not applied yet. Need cancel the visibility change request.
                _needShowStateChangeRequest = false;
-               PRINT("Cancel SetShowState request (%d)\n", show);
+               PRINT("[%#x] Cancel SetShowState request (%d)\n", (unsigned int)this, show);
        }
        else
        {
                _needShowStateChangeRequest = true;
-               _DisplayManager::GetInstance()->AddWakeUpEvent();
-               PRINT("SetShowState request (%d)\n", show);
-       }
 
-       _isShow = show;
-#else
-       if (_pWindow)
-       {
-               if (show)
+               _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+               if (pDisplayManager)
                {
-                       evas_object_show(_pWindow);
-               }
-               else
-               {
-                       evas_object_hide(_pWindow);
+                       pDisplayManager->AddWakeUpEvent();
                }
+               PRINT("[%#x] SetShowState request (%d)\n", (unsigned int)this, show);
        }
-#endif
+
+       _isShow = show;
 
        return E_SUCCESS;
 }
@@ -571,14 +548,13 @@ _EflLayer::SetOpacity(float opacity)
        {
                opacity = 1.0f;
        }
-       else if(opacity<0.0f)
+       else if(opacity < 0.0f)
        {
                opacity = 0.0f;
        }
 
        if (_FloatCompare(opacity, 1.0f))
        {
-//             ecore_evas_alpha_set(_pEcoreEvas, EINA_FALSE);
                if (__isWinObject == true)
                {
                        elm_win_alpha_set(_pWindow, EINA_FALSE);
@@ -591,8 +567,6 @@ _EflLayer::SetOpacity(float opacity)
        }
        else if (opacity < 1.0f)
        {
-
-//             ecore_evas_alpha_set(_pEcoreEvas, EINA_TRUE);
                if (__isWinObject == true)
                {
                        elm_win_alpha_set(_pWindow, EINA_TRUE);
@@ -603,18 +577,23 @@ _EflLayer::SetOpacity(float opacity)
                a = opacity*255;
                evas_object_color_set(_pWindow, r, g, b, a);
        }
+       PRINT("[%#x] ALPHA SET(opacity=%f)\n", (unsigned int)this, opacity);
 }
 
 float
 _EflLayer::GetOpacity(void)
 {
        if (!_pWindow)
-                       return 0.0f;
+       {
+               return 0.0f;
+       }
 
        int r,g,b,a;
        evas_object_color_get(_pWindow, &r, &g, &b, &a);
        if (a > 255)
+       {
                return 1.0f;
+       }
 
        return a / 255.0f;
 
@@ -625,70 +604,36 @@ _EflLayer::Flush(void)
 {
        if (_pEcoreEvas)
        {
-               PRINT("Flush StateChange(%p) - is Pending(%d) \n",this , _isVisibilityChangeInProgress);
-
-               if (_needShowStateChangeRequest && (!_needAsyncVisibilityChangeRequest || !_isVisibilityChangeInProgress))
+               if (_needShowStateChangeRequest)
                {
                        if (_isShow)
                        {
                                evas_object_show(_pWindow);
-
-                               // QUICK-DIRTY HACK TO BE REMOVED !!!
-#ifdef ECORE_EVAS_ASYNC_VISIBILITY_BUG_HACK
-                               ecore_x_sync();
-                               ecore_x_flush();
-                               usleep(30 * 1000);
-
-                               FloatRectangle bounds = GetBounds();
-                               evas_damage_rectangle_add(_pEvas, 0, 0, (int)bounds.width, (int)bounds.height);
-#endif
-
-                               PRINT("evas_object_show(%p) \n", this);
+                               PRINT("[%#x] evas_object_show \n", (unsigned int)this);
                        }
                        else
                        {
                                evas_object_hide(_pWindow);
-                               PRINT("evas_object_hide(%p) \n", this);
+                               PRINT("[%#x] evas_object_hide \n", (unsigned int)this);
                        }
-
-#ifdef _NEED_DAMAGE_HANDER_
-                       _isVisibilityChangeInProgress = true;
-#endif
                        _needShowStateChangeRequest = false;
                }
 
-               if (_needEvasRender > 0)
-               {
-                       _DisplayManager::GetInstance()->AddWakeUpEvent();
-                       _needEvasRender--;
-               }
                FloatRectangle rect = GetBounds();
                if(!_needRender)
                {
-                       PRINT("_needRender = false bounds(%f %f %f %f)\n", rect.x, rect.y, rect.width, rect.height);
+                       PRINT("[%#x] _needRender = false bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
                        return;
                }
 
-               PRINT("ecore_evas_manual_render bounds(%f %f %f %f)\n", rect.x, rect.y, rect.width, rect.height);
+               //PRINT("[%#x] ecore_evas_manual_render bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
 
                __needPreRender = false;
                ecore_evas_manual_render(_pEcoreEvas);
                __needPreRender = true;
        }
 
-#if 0
-       if (_pEvas)
-       {
-               if(show)
-               {
-                       evas_render_idle_flush(_pEvas);
-               }
-               else
-               {
-                       evas_render(_pEvas);
-               }
-       }
-#endif
+
 }
 
 
index 701a8a7..76a4552 100644 (file)
@@ -35,6 +35,8 @@
 #include <FGrpFloatRectangle.h>
 #include "FUiAnim_NativeLayer.h"
 
+//#define USE_WORKAROUND
+
 namespace Tizen { namespace Ui { namespace Animations
 {
 
@@ -57,6 +59,18 @@ public:
        void SetOpacity(float opacity);
        float GetOpacity(void);
 
+       result SetRotation(int angle);
+       result SetInternalBounds(void);
+
+       void SetOwner(_EflLayer* pOwner);
+
+       int GetRotation(void);
+
+       _RootVisualElement* GetRootVisualElement(void) const
+       {
+               return _pRootVisualElement;
+       }
+
        Evas* GetEvas(void) const
        {
                return _pEvas;
@@ -72,16 +86,6 @@ public:
                return _pWindow;
        }
 
-       void SetEvasRenderNeeded(void)
-       {
-               _needEvasRender = 1;
-       }
-
-       void SetVisibilityChangeCompleted(void)
-       {
-               _isVisibilityChangeInProgress = false;
-       }
-
        bool IsAsyncVisibilityChangeNeeded(void) const
        {
                return _needAsyncVisibilityChangeRequest;
@@ -106,25 +110,25 @@ protected:
        virtual result Configure(_RootVisualElement& rootElement);
 
 protected:
+       _RootVisualElement* _pRootVisualElement;
        Evas* _pEvas;
        Ecore_Evas* _pEcoreEvas;
        Evas_Object* _pWindow;
-       Ecore_Event_Handler* _pOnWindowDamagedHandler;
-       Ecore_Event_Handler* _pOnWindowConfiguredHandler;
-       Ecore_Event_Handler* _pOnWindowHideHandler;
-       Ecore_Event_Handler* _pOnWindowShowHandler;
-       int _needEvasRender;
+       bool _needBoundsChangeRequest;
        bool _needShowStateChangeRequest;
        bool _isShow;
-       bool _isVisibilityChangeInProgress;
        bool _needAsyncVisibilityChangeRequest;
        bool _isMainType;
        bool _needRender;
-
        static int _countOfLayer;
+       Ecore_Event_Handler* _pOnWindowDamagedHandler;
+       Ecore_Event_Handler* _pOnWindowConfiguredHandler;
+       Ecore_Event_Handler* _pOnWindowHideHandler;
+       Ecore_Event_Handler* _pOnWindowShowHandler;
 
 private:
        bool __isWinObject;
+       Tizen::Graphics::FloatRectangle __bounds;
 };
 
 }}} //namespace Tizen { namespace Ui { namespace Animations