#define PRINT(...)
//#define PRINT fprintf(stderr, __VA_ARGS__)
-#define PRINT(...)
+
#define IS_KNOWN_CLASS(_PUBLIC) (likely(typeid(*(_PUBLIC)) == VeTypeId) || likely(typeid(*(_PUBLIC)) == internalVeTypeId) || likely(typeid(*(_PUBLIC)) == controlVeTypeId) || likely(typeid(*(_PUBLIC)) == rootVeTypeId))
#define IS_INTERNAL_CLASS(_IMPL) (likely((_IMPL)->__isInternal))
IMPLEMENT_PROPERTY(_VisualElementImpl);
-_VisualElementImpl::UpdatePropertiesForRender::UpdatePropertiesForRender(_VisualElementImpl* pSource)
- : __pSource(pSource)
- , __updatedProperties(0)
- , __implicitAnimation(0)
- , __bounds()
- , __renderOperation(false)
- , __contentBounds()
- , __contentOpacity(0)
- , __showOpacity(0)
- , __opacity(0)
- ,__anchor()
- ,__anchorZ(0)
- ,__transform()
- ,__decomposedTransform()
- ,__childrenTransform()
- ,__decomposedChildrenTransform()
- ,__zPosition(0)
- ,__isClipChildren(false)
- ,isSurfaceOpaque(false)
-{
-
-}
-
-_VisualElementImpl::UpdatePropertiesForRender::~UpdatePropertiesForRender()
-{
-__updatedProperties = 0;
-__implicitAnimation = 0;
-}
-
-void
-_VisualElementImpl::UpdatePropertiesForRender::Clear()
-{
- __updatedProperties = 0;
- __implicitAnimation = 0;
-}
-
-Variant
-_VisualElementImpl::UpdatePropertiesForRender::GetProperty(const Base::String& name) const
-{
-
- // need optimizing
- if(name.CompareTo(*pVePropBounds) == 0
- && __updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
- {
- return Variant(__bounds);
- }
- else if(name.CompareTo(*pVeSubPropBoundsPosition) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
- {
- return Variant(__bounds.GetTopLeft());
- }
- else if(name.CompareTo(*pVeSubPropBoundsSize) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
- {
- return Variant(FloatDimension(__bounds.width, __bounds.height));
- }
- else if(name.CompareTo(*pVePropRenderOperation) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_RENDER_OPERATION)
- {
- return Variant(static_cast< int >(__renderOperation));
- }
- else if(name.CompareTo(*pVePropContentBounds) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CONTENT_BOUNDS)
- {
- return Variant(__contentBounds);
- }
- else if(name.CompareTo(*pVePropContentOpacity) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CONTENT_OPACITY)
- {
- return Variant(__contentOpacity);
- }
-
- else if(name.CompareTo(*pVePropOpacity) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_OPACITY)
- {
- return Variant(__opacity);
- }
- else if(name.CompareTo(*pVePropShowState) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SHOW_STATE)
- {
- return Variant(VE_VISIBLE(this));
-
- }
- else if(name.CompareTo(*pVePropAnchor) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_ANCHOR)
- {
- return Variant(__anchor);
- }
- else if(name.CompareTo(*pVePropAnchorZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_ANCHOR_Z)
- {
- return Variant(__anchorZ);
- }
- else if(name.CompareTo(*pVePropTransform) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- return Variant(__transform);
- }
-
- else if(name.CompareTo(*pVeSubPropTransformRotationX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleX);
- }
- else if(name.CompareTo(*pVeSubPropTransformRotationY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleY);
- }
- else if(name.CompareTo(*pVeSubPropTransformRotationZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleZ);
- }
- else if(name.CompareTo(*pVeSubPropTransformRotationAnchorXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float anchorX = 0.0f;
- float anchorY = 0.0f;
- float anchorZ = 0.0f;
- __decomposedTransform.GetRotationAnchor(anchorX, anchorY, anchorZ);
-
- return Variant(FloatPoint(anchorX, anchorY));
-
- }
- else if(name.CompareTo(*pVeSubPropTransformRotationXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(FloatPoint(angleX, angleY));
- }
- else if(name.CompareTo(*pVeSubPropTransformScaleX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleX);
- }
- else if(name.CompareTo(*pVeSubPropTransformScaleY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleY);
- }
- else if(name.CompareTo(*pVeSubPropTransformScaleZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleZ);
- }
- else if(name.CompareTo(*pVeSubPropTransformScaleAnchorXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float anchorX = 0.0f;
- float anchorY = 0.0f;
- float anchorZ = 0.0f;
- __decomposedTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
-
- return Variant(FloatPoint(anchorX, anchorY));
- }
- else if(name.CompareTo(*pVeSubPropTransformTranslationX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateX);
- }
- else if(name.CompareTo(*pVeSubPropTransformScaleXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(FloatPoint(scaleX, scaleY));
- }
- else if(name.CompareTo(*pVeSubPropTransformTranslationY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateY);
- }
- else if(name.CompareTo(*pVeSubPropTransformTranslationZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateZ);
- }
-
- else if(name.CompareTo(*pVeSubPropTransformTranslationXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(FloatPoint(translateX, translateY));
- }
- else if(name.CompareTo(*pVePropChildrenTransform) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- return Variant(__childrenTransform);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformRotationX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleX);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformRotationY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleY);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformRotationZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(angleZ);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformRotationAnchorXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float anchorX = 0.0f;
- float anchorY = 0.0f;
- float anchorZ = 0.0f;
- __decomposedChildrenTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
-
- return Variant(FloatPoint(anchorX, anchorY));
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformRotationXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float angleX = 0.0f;
- float angleY = 0.0f;
- float angleZ = 0.0f;
- __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
-
- return Variant(FloatPoint(angleX, angleY));
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleX);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleY);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleZ);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleX);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleY);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(scaleZ);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleAnchorXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float anchorX = 0.0f;
- float anchorY = 0.0f;
- float anchorZ = 0.0f;
- __decomposedChildrenTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
-
- return Variant(FloatPoint(anchorX, anchorY));
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformScaleXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float scaleX = 1.0f;
- float scaleY = 1.0f;
- float scaleZ = 1.0f;
- __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
-
- return Variant(FloatPoint(scaleX, scaleY));
-
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationX) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateX);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateY);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationZ) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(translateZ);
- }
- else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationXY) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
- {
- float translateX = 0.0f;
- float translateY = 0.0f;
- float translateZ = 0.0f;
- __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
-
- return Variant(FloatPoint(translateX, translateY));
- }
- else if(name.CompareTo(*pVePropZPosition) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_Z_POSITION)
- {
- return Variant(__zPosition);
- }
- else if(name.CompareTo(*pVePropClipChildren) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CLIP_CHILDREN)
- {
- return Variant(__isClipChildren);
- }
- else if(name.CompareTo(*pVePropSurfaceOpaque) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SURFACE_OPAQUE)
- {
- // need to check
- return Variant(isSurfaceOpaque);
- }
- else if(name.CompareTo(*pVePrivPropShowOpacity) == 0
- &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SHOW_STATE)
- {
- return Variant(__showOpacity);
- }
-
- return __pSource->__pRenderObject->GetProperty(name);
-}
-
-void
-_VisualElementImpl::UpdatePropertiesForRender::Update(PropertyFlags updateFlags)
-{
- _AnimationManager* pAnimationManager = _AnimationManager::GetInstance();
- if(!__pSource || !pAnimationManager)
- return;
-
- bool bImplicitAnimation = false;
-
- if(__pSource->__isImplicitAnimationEnabled && IS_ATTACHED(__pSource) && pAnimationManager->IsImplicitAnimationEnabled())
- {
- bImplicitAnimation = true;
- }
-
- switch(updateFlags)
- {
- case _VisualElementImpl::UPDATED_PROP_BOUNDS:
- {
- static const String* subProperties[] = { pVeSubPropBoundsSize, pVeSubPropBoundsPosition, NULL };
- if(__pSource->CreateImplicitAnimation(*pVePropBounds, __pSource->__bounds, subProperties, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __bounds = __pSource->__bounds;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- }
-
- break;
- case _VisualElementImpl::UPDATED_PROP_Z_POSITION:
-
- if(__pSource->CreateImplicitAnimation(*pVePropZPosition, __pSource->__zPosition, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __zPosition = __pSource->__zPosition;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
-
- case _VisualElementImpl::UPDATED_PROP_ANCHOR:
-
- if(__pSource->CreateImplicitAnimation(*pVePropAnchor, __pSource->__anchor, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __anchor = __pSource->__anchor;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_ANCHOR_Z:
-
- if(__pSource->CreateImplicitAnimation(*pVePropAnchorZ, __pSource->__anchorZ, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __anchorZ = __pSource->__anchorZ;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_TRANSFORM:
- {
- static const String* subProperties[] = {
- pVeSubPropTransformRotationX,
- pVeSubPropTransformRotationY,
- pVeSubPropTransformRotationZ,
- pVeSubPropTransformScaleX,
- pVeSubPropTransformScaleY,
- pVeSubPropTransformScaleZ,
- pVeSubPropTransformTranslationX,
- pVeSubPropTransformTranslationY,
- pVeSubPropTransformTranslationZ,
- pVeSubPropTransformRotationAnchorX,
- pVeSubPropTransformRotationAnchorY,
- pVeSubPropTransformRotationAnchorZ,
- pVeSubPropTransformScaleAnchorX,
- pVeSubPropTransformScaleAnchorY,
- pVeSubPropTransformScaleAnchorZ,
- NULL};
- if(__pSource->CreateImplicitAnimation(*pVePropTransform, __pSource->__transform, subProperties, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __transform = __pSource->__transform;
- __decomposedTransform = __pSource->__decomposedTransform;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM:
- {
- static const String* subProperties[] = {
- pVeSubPropChildrenTransformRotationX,
- pVeSubPropChildrenTransformRotationY,
- pVeSubPropChildrenTransformRotationZ,
- pVeSubPropChildrenTransformScaleX,
- pVeSubPropChildrenTransformScaleY,
- pVeSubPropChildrenTransformScaleZ,
- pVeSubPropChildrenTransformTranslationX,
- pVeSubPropChildrenTransformTranslationY,
- pVeSubPropChildrenTransformTranslationZ,
- pVeSubPropChildrenTransformRotationAnchorX,
- pVeSubPropChildrenTransformRotationAnchorY,
- pVeSubPropChildrenTransformRotationAnchorZ,
- pVeSubPropChildrenTransformScaleAnchorX,
- pVeSubPropChildrenTransformScaleAnchorY,
- pVeSubPropChildrenTransformScaleAnchorZ,
- NULL};
-
- if(__pSource->CreateImplicitAnimation(*pVePropChildrenTransform, __pSource->__childrenTransform, subProperties, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __childrenTransform = __pSource->__childrenTransform;
- __decomposedChildrenTransform = __pSource->__decomposedChildrenTransform;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
-
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_CLIP_CHILDREN:
- __isClipChildren = __pSource->__isClipChildren;
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
- break;
-
- case _VisualElementImpl::UPDATED_PROP_CHANGE_ZORDER:
-
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
- break;
-
- case _VisualElementImpl::UPDATED_PROP_RENDER_OPERATION:
- __renderOperation = __pSource->__renderOperation;
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- break;
- case _VisualElementImpl::UPDATED_PROP_SHOW_STATE:
- if(__pSource->CreateImplicitAnimationForShowState(__pSource->__showOpacity, 0.0f, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __showOpacity = __pSource->__showOpacity;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_OPACITY:
-
- if(__pSource->CreateImplicitAnimation(*pVePropOpacity, __pSource->__opacity, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __opacity = __pSource->__opacity;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
-
- case _VisualElementImpl::UPDATED_PROP_CONTENT_OPACITY:
- if(__pSource->CreateImplicitAnimation(*pVePropContentOpacity, __pSource->__contentOpacity, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __contentOpacity = __pSource->__contentOpacity;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
- case _VisualElementImpl::UPDATED_PROP_SURFACE_OPAQUE:
- if(__pSource->__pSharedData)
- {
- isSurfaceOpaque = __pSource->__pSharedData->isSurfaceOpaque;
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
- }
- break;
-
- case _VisualElementImpl::UPDATED_PROP_CONTENT_BOUNDS:
- if(__pSource->CreateImplicitAnimation(*pVePropContentBounds, __pSource->__contentBounds, NULL, bImplicitAnimation ) == false)
- {
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
-
- __contentBounds = __pSource->__contentBounds;
- }
- else
- {
- __implicitAnimation |= updateFlags;
- }
- break;
-
- case _VisualElementImpl::UPDATED_PROP_CONTENT:
-
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
- break;
- case _VisualElementImpl::UPDATED_PROP_SURFACE:
-
- __implicitAnimation &= ~updateFlags;
- __updatedProperties |= updateFlags;
- break;
- default:
- //error
- PRINT("Undefined property(0x%x)\n", updateFlags);
- break;
- }
-}
-
_VisualElementImpl::_VisualElementImpl(VisualElement& element)
: _zOrderGroup(Z_ORDER_GROUP_NORMAL)
, __childrenNeedsUpdateProps(UPDATED_PROP_MASK & ~(UPDATED_PROP_CONTENT_MASK|UPDATED_PROP_CHANGE_ZORDER))
, __invalidatedProps(UPDATED_PROP_MASK & ~(UPDATED_PROP_CONTENT_MASK|UPDATED_PROP_CHANGE_ZORDER))
// , __updatedProperties(0)
- , __toUpdatePropImmediately(this)
+// , __toUpdatePropImmediately(this)
, __matrixFromTopValid(false)
, __matrixFromTopInvertible(true)
, __matrixToSuperValid(false)
, __childrenNeedsUpdateProps(UPDATED_PROP_MASK & ~(UPDATED_PROP_CONTENT_MASK|UPDATED_PROP_CHANGE_ZORDER))
, __invalidatedProps(UPDATED_PROP_MASK & ~(UPDATED_PROP_CONTENT_MASK|UPDATED_PROP_CHANGE_ZORDER))
// , __updatedProperties(modelImpl.__updatedProperties)
- , __toUpdatePropImmediately(null)
+// , __toUpdatePropImmediately(null)
, __matrixFromTopValid(false)
, __matrixFromTopInvertible(true)
, __matrixToSuperValid(false)
result
_VisualElementImpl::UpdateRender(void)
{
- if(!IS_MODEL(this))
+ if (!IS_MODEL(this))
{
return E_INVALID_OPERATION;
}
- if(!__pRenderObject)
+ if (!__pRenderObject)
{
return E_OBJ_NOT_FOUND;
}
+
+ if (!__pSharedData)
+ return E_INVALID_STATE;
+
// if(__updatedProperties != 0)
- if(__toUpdatePropImmediately.__updatedProperties != 0)
+ if (__pSharedData->toUpdatePropImmediately.__updatedProperties != 0)
{
-//#define GET_CURRENT_VAL(_FLAG,__DATA) ((__toUpdatePropImmediately.__updatedProperties & (_FLAG)) != 0)? __toUpdatePropImmediately.__DATA : __pRenderObject->__DATA
-#define GET_CURRENT_VAL(_FLAG,__DATA) __toUpdatePropImmediately.__DATA
-#define GET_IMPLICIT_FLAGS(_FLAG) ((__toUpdatePropImmediately.__implicitAnimation & (_FLAG)) != 0)? true : false
+//#define GET_CURRENT_VAL(_FLAG,__DATA) ((__pSharedData->__toUpdatePropImmediately.__updatedProperties & (_FLAG)) != 0)? __pSharedData->__toUpdatePropImmediately.__DATA : __pRenderObject->__DATA
+#define GET_CURRENT_VAL(_FLAG,__DATA) __pSharedData->toUpdatePropImmediately.__DATA
+#define GET_IMPLICIT_FLAGS(_FLAG) ((__pSharedData->toUpdatePropImmediately.__implicitAnimation & (_FLAG)) != 0)? true : false
RENDER_LOCK();
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_BOUNDS)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_BOUNDS)
{
FloatRectangle currentValue = GET_CURRENT_VAL(UPDATED_PROP_BOUNDS, __bounds);
__pRenderObject->SetBoundsProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_RENDER_OPERATION)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_RENDER_OPERATION)
{
__pRenderObject->SetRenderOperationProperty(__renderOperation);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CONTENT_BOUNDS)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CONTENT_BOUNDS)
{
FloatRectangle currentValue = GET_CURRENT_VAL(UPDATED_PROP_CONTENT_BOUNDS, __contentBounds);
__pRenderObject->SetContentBoundsProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CONTENT_OPACITY)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CONTENT_OPACITY)
{
float currentValue = GET_CURRENT_VAL(UPDATED_PROP_CONTENT_OPACITY, __contentOpacity);
__pRenderObject->SetContentOpacityProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SHOW_STATE)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SHOW_STATE)
{
float currentValue = GET_CURRENT_VAL(UPDATED_PROP_SHOW_STATE, __showOpacity);
__pRenderObject->SetShowStateProperty(SHOWOPACITY_VISIBLE(currentValue));
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_OPACITY)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_OPACITY)
{
float currentValue = GET_CURRENT_VAL(UPDATED_PROP_OPACITY, __opacity);
__pRenderObject->SetOpacityProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_ANCHOR)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_ANCHOR)
{
FloatPoint currentValue = GET_CURRENT_VAL(UPDATED_PROP_ANCHOR, __anchor);
__pRenderObject->SetAnchorProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_ANCHOR_Z)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_ANCHOR_Z)
{
float currentValue = GET_CURRENT_VAL(UPDATED_PROP_ANCHOR_Z, __anchorZ);
__pRenderObject->SetAnchorZProperty(currentValue);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_TRANSFORM)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_TRANSFORM)
{
FloatMatrix4 currentValue = GET_CURRENT_VAL(UPDATED_PROP_TRANSFORM, __decomposedTransform.GetTransformMatrix());
// bool bImplicitAnimation = GET_IMPLICIT_FLAGS(UPDATED_PROP_TRANSFORM);
// PRINT("UPDATED_PROP_TRANSFORM : implicit(%d) updated(%d)\n", bImplicitAnimation,
-// (__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_TRANSFORM)?1:0 );
+// (__pSharedData->__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_TRANSFORM)?1:0 );
- __pRenderObject->__decomposedTransform = __toUpdatePropImmediately.__decomposedTransform;
+ __pRenderObject->__decomposedTransform = __pSharedData->toUpdatePropImmediately.__decomposedTransform;
__pRenderObject->SetTransformMatrixProperty(currentValue);// 현재 값을 반영한 후에 new 값을 반영.
//__pRenderObject->SetTransformMatrixProperty(__transform);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CHILDREN_TRANSFORM)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CHILDREN_TRANSFORM)
{
FloatMatrix4 currentValue = GET_CURRENT_VAL(UPDATED_PROP_CHILDREN_TRANSFORM, __childrenTransform);
-// __pRenderObject->__decomposedChildrenTransform = __toUpdatePropImmediately.__decomposedChildrenTransform;
+// __pRenderObject->__decomposedChildrenTransform = __pSharedData->__toUpdatePropImmediately.__decomposedChildrenTransform;
__pRenderObject->SetChildrenTransformMatrixProperty(currentValue);// 현재 값을 반영한 후에 new 값을 반영.
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_Z_POSITION)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_Z_POSITION)
{
float currentValue = GET_CURRENT_VAL(UPDATED_PROP_Z_POSITION, __zPosition);
//bool bImplicitAnimation = GET_IMPLICIT_FLAGS(UPDATED_PROP_Z_POSITION);
__pRenderObject->SetZPositionProperty(currentValue);
//__pRenderObject->SetZPositionProperty(__zPosition);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CLIP_CHILDREN)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CLIP_CHILDREN)
{
__pRenderObject->SetClipChildrenProperty(__isClipChildren);
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SURFACE_OPAQUE)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SURFACE_OPAQUE)
{
__pRenderObject->SetSurfaceOpaqueProperty(GetSharedData().isSurfaceOpaque);
//TODO: isSurfaceOpaque should be changed into VE's member variable.
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SURFACE)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_SURFACE)
{
__pRenderObject->SetSurfaceChanged();
}
- if(__toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CHANGE_ZORDER)
+ if(__pSharedData->toUpdatePropImmediately.__updatedProperties & UPDATED_PROP_CHANGE_ZORDER)
{
if(__pParent)
{
}
// __updatedProperties = 0;
- __toUpdatePropImmediately.Clear();
+ __pSharedData->toUpdatePropImmediately.Clear();
int count = __children.GetCount();
for (int i = 0 ; i < count ; i++)
_VisualElementImpl::Construct(void)
{
result r = E_SUCCESS;
- __pSharedData = new (std::nothrow) _VisualElementSharedData;
+ __pSharedData = new (std::nothrow) _VisualElementSharedData(this);
SysTryCatch(NID_UI_ANIM, __pSharedData, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
SysTryCatch(NID_UI_ANIM, GetSharedData().Construct() == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] failed in shared data constructing.");
//karzia R01:
//InvalidateHierarchyProps(HIERARCHY_PROPERTY_OPACITY, false, false);
InvalidateHierarchyProps(UPDATED_PROP_RENDER_OPERATION, false, false);
-// __updatedProperties |= UPDATED_PROP_RENDER_OPERATION;
- __toUpdatePropImmediately.Update(UPDATED_PROP_RENDER_OPERATION);
+
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_RENDER_OPERATION);
}
-// if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
-// {
-//// __updatedProperties |= UPDATED_PROP_RENDER_OPERATION;
-//// RENDER_LOCK();
-//// __pRenderObject->SetRenderOperationProperty(__renderOperation);
-// }
return E_SUCCESS;
}
// karzia R01:
//InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
InvalidateHierarchyProps(UPDATED_PROP_SURFACE, false, false);
-// __updatedProperties |= UPDATED_PROP_SURFACE;
- __toUpdatePropImmediately.Update(UPDATED_PROP_SURFACE);
+
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_SURFACE);
}
//karzia R01:
//InvalidateHierarchyProps(HIERARCHY_PROPERTY_CONTENTBOUNDS, false, false);
InvalidateHierarchyProps(UPDATED_PROP_CONTENT_BOUNDS, false, false);
-// __updatedProperties |= UPDATED_PROP_CONTENT_BOUNDS;
- __toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_BOUNDS);
+
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_BOUNDS);
return E_SUCCESS;
}
// observer
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_BOUNDS;
- __toUpdatePropImmediately.Update(UPDATED_PROP_BOUNDS);
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_BOUNDS);
-// RENDER_LOCK();
-// FloatRectangle currentValue = __pRenderObject->__bounds;
-
-// const String* subProperties[] = { pVeSubPropBoundsSize, pVeSubPropBoundsPosition, NULL };
-// if(CreateImplicitAnimationIfNeeded(*pVePropBounds, __bounds, currentValue, subProperties ) == false)
-// {
-// __pRenderObject->SetBoundsProperty(__bounds);
-// }
VE_DELEGATE(this, InvokeOnBoundsChanged, oldValue);
InvalidateHierarchyProps(UPDATED_PROP_Z_POSITION, true, false); // lazy evaluation: property changed flag
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_Z_POSITION;
- __toUpdatePropImmediately.Update(UPDATED_PROP_Z_POSITION);
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_Z_POSITION);
}
}
return E_SUCCESS;
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
// __updatedProperties |= UPDATED_PROP_CHANGE_ZORDER;
-// __toUpdatePropImmediately.Update(UPDATED_PROP_CHANGE_ZORDER);
+// GetSharedData().__toUpdatePropImmediately.Update(UPDATED_PROP_CHANGE_ZORDER);
// RENDER_LOCK();
// __pRenderObject->SetZOrderGroupProperty(_zOrderGroup);
//Observer
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_SHOW_STATE;
- __toUpdatePropImmediately.Update(UPDATED_PROP_SHOW_STATE);
-
-// const String& property = *pVePropShowState;
-// RENDER_LOCK();
-// _AnimationManager* pAnimationManager = _AnimationManager::GetInstance();
-
-
-// if (likely(GetRoot()) && likely(GetSharedData().needSurface)
-// && (unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled)))
-// {
-// // WARNING:
-// // For performance, following must be done only when oldValue != newValue.
-// VisualElementAnimation* pAnimation = InvokeCreateAnimationForProperty(property);
-// VisualElementPropertyAnimation* pPropertyAnimation = NULL;
-// if(!pAnimation)
-// {
-// pPropertyAnimation = new (std::nothrow) VisualElementPropertyAnimation();
-// if(pPropertyAnimation)
-// {
-// pPropertyAnimation->SetPropertyName(*pVePrivPropShowOpacity);
-// needPresentationUpdate = true;
-// }
-// }
-// else
-// {
-// pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(pAnimation);
-// }
-
-// if (likely(pPropertyAnimation))
-// {
-// if (pPropertyAnimation->GetEndValue().IsEmpty())
-// {
-// pPropertyAnimation->SetEndValue(__showOpacity);
-// }
-
-// if (pPropertyAnimation->GetStartValue().IsEmpty())
-// {
-// pPropertyAnimation->SetStartValue(__pRenderObject->__showOpacity);
-// }
-// }
-
-// if (unlikely(pPropertyAnimation))
-// {
-// /// WARNING:
-// // Adding property animation causes previous animation for same property to be removed in Animation Manager.
-// if (unlikely(IsFailed(AddAnimation(null, *pPropertyAnimation))))
-// {
-// needPresentationUpdate = true;
-// //pAnimationManager->RemoveAnimationByProperty(*presentation.GetPublic(), property);
-// }
-
-// delete pPropertyAnimation;
-// }
-// else
-// {
-// // WARNING:
-// // Remove previous animation even when trying to change the property without animation.
-// pAnimationManager->RemoveAnimationByProperty(*__pRenderObject->__pPublicInstance, property);
-// needPresentationUpdate = true;
-// }
-// }
-// else
-// {
-// pAnimationManager->RemoveAnimationByProperty(*__pRenderObject->__pPublicInstance, property);
-// needPresentationUpdate = true;
-
-// }
-// if(needPresentationUpdate)
-// {
-// __pRenderObject->SetShowStateProperty(SHOWOPACITY_VISIBLE(__showOpacity));
-// }
- InvokeOnShowStateChanged(oldShowState);
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_SHOW_STATE);
+
+ InvokeOnShowStateChanged(oldShowState);
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_CONTENT_OPACITY;
- __toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
-// RENDER_LOCK();
-// float currentValue = __pRenderObject->__contentOpacity;
-// if(CreateImplicitAnimationIfNeeded(*pVePropContentOpacity, __contentOpacity, currentValue, NULL) == false)
-// {
-// __pRenderObject->SetContentOpacityProperty(__contentOpacity);
-// }
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
}
return E_SUCCESS;
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_OPACITY;
- __toUpdatePropImmediately.Update(UPDATED_PROP_OPACITY);
-// RENDER_LOCK();
-// float currentValue = __pRenderObject->__opacity;
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_OPACITY);
+
-// if(CreateImplicitAnimationIfNeeded(*pVePropOpacity, __opacity, currentValue, NULL) == false)
-// {
-// __pRenderObject->SetOpacityProperty(__opacity);
-// }
}
return E_SUCCESS;
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_ANCHOR;
- __toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR);
-// RENDER_LOCK();
-// FloatPoint currentValue = __pRenderObject->__anchor;
-// if(CreateImplicitAnimationIfNeeded(*pVePropAnchor, __anchor, currentValue, NULL) == false)
-// {
-// __pRenderObject->SetAnchorProperty(__anchor);
-// }
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR);
+
}
return E_SUCCESS;
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_ANCHOR_Z;
- __toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR_Z);
-// RENDER_LOCK();
-// float currentValue = __pRenderObject->__anchorZ;
-// if(CreateImplicitAnimationIfNeeded(*pVePropAnchorZ, __anchorZ, currentValue, NULL) == false)
-// {
-// __pRenderObject->SetAnchorZProperty(__anchorZ);
-// }
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_ANCHOR_Z);
}
return E_SUCCESS;
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_TRANSFORM;
- __toUpdatePropImmediately.Update(UPDATED_PROP_TRANSFORM);
-
-// RENDER_LOCK();
-// FloatMatrix4 currentValue = __pRenderObject->__transform;
-
-// const String* subProperties[] = { pVeSubPropTransformRotationX,
-// pVeSubPropTransformRotationY,
-// pVeSubPropTransformRotationZ,
-// pVeSubPropTransformScaleX,
-// pVeSubPropTransformScaleY,
-// pVeSubPropTransformScaleZ,
-// pVeSubPropTransformTranslationX,
-// pVeSubPropTransformTranslationY,
-// pVeSubPropTransformTranslationZ,
-// pVeSubPropTransformRotationAnchorX,
-// pVeSubPropTransformRotationAnchorY,
-// pVeSubPropTransformRotationAnchorZ,
-// pVeSubPropTransformScaleAnchorX,
-// pVeSubPropTransformScaleAnchorY,
-// pVeSubPropTransformScaleAnchorZ,
-// NULL};
-
-// if(CreateImplicitAnimationIfNeeded(*pVePropTransform, __transform, currentValue, subProperties ) == false)
-// {
-// __pRenderObject->SetTransformMatrixProperty(__transform);
-// }
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_TRANSFORM);
VE_DELEGATE(this, InvokeOnTransformMatrixChanged, oldValue);
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_CHILDREN_TRANSFORM;
- __toUpdatePropImmediately.Update(UPDATED_PROP_CHILDREN_TRANSFORM);
-
-// RENDER_LOCK();
-// FloatMatrix4 currentValue = __pRenderObject->__childrenTransform;
-// const String* subProperties[] = {
-// pVeSubPropChildrenTransformRotationX,
-// pVeSubPropChildrenTransformRotationY,
-// pVeSubPropChildrenTransformRotationZ,
-// pVeSubPropChildrenTransformScaleX,
-// pVeSubPropChildrenTransformScaleY,
-// pVeSubPropChildrenTransformScaleZ,
-// pVeSubPropChildrenTransformTranslationX,
-// pVeSubPropChildrenTransformTranslationY,
-// pVeSubPropChildrenTransformTranslationZ,
-// pVeSubPropChildrenTransformRotationAnchorX,
-// pVeSubPropChildrenTransformRotationAnchorY,
-// pVeSubPropChildrenTransformRotationAnchorZ,
-// pVeSubPropChildrenTransformScaleAnchorX,
-// pVeSubPropChildrenTransformScaleAnchorY,
-// pVeSubPropChildrenTransformScaleAnchorZ,
-// NULL};
-
-// if(CreateImplicitAnimationIfNeeded(*pVePropChildrenTransform, __childrenTransform, currentValue, subProperties ) == false)
-// {
-// __pRenderObject->SetChildrenTransformMatrixProperty(__childrenTransform);
-// }
+
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CHILDREN_TRANSFORM);
VE_DELEGATE(this, InvokeOnChildrenTransformMatrixChanged, oldValue);
}
if(IS_MODEL(this) && IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_CLIP_CHILDREN;
- __toUpdatePropImmediately.Update(UPDATED_PROP_CLIP_CHILDREN);
-// __pPresentation->SetClipChildrenProperty(__isClipChildren);
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CLIP_CHILDREN);
}
return E_SUCCESS;
{
if(IS_NEEDED_UPDATE_RENDER_OBJECT(this))
{
-// __updatedProperties |= UPDATED_PROP_CONTENT_OPACITY;
- __toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
-// __pPresentation->SetSurfaceOpaqueProperty(isSurfaceOpaque);
+ GetSharedData().toUpdatePropImmediately.Update(UPDATED_PROP_CONTENT_OPACITY);
}
}
//update presentation zorder group
if (IS_MODEL(this))
{
-// __updatedProperties |= UPDATED_PROP_CHANGE_ZORDER;
-// __toUpdatePropImmediately.Update(UPDATED_PROP_CHANGE_ZORDER);
child.UpdatePresentationWhenZOrderChanged(pReference, above);
}
return E_SUCCESS;
if (IS_MODEL(this))
{
-// __updatedProperties |= UPDATED_PROP_CHANGE_ZORDER;
-// __toUpdatePropImmediately.Update(UPDATED_PROP_CHANGE_ZORDER);
child.UpdatePresentationWhenZOrderChanged(pReference, above);
if(!sameParent) // when child was moved to same parent, don't have to detach and attach to parent.
{
return Variant();
}
+
+
Variant
_VisualElementImpl::GetRenderObjectProperty(const Tizen::Base::String& property)
{
return Variant();
}
- if(__toUpdatePropImmediately.__updatedProperties == 0)
+ if(GetSharedData().toUpdatePropImmediately.__updatedProperties == 0)
{
return __pRenderObject->GetProperty(property);
}
else
{
- return __toUpdatePropImmediately.GetProperty(property);
+ return GetSharedData().toUpdatePropImmediately.GetProperty(property);
}
}
#include <FUiAnimVisualElementSurface.h>
#include "FUiAnim_VisualElement.h"
+#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_VisualElementSharedData.h"
#include "FUiAnim_VisualElementSurfaceImpl.h"
#include "FUiAnim_INativeNode.h"
#include "FUiAnim_NativeLayer.h"
+#include "FUiAnim_AnimationManager.h"
using namespace std;
using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+
+#define PRINT(...)
+//#define PRINT fprintf(stderr, __VA_ARGS__)
namespace Tizen { namespace Ui { namespace Animations
{
+#define IS_ATTACHED(o) \
+ ((o)->GetRoot() != null)
+
+_VisualElementSharedData::UpdatePropertiesForRender::UpdatePropertiesForRender(_VisualElementImpl* pSource)
+ : __pSource(pSource)
+ , __updatedProperties(0)
+ , __implicitAnimation(0)
+ , __bounds()
+ , __renderOperation(false)
+ , __contentBounds()
+ , __contentOpacity(0)
+ , __showOpacity(0)
+ , __opacity(0)
+ ,__anchor()
+ ,__anchorZ(0)
+ ,__transform()
+ ,__decomposedTransform()
+ ,__childrenTransform()
+ ,__decomposedChildrenTransform()
+ ,__zPosition(0)
+ ,__isClipChildren(false)
+ ,isSurfaceOpaque(false)
+{
+
+}
+
+_VisualElementSharedData::UpdatePropertiesForRender::~UpdatePropertiesForRender()
+{
+__updatedProperties = 0;
+__implicitAnimation = 0;
+}
+
+void
+_VisualElementSharedData::UpdatePropertiesForRender::Clear()
+{
+ __updatedProperties = 0;
+ __implicitAnimation = 0;
+}
+
+Variant
+_VisualElementSharedData::UpdatePropertiesForRender::GetProperty(const Base::String& name) const
+{
+
+ // need optimizing
+ if(name.CompareTo(*pVePropBounds) == 0
+ && __updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
+ {
+ return Variant(__bounds);
+ }
+ else if(name.CompareTo(*pVeSubPropBoundsPosition) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
+ {
+ return Variant(__bounds.GetTopLeft());
+ }
+ else if(name.CompareTo(*pVeSubPropBoundsSize) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_BOUNDS)
+ {
+ return Variant(FloatDimension(__bounds.width, __bounds.height));
+ }
+ else if(name.CompareTo(*pVePropRenderOperation) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_RENDER_OPERATION)
+ {
+ return Variant(static_cast< int >(__renderOperation));
+ }
+ else if(name.CompareTo(*pVePropContentBounds) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CONTENT_BOUNDS)
+ {
+ return Variant(__contentBounds);
+ }
+ else if(name.CompareTo(*pVePropContentOpacity) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CONTENT_OPACITY)
+ {
+ return Variant(__contentOpacity);
+ }
+
+ else if(name.CompareTo(*pVePropOpacity) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_OPACITY)
+ {
+ return Variant(__opacity);
+ }
+ else if(name.CompareTo(*pVePropShowState) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SHOW_STATE)
+ {
+ return Variant((__showOpacity!=0));
+
+ }
+ else if(name.CompareTo(*pVePropAnchor) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_ANCHOR)
+ {
+ return Variant(__anchor);
+ }
+ else if(name.CompareTo(*pVePropAnchorZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_ANCHOR_Z)
+ {
+ return Variant(__anchorZ);
+ }
+ else if(name.CompareTo(*pVePropTransform) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ return Variant(__transform);
+ }
+
+ else if(name.CompareTo(*pVeSubPropTransformRotationX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleX);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformRotationY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleY);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformRotationZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleZ);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformRotationAnchorXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float anchorX = 0.0f;
+ float anchorY = 0.0f;
+ float anchorZ = 0.0f;
+ __decomposedTransform.GetRotationAnchor(anchorX, anchorY, anchorZ);
+
+ return Variant(FloatPoint(anchorX, anchorY));
+
+ }
+ else if(name.CompareTo(*pVeSubPropTransformRotationXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(FloatPoint(angleX, angleY));
+ }
+ else if(name.CompareTo(*pVeSubPropTransformScaleX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleX);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformScaleY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleY);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformScaleZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleZ);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformScaleAnchorXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float anchorX = 0.0f;
+ float anchorY = 0.0f;
+ float anchorZ = 0.0f;
+ __decomposedTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
+
+ return Variant(FloatPoint(anchorX, anchorY));
+ }
+ else if(name.CompareTo(*pVeSubPropTransformTranslationX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateX);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformScaleXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(FloatPoint(scaleX, scaleY));
+ }
+ else if(name.CompareTo(*pVeSubPropTransformTranslationY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateY);
+ }
+ else if(name.CompareTo(*pVeSubPropTransformTranslationZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateZ);
+ }
+
+ else if(name.CompareTo(*pVeSubPropTransformTranslationXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(FloatPoint(translateX, translateY));
+ }
+ else if(name.CompareTo(*pVePropChildrenTransform) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ return Variant(__childrenTransform);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformRotationX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleX);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformRotationY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleY);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformRotationZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(angleZ);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformRotationAnchorXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float anchorX = 0.0f;
+ float anchorY = 0.0f;
+ float anchorZ = 0.0f;
+ __decomposedChildrenTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
+
+ return Variant(FloatPoint(anchorX, anchorY));
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformRotationXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float angleX = 0.0f;
+ float angleY = 0.0f;
+ float angleZ = 0.0f;
+ __decomposedChildrenTransform.GetEulerAngles(angleX, angleY, angleZ);
+
+ return Variant(FloatPoint(angleX, angleY));
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleX);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleY);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleZ);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleX);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleY);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(scaleZ);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleAnchorXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float anchorX = 0.0f;
+ float anchorY = 0.0f;
+ float anchorZ = 0.0f;
+ __decomposedChildrenTransform.GetScaleAnchor(anchorX, anchorY, anchorZ);
+
+ return Variant(FloatPoint(anchorX, anchorY));
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformScaleXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+ float scaleZ = 1.0f;
+ __decomposedChildrenTransform.GetScaleFactors(scaleX, scaleY, scaleZ);
+
+ return Variant(FloatPoint(scaleX, scaleY));
+
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationX) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateX);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateY);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationZ) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(translateZ);
+ }
+ else if(name.CompareTo(*pVeSubPropChildrenTransformTranslationXY) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM)
+ {
+ float translateX = 0.0f;
+ float translateY = 0.0f;
+ float translateZ = 0.0f;
+ __decomposedChildrenTransform.GetTranslationFactors(translateX, translateY, translateZ);
+
+ return Variant(FloatPoint(translateX, translateY));
+ }
+ else if(name.CompareTo(*pVePropZPosition) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_Z_POSITION)
+ {
+ return Variant(__zPosition);
+ }
+ else if(name.CompareTo(*pVePropClipChildren) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_CLIP_CHILDREN)
+ {
+ return Variant(__isClipChildren);
+ }
+ else if(name.CompareTo(*pVePropSurfaceOpaque) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SURFACE_OPAQUE)
+ {
+ // need to check
+ return Variant(isSurfaceOpaque);
+ }
+ else if(name.CompareTo(*pVePrivPropShowOpacity) == 0
+ &&__updatedProperties & _VisualElementImpl::UPDATED_PROP_SHOW_STATE)
+ {
+ return Variant(__showOpacity);
+ }
+
+ return __pSource->__pRenderObject->GetProperty(name);
+}
+
+
+void
+_VisualElementSharedData::UpdatePropertiesForRender::Update(PropertyFlags updateFlags)
+{
+ _AnimationManager* pAnimationManager = _AnimationManager::GetInstance();
+ if(!__pSource || !pAnimationManager)
+ return;
+
+ bool bImplicitAnimation = false;
+
+ if(__pSource->__isImplicitAnimationEnabled && IS_ATTACHED(__pSource) && pAnimationManager->IsImplicitAnimationEnabled())
+ {
+ bImplicitAnimation = true;
+ }
+
+ switch(updateFlags)
+ {
+ case _VisualElementImpl::UPDATED_PROP_BOUNDS:
+ {
+ static const String* subProperties[] = { pVeSubPropBoundsSize, pVeSubPropBoundsPosition, NULL };
+ if(__pSource->CreateImplicitAnimation(*pVePropBounds, __pSource->__bounds, subProperties, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __bounds = __pSource->__bounds;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ }
+
+ break;
+ case _VisualElementImpl::UPDATED_PROP_Z_POSITION:
+
+ if(__pSource->CreateImplicitAnimation(*pVePropZPosition, __pSource->__zPosition, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __zPosition = __pSource->__zPosition;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_ANCHOR:
+
+ if(__pSource->CreateImplicitAnimation(*pVePropAnchor, __pSource->__anchor, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __anchor = __pSource->__anchor;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_ANCHOR_Z:
+
+ if(__pSource->CreateImplicitAnimation(*pVePropAnchorZ, __pSource->__anchorZ, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __anchorZ = __pSource->__anchorZ;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_TRANSFORM:
+ {
+ static const String* subProperties[] = {
+ pVeSubPropTransformRotationX,
+ pVeSubPropTransformRotationY,
+ pVeSubPropTransformRotationZ,
+ pVeSubPropTransformScaleX,
+ pVeSubPropTransformScaleY,
+ pVeSubPropTransformScaleZ,
+ pVeSubPropTransformTranslationX,
+ pVeSubPropTransformTranslationY,
+ pVeSubPropTransformTranslationZ,
+ pVeSubPropTransformRotationAnchorX,
+ pVeSubPropTransformRotationAnchorY,
+ pVeSubPropTransformRotationAnchorZ,
+ pVeSubPropTransformScaleAnchorX,
+ pVeSubPropTransformScaleAnchorY,
+ pVeSubPropTransformScaleAnchorZ,
+ NULL};
+ if(__pSource->CreateImplicitAnimation(*pVePropTransform, __pSource->__transform, subProperties, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __transform = __pSource->__transform;
+ __decomposedTransform = __pSource->__decomposedTransform;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_CHILDREN_TRANSFORM:
+ {
+ static const String* subProperties[] = {
+ pVeSubPropChildrenTransformRotationX,
+ pVeSubPropChildrenTransformRotationY,
+ pVeSubPropChildrenTransformRotationZ,
+ pVeSubPropChildrenTransformScaleX,
+ pVeSubPropChildrenTransformScaleY,
+ pVeSubPropChildrenTransformScaleZ,
+ pVeSubPropChildrenTransformTranslationX,
+ pVeSubPropChildrenTransformTranslationY,
+ pVeSubPropChildrenTransformTranslationZ,
+ pVeSubPropChildrenTransformRotationAnchorX,
+ pVeSubPropChildrenTransformRotationAnchorY,
+ pVeSubPropChildrenTransformRotationAnchorZ,
+ pVeSubPropChildrenTransformScaleAnchorX,
+ pVeSubPropChildrenTransformScaleAnchorY,
+ pVeSubPropChildrenTransformScaleAnchorZ,
+ NULL};
+
+ if(__pSource->CreateImplicitAnimation(*pVePropChildrenTransform, __pSource->__childrenTransform, subProperties, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __childrenTransform = __pSource->__childrenTransform;
+ __decomposedChildrenTransform = __pSource->__decomposedChildrenTransform;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_CLIP_CHILDREN:
+ __isClipChildren = __pSource->__isClipChildren;
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_CHANGE_ZORDER:
+
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_RENDER_OPERATION:
+ __renderOperation = __pSource->__renderOperation;
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ break;
+ case _VisualElementImpl::UPDATED_PROP_SHOW_STATE:
+ if(__pSource->CreateImplicitAnimationForShowState(__pSource->__showOpacity, 0.0f, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __showOpacity = __pSource->__showOpacity;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_OPACITY:
+
+ if(__pSource->CreateImplicitAnimation(*pVePropOpacity, __pSource->__opacity, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __opacity = __pSource->__opacity;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_CONTENT_OPACITY:
+ if(__pSource->CreateImplicitAnimation(*pVePropContentOpacity, __pSource->__contentOpacity, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __contentOpacity = __pSource->__contentOpacity;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+ case _VisualElementImpl::UPDATED_PROP_SURFACE_OPAQUE:
+ if(__pSource->__pSharedData)
+ {
+ isSurfaceOpaque = __pSource->__pSharedData->isSurfaceOpaque;
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+ }
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_CONTENT_BOUNDS:
+ if(__pSource->CreateImplicitAnimation(*pVePropContentBounds, __pSource->__contentBounds, NULL, bImplicitAnimation ) == false)
+ {
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+
+ __contentBounds = __pSource->__contentBounds;
+ }
+ else
+ {
+ __implicitAnimation |= updateFlags;
+ }
+ break;
+
+ case _VisualElementImpl::UPDATED_PROP_CONTENT:
+
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+ break;
+ case _VisualElementImpl::UPDATED_PROP_SURFACE:
+
+ __implicitAnimation &= ~updateFlags;
+ __updatedProperties |= updateFlags;
+ break;
+ default:
+ //error
+ PRINT("Undefined property(0x%x)\n", updateFlags);
+ break;
+ }
+}
+
-_VisualElementSharedData::_VisualElementSharedData(void)
+_VisualElementSharedData::_VisualElementSharedData(_VisualElementImpl* pModel)
: invalidatedNativeProps(-1)
, childrenInvalidated(false)
, childrenSurfaceChanged(false)
, pContentProvider(null)
, pEventListener(null)
, name("")
+ , toUpdatePropImmediately(pModel)
, pUserData(null)
, __refCount(1)
{