fixed bug: showstate implicit animation and rendering logic
authorDae Young Ryu <karzia@samsung.com>
Tue, 3 Dec 2013 08:40:33 +0000 (17:40 +0900)
committerDae Young Ryu <karzia@samsung.com>
Tue, 3 Dec 2013 08:40:33 +0000 (17:40 +0900)
Change-Id: I505771189fcd17fab585c6de06b574c2299d1ae8
Signed-off-by: Dae Young Ryu <karzia@samsung.com>
inc/FUiAnimVisualElementAnimation.h
src/ui/animations/FUiAnim_GlRenderManager.cpp
src/ui/animations/FUiAnim_VisualElementImpl.cpp
src/ui/inc/FUiAnim_RootVisualElement.h

index a715549..9f21998 100644 (file)
@@ -202,7 +202,7 @@ public:
        /**
         * Gets the IObjectAnimationStatusEventListener listener.
         *
-        * @since       2.0
+        * @since       3.0
         *
         * @return              A pointer to the IObjectAnimationStatusEventListener instance @n
         *                              If listener has not been set, @c null is returned.
index 17548b9..b91ab30 100644 (file)
@@ -1186,19 +1186,24 @@ _GlRenderManager::CompositeView(_GlLayer* pLayer, _RootVisualElement* pRoot, _Vi
 #ifdef VE_USE_GL_MULTI_CONTEXT
        __pGlContext = (_GlContext*)pLayer->GetContext();
        __pGlContext->MakeCurrent();
-       __needClear = true;
 #else
-       __pGlContext->MakeCurrent(pLayer->GetNativeSurface());
-
-//     VisualElementSurface* pSurface = pView->GetRenderTarget();
-//     if(pSurface)
-//     {
-//             _VisualElementSurfaceImpl* pSurfaceImpl = _VisualElementSurfaceImpl::GetInstance(*pSurface);
-//             __pGlContext->MakeCurrent(pSurfaceImpl->GetNativeHandle());
-//             __needClear = true;
-//     }
+
+       VisualElementSurface* pSurface = pView->GetRenderTarget();
+       if(pSurface)
+       {
+               // TODO: Should be implement Offline rendering ....
+               _VisualElementSurfaceImpl* pSurfaceImpl = _VisualElementSurfaceImpl::GetInstance(*pSurface);
+               __pGlContext->MakeCurrent(pSurfaceImpl->GetNativeHandle());
+               __needClear = true;
+       }
+       else
+       {
+               __pGlContext->MakeCurrent(pLayer->GetNativeSurface());
+
+       }
 #endif
 
+
        Tizen::Graphics::FloatRectangle* pViewport = pView->GetViewport();
        if(pViewport)
        {
@@ -1256,16 +1261,13 @@ _GlRenderManager::CompositeLayer(_GlLayer* pLayer)
        bool isUpdated = false;
 
        isUpdated = pLayer->UpdateNativeNodes();
+
+       __needClear = true;
        //      if (isUpdated)
        {
-
-               Tizen::Base::Collection::ArrayList clearColorArray;
-
-               clearColorArray.Construct();
-
                int count  = pLayer->GetSceneCount();
 
-               for ( int i = 0 ; i<count ; i++)
+               for ( int i = 0 ; i<count ; i++ )
                {
                        SceneVisualElement* pScene = pLayer->GetScene(i);
 
@@ -1274,13 +1276,13 @@ _GlRenderManager::CompositeLayer(_GlLayer* pLayer)
                                _RootVisualElement* pRoot = _SceneVisualElementImpl::GetInstance(*pScene);
                                _View* pView = pRoot->GetView();
 
-                               if(pView)
+                               if (pView)
                                {
                                        CompositeView(pLayer, pRoot, pView);
 
                                        // Todo: render sub view
                                        int count = pView->GetSubViewCount();
-                                       for(int i = 0 ;i <count; i++)
+                                       for ( int i = 0 ;i <count; i++ )
                                        {
                                                _View* pSubView = pView->GetSubView(i);
                                                if(pSubView)
@@ -1291,6 +1293,11 @@ _GlRenderManager::CompositeLayer(_GlLayer* pLayer)
                                }
                        }
                }
+#ifdef VE_USE_GL_MULTI_CONTEXT
+               __pGlContext->MakeCurrent();
+#else
+               __pGlContext->MakeCurrent(pLayer->GetNativeSurface());
+#endif
                __pGlContext->SwapBuffers();
        }
 }
index db48d0d..f49379a 100644 (file)
@@ -521,7 +521,9 @@ _VisualElementImpl::CreateImplicitAnimationForShowState(float newState, float cu
 //    bool bImplicitAnimation = GET_IMPLICIT_FLAGS(UPDATED_PROP_SHOW_STATE);
 
 
-       if (unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled))
+       if (likely(GetRoot())
+               && likely(GetSharedData().needSurface)
+               && unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled))
     {
         // WARNING:
                 //     For performance, following must be done only when oldValue != newValue.
index 9d2131e..6032d2e 100644 (file)
@@ -74,7 +74,6 @@ public:
                return __pLayer;
        }
 
-
        bool DrawModelTree(void);
        bool UpdateRenderObjectTree(void);
        bool SyncPresentationTree(void);
@@ -121,6 +120,7 @@ private:
        bool __isSyncedPresentation;// render object use this
        bool __isModel;
        _NativeLayer* __pLayer;
+
        _View* __pView;
 
 };             // _RootVisualElement