for presentation update
authorDae Young Ryu <karzia@samsung.com>
Tue, 8 Oct 2013 12:55:53 +0000 (21:55 +0900)
committerDae Young Ryu <karzia@samsung.com>
Tue, 8 Oct 2013 12:55:53 +0000 (21:55 +0900)
Change-Id: I179a4970194eaf69ff08017fdcd461807e1e6bef
Signed-off-by: Dae Young Ryu <karzia@samsung.com>
src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp
src/ui/animations/FUiAnim_VisualElementImpl.cpp
src/ui/animations/FUiAnim_VisualElementSharedData.cpp

index 7587fed..9282f12 100644 (file)
@@ -3020,7 +3020,8 @@ _ControlAnimatorImpl::OnVisualElementAnimationFinished(const VisualElementAnimat
                                }
                        }
                        else if (pValueAnimation)
-                       {
+                       {  // WARNING:: what is this????
+                               //#warning "what is this ?? --> this is value animation , why does it change bounds?"
                                pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds());
                        }
                }
index 32320ff..80d52d8 100644 (file)
@@ -1224,7 +1224,7 @@ _VisualElementImpl::SetRenderOperationProperty(const Variant& v)
                //InvalidateHierarchyProps(HIERARCHY_PROPERTY_OPACITY, false, false);
                InvalidateHierarchyProps(UPDATED_PROP_RENDER_OPERATION, false, false);
 
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_RENDER_OPERATION);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_RENDER_OPERATION);
        }
 
        return E_SUCCESS;
@@ -1648,7 +1648,7 @@ _VisualElementImpl::SetSurfaceChanged(void)
        //InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
        InvalidateHierarchyProps(UPDATED_PROP_SURFACE, false, false);
 
-       GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_SURFACE);
+       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_SURFACE);
 
 }
 
@@ -1676,7 +1676,7 @@ _VisualElementImpl::SetContentBoundsI(const FloatRectangle& contentBounds)
        //InvalidateHierarchyProps(HIERARCHY_PROPERTY_CONTENTBOUNDS, false, false);
        InvalidateHierarchyProps(UPDATED_PROP_CONTENT_BOUNDS, false, false);
 
-       GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_BOUNDS);
+       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_BOUNDS);
 
        return E_SUCCESS;
 }
@@ -1917,7 +1917,7 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds)
        // observer
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_BOUNDS);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_BOUNDS);
 
 
                VE_DELEGATE(this, InvokeOnBoundsChanged, oldValue);
@@ -1928,6 +1928,10 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds)
                }
 
        }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_BOUNDS);
+       }
 
        return r;
 }
@@ -2033,7 +2037,11 @@ _VisualElementImpl::SetZPositionI(float zPosition)
                InvalidateHierarchyProps(UPDATED_PROP_Z_POSITION, true, false); // lazy evaluation: property changed flag
                if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
                {
-                       GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_Z_POSITION);
+                       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_Z_POSITION);
+               }
+               else if( IS_PRESENTATION(this))
+               {
+                       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_Z_POSITION);
                }
        }
        return E_SUCCESS;
@@ -2287,11 +2295,15 @@ _VisualElementImpl::SetShowOpacityI(float showOpacity)
        //Observer
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_SHOW_STATE);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_SHOW_STATE);
 
                InvokeOnShowStateChanged(oldShowState);
 
        }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_SHOW_STATE);
+       }
 
        return E_SUCCESS;
 }
@@ -2395,8 +2407,11 @@ _VisualElementImpl::SetContentOpacityI(float contentOpacity)
 
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_OPACITY);
+       }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_OPACITY);
        }
        return E_SUCCESS;
 }
@@ -2478,9 +2493,11 @@ _VisualElementImpl::SetOpacityI(float opacity)
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
 
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_OPACITY);
-
-
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_OPACITY);
+       }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_OPACITY);
        }
        return E_SUCCESS;
 }
@@ -2556,9 +2573,11 @@ _VisualElementImpl::SetAnchorI(const FloatPoint& anchor)
 
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR);
-
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_ANCHOR);
+       }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_ANCHOR);
        }
        return E_SUCCESS;
 }
@@ -2636,8 +2655,11 @@ _VisualElementImpl::SetAnchorZI(float anchorZ)
 
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR_Z);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_ANCHOR_Z);
+       }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_ANCHOR_Z);
        }
        return E_SUCCESS;
 }
@@ -2741,10 +2763,14 @@ _VisualElementImpl::SetTransformMatrixI(const FloatMatrix4& xform, bool updateDe
 
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_TRANSFORM);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_TRANSFORM);
 
                VE_DELEGATE(this, InvokeOnTransformMatrixChanged, oldValue);
        }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_TRANSFORM);
+       }
        return E_SUCCESS;
 }
 
@@ -3409,10 +3435,14 @@ _VisualElementImpl::SetChildrenTransformMatrixI(const FloatMatrix4& xform, bool
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
 
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CHILDREN_TRANSFORM);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CHILDREN_TRANSFORM);
 
                VE_DELEGATE(this, InvokeOnChildrenTransformMatrixChanged, oldValue);
        }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CHILDREN_TRANSFORM);
+       }
        return E_SUCCESS;
 }
 
@@ -4100,7 +4130,11 @@ _VisualElementImpl::SetClipChildrenProperty(const Variant& v)
 
        if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
        {
-               GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CLIP_CHILDREN);
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CLIP_CHILDREN);
+       }
+       else if( IS_PRESENTATION(this))
+       {
+               GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CLIP_CHILDREN);
        }
 
        return E_SUCCESS;
@@ -4173,7 +4207,11 @@ _VisualElementImpl::SetSurfaceOpaqueProperty(const Variant& v)
        {
                if(IS_NEEDED_UPDATE_RENDER_OBJECT(this))
                {
-                       GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
+                       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_OPACITY);
+               }
+               else if( IS_PRESENTATION(this))
+               {
+                       GetSharedData().toUpdatePropImmediately.Update(this,UPDATED_PROP_CONTENT_OPACITY);
                }
        }
 
index d67e08b..ed355b2 100644 (file)
@@ -491,15 +491,21 @@ _VisualElementSharedData::UpdatePropertiesForRender::GetProperty(const Base::Str
 
 
 void
-_VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags updateFlags)
+_VisualElementSharedData::UpdatePropertiesForRender::Update(_VisualElementImpl* pSource, PropertyFlags updateFlags)
 {
        _AnimationManager* pAnimationManager = _AnimationManager::GetInstance();
-       if(!__pSource || !pAnimationManager)
+       if(!pSource || !pAnimationManager)
                return;
+       bool isPresentation = false;
+
+       if(pSource->__pPresentation == pSource)
+       {
+               isPresentation = true;
+       }
 
        bool bImplicitAnimation = false;
 
-       if(__pSource->__isImplicitAnimationEnabled && IS_ATTACHED(__pSource) && pAnimationManager->IsImplicitAnimationEnabled())
+       if(!isPresentation && pSource->__isImplicitAnimationEnabled && IS_ATTACHED(pSource) && pAnimationManager->IsImplicitAnimationEnabled())
        {
                bImplicitAnimation = true;
        }
@@ -509,12 +515,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
        case _VisualElementImpl::UPDATED_PROP_BOUNDS:
        {
                static const String* subProperties[] = {        pVeSubPropBoundsSize, pVeSubPropBoundsPosition, NULL };
-               if(__pSource->CreateImplicitAnimation(*pVePropBounds, __pSource->__bounds, subProperties, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropBounds, pSource->__bounds, subProperties, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __bounds = __pSource->__bounds;
+                       __bounds = pSource->__bounds;
                }
                else
                {
@@ -525,12 +531,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                break;
        case _VisualElementImpl::UPDATED_PROP_Z_POSITION:
 
-               if(__pSource->CreateImplicitAnimation(*pVePropZPosition, __pSource->__zPosition, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropZPosition, pSource->__zPosition, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __zPosition = __pSource->__zPosition;
+                       __zPosition = pSource->__zPosition;
                }
                else
                {
@@ -540,12 +546,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
 
        case _VisualElementImpl::UPDATED_PROP_ANCHOR:
 
-               if(__pSource->CreateImplicitAnimation(*pVePropAnchor, __pSource->__anchor, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropAnchor, pSource->__anchor, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __anchor = __pSource->__anchor;
+                       __anchor = pSource->__anchor;
                }
                else
                {
@@ -554,12 +560,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                break;
        case _VisualElementImpl::UPDATED_PROP_ANCHOR_Z:
 
-               if(__pSource->CreateImplicitAnimation(*pVePropAnchorZ, __pSource->__anchorZ, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropAnchorZ, pSource->__anchorZ, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __anchorZ = __pSource->__anchorZ;
+                       __anchorZ = pSource->__anchorZ;
                }
                else
                {
@@ -585,13 +591,13 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                                pVeSubPropTransformScaleAnchorY,
                                pVeSubPropTransformScaleAnchorZ,
                                NULL};
-               if(__pSource->CreateImplicitAnimation(*pVePropTransform, __pSource->__transform, subProperties, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropTransform, pSource->__transform, subProperties, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __transform = __pSource->__transform;
-                       __decomposedTransform = __pSource->__decomposedTransform;
+                       __transform = pSource->__transform;
+                       __decomposedTransform = pSource->__decomposedTransform;
                }
                else
                {
@@ -619,13 +625,13 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                                        pVeSubPropChildrenTransformScaleAnchorZ,
                                        NULL};
 
-                       if(__pSource->CreateImplicitAnimation(*pVePropChildrenTransform, __pSource->__childrenTransform, subProperties, bImplicitAnimation ) == false)
+                       if(isPresentation || pSource->CreateImplicitAnimation(*pVePropChildrenTransform, pSource->__childrenTransform, subProperties, bImplicitAnimation ) == false)
                        {
                                __implicitAnimation &= ~updateFlags;
                                __updatedProperties |= updateFlags;
 
-                               __childrenTransform = __pSource->__childrenTransform;
-                               __decomposedChildrenTransform = __pSource->__decomposedChildrenTransform;
+                               __childrenTransform = pSource->__childrenTransform;
+                               __decomposedChildrenTransform = pSource->__decomposedChildrenTransform;
                        }
                        else
                        {
@@ -635,7 +641,7 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                }
                break;
        case _VisualElementImpl::UPDATED_PROP_CLIP_CHILDREN:
-               __isClipChildren = __pSource->__isClipChildren;
+               __isClipChildren = pSource->__isClipChildren;
                __implicitAnimation &= ~updateFlags;
                __updatedProperties |= updateFlags;
                break;
@@ -647,18 +653,18 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                break;
 
        case _VisualElementImpl::UPDATED_PROP_RENDER_OPERATION:
-               __renderOperation = __pSource->__renderOperation;
+               __renderOperation = pSource->__renderOperation;
                __implicitAnimation &= ~updateFlags;
                __updatedProperties |= updateFlags;
 
                break;
        case _VisualElementImpl::UPDATED_PROP_SHOW_STATE:
-               if(__pSource->CreateImplicitAnimationForShowState(__pSource->__showOpacity, 0.0f, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimationForShowState(pSource->__showOpacity, 0.0f, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __showOpacity = __pSource->__showOpacity;
+                       __showOpacity = pSource->__showOpacity;
                }
                else
                {
@@ -667,12 +673,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                break;
        case _VisualElementImpl::UPDATED_PROP_OPACITY:
 
-               if(__pSource->CreateImplicitAnimation(*pVePropOpacity, __pSource->__opacity, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropOpacity, pSource->__opacity, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __opacity = __pSource->__opacity;
+                       __opacity = pSource->__opacity;
                }
                else
                {
@@ -681,12 +687,12 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                break;
 
        case _VisualElementImpl::UPDATED_PROP_CONTENT_OPACITY:
-               if(__pSource->CreateImplicitAnimation(*pVePropContentOpacity, __pSource->__contentOpacity, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropContentOpacity, pSource->__contentOpacity, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __contentOpacity = __pSource->__contentOpacity;
+                       __contentOpacity = pSource->__contentOpacity;
                }
                else
                {
@@ -694,21 +700,21 @@ _VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags update
                }
                break;
        case _VisualElementImpl::UPDATED_PROP_SURFACE_OPAQUE:
-               if(__pSource->__pSharedData)
+               if(isPresentation || pSource->__pSharedData)
                {
-                       isSurfaceOpaque = __pSource->__pSharedData->isSurfaceOpaque;
+                       isSurfaceOpaque = pSource->__pSharedData->isSurfaceOpaque;
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
                }
                break;
 
        case _VisualElementImpl::UPDATED_PROP_CONTENT_BOUNDS:
-               if(__pSource->CreateImplicitAnimation(*pVePropContentBounds, __pSource->__contentBounds, NULL, bImplicitAnimation ) == false)
+               if(isPresentation || pSource->CreateImplicitAnimation(*pVePropContentBounds, pSource->__contentBounds, NULL, bImplicitAnimation ) == false)
                {
                        __implicitAnimation &= ~updateFlags;
                        __updatedProperties |= updateFlags;
 
-                       __contentBounds = __pSource->__contentBounds;
+                       __contentBounds = pSource->__contentBounds;
                }
                else
                {