From 66c4191cb7427e2a1da222cef4580fd01bf9f75a Mon Sep 17 00:00:00 2001 From: Bongjoo Seo Date: Wed, 10 Jul 2013 11:14:26 +0900 Subject: [PATCH] Fixed crash issue while AppTerminating Change-Id: I91eca6bb70f178f51bf7e3b0fcc3e4ce758eb389 Signed-off-by: Bongjoo Seo --- src/ui/animations/FUiAnimAnimationTransaction.cpp | 186 ++++++++++++++++++--- src/ui/animations/FUiAnimVisualElement.cpp | 2 - src/ui/animations/FUiAnim_AnimationGroupNode.cpp | 2 - src/ui/animations/FUiAnim_AnimationManager.cpp | 7 +- src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp | 2 +- src/ui/animations/FUiAnim_Debug.cpp | 11 +- src/ui/animations/FUiAnim_DisplayManager.cpp | 13 +- src/ui/animations/FUiAnim_EflLayer.cpp | 6 +- src/ui/animations/FUiAnim_EflNode.cpp | 1 - src/ui/animations/FUiAnim_TransactionNode.h | 2 - .../FUiAnim_VisualElementAnimationImpl.cpp | 7 +- src/ui/animations/FUiAnim_VisualElementImpl.cpp | 72 ++++++-- src/ui/inc/FUiAnim_EflLayer.h | 6 - 13 files changed, 247 insertions(+), 70 deletions(-) diff --git a/src/ui/animations/FUiAnimAnimationTransaction.cpp b/src/ui/animations/FUiAnimAnimationTransaction.cpp index 4a4b9f7..23a43c3 100644 --- a/src/ui/animations/FUiAnimAnimationTransaction.cpp +++ b/src/ui/animations/FUiAnimAnimationTransaction.cpp @@ -49,7 +49,13 @@ AnimationTransaction::~AnimationTransaction(void) result AnimationTransaction::Begin(void) { - int transactionId = _AnimationManager::GetInstance()->BeginTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + int transactionId = pAnimationManager->BeginTransaction(); SysTryReturnResult(NID_UI_ANIM, (transactionId != -1), E_OUT_OF_MEMORY, "Propagating."); return E_SUCCESS; @@ -58,7 +64,13 @@ AnimationTransaction::Begin(void) result AnimationTransaction::Begin(int& transactionId) { - transactionId = _AnimationManager::GetInstance()->BeginTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + transactionId = pAnimationManager->BeginTransaction(); SysTryReturnResult(NID_UI_ANIM, (transactionId != -1), E_OUT_OF_MEMORY, "Propagating."); return E_SUCCESS; @@ -67,7 +79,13 @@ AnimationTransaction::Begin(int& transactionId) result AnimationTransaction::Commit(void) { - result r = _AnimationManager::GetInstance()->CommitTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + result r = pAnimationManager->CommitTransaction(); SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), r, "Propagating."); return r; @@ -78,7 +96,13 @@ AnimationTransaction::Stop(int transactionId) { SysTryReturnResult(NID_UI_ANIM, (transactionId > 0), E_INVALID_ARG, "Invalid argument(s) is used. transactionId = %d", transactionId); - result r = _AnimationManager::GetInstance()->StopTransaction(transactionId); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + result r = pAnimationManager->StopTransaction(transactionId); SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), r, "Propagating."); return r; @@ -87,7 +111,13 @@ AnimationTransaction::Stop(int transactionId) result AnimationTransaction::Discard(void) { - result r = _AnimationManager::GetInstance()->DiscardTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + result r = pAnimationManager->DiscardTransaction(); SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), r, "Propagating."); return r; @@ -98,7 +128,9 @@ AnimationTransaction::GetStatus(int transactionId) { SysTryReturn(NID_UI_ANIM, (transactionId > 0), ANIMATION_TRANSACTION_STATUS_STOPPED, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. transactionId = %d.", transactionId); - if (_AnimationManager::GetInstance()->IsTransactionRunning(transactionId)) + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + + if (pAnimationManager && pAnimationManager->IsTransactionRunning(transactionId)) { return ANIMATION_TRANSACTION_STATUS_PLAYING; } @@ -109,7 +141,11 @@ AnimationTransaction::GetStatus(int transactionId) result AnimationTransaction::SetTransactionEventListener(IAnimationTransactionEventListener* pListener) { - _AnimationManager::GetInstance()->SetTransactionEventListener(pListener); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (pAnimationManager) + { + pAnimationManager->_AnimationManager::GetInstance()->SetTransactionEventListener(pListener); + } return E_SUCCESS; } @@ -117,7 +153,13 @@ AnimationTransaction::SetTransactionEventListener(IAnimationTransactionEventList result AnimationTransaction::SetCurrentTransactionEventListener(IAnimationTransactionEventListener* pListener) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); result r = pNode->SetEventListener(pListener); @@ -129,7 +171,13 @@ AnimationTransaction::SetCurrentTransactionEventListener(IAnimationTransactionEv result AnimationTransaction::SetVisualElementImplicitAnimationEnabled(bool enable) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); result r = pNode->SetImplicitAnimationEnabled(enable); @@ -141,7 +189,13 @@ AnimationTransaction::SetVisualElementImplicitAnimationEnabled(bool enable) result AnimationTransaction::SetVisualElementAnimationStatusEventListener(IVisualElementAnimationStatusEventListener* pListener) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetStatusEventListener(pListener); @@ -152,7 +206,13 @@ AnimationTransaction::SetVisualElementAnimationStatusEventListener(IVisualElemen result AnimationTransaction::SetVisualElementAnimationTimingFunction(const IVisualElementAnimationTimingFunction* pTimingFunction) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetTimingFunction(pTimingFunction); @@ -163,7 +223,13 @@ AnimationTransaction::SetVisualElementAnimationTimingFunction(const IVisualEleme result AnimationTransaction::SetVisualElementAnimationValueInterpolator(const IVisualElementAnimationValueInterpolator* pValueInterpolator) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetValueInterpolator(pValueInterpolator); @@ -174,7 +240,13 @@ AnimationTransaction::SetVisualElementAnimationValueInterpolator(const IVisualEl result AnimationTransaction::SetVisualElementAnimationDuration(long milliseconds) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); SysTryReturnResult(NID_UI_ANIM, (milliseconds >= 0 && milliseconds >= pNode->GetOffset()), E_INVALID_ARG, "Invalid argument(s) is used. milliseconds = %ld", milliseconds); @@ -187,7 +259,13 @@ AnimationTransaction::SetVisualElementAnimationDuration(long milliseconds) long AnimationTransaction::GetVisualElementAnimationDuration(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); return pNode->GetDuration(); @@ -196,7 +274,13 @@ AnimationTransaction::GetVisualElementAnimationDuration(void) result AnimationTransaction::SetVisualElementAnimationOffset(long milliseconds) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); SysTryReturnResult(NID_UI_ANIM, (milliseconds >= 0 && milliseconds <= pNode->GetDuration()), E_INVALID_ARG, "Invalid argument(s) is used. milliseconds = %ld", milliseconds); @@ -209,7 +293,13 @@ AnimationTransaction::SetVisualElementAnimationOffset(long milliseconds) long AnimationTransaction::GetVisualElementAnimationOffset(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return -1; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); return pNode->GetOffset(); @@ -220,7 +310,13 @@ AnimationTransaction::SetVisualElementAnimationDelay(long milliseconds) { SysTryReturnResult(NID_UI_ANIM, (milliseconds >= 0), E_INVALID_ARG, "Invalid argument(s) is used. milliseconds = %ld", milliseconds); - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetDelay(milliseconds); @@ -231,7 +327,13 @@ AnimationTransaction::SetVisualElementAnimationDelay(long milliseconds) long AnimationTransaction::GetVisualElementAnimationDelay(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return -1; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); return pNode->GetDelay(); @@ -242,7 +344,13 @@ AnimationTransaction::SetVisualElementAnimationRepeatCount(long count) { SysTryReturnResult(NID_UI_ANIM, (count >= 0), E_INVALID_ARG, "Invalid argument(s) is used. count = %ld", count); - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetRepeatCount(count); @@ -253,7 +361,13 @@ AnimationTransaction::SetVisualElementAnimationRepeatCount(long count) long AnimationTransaction::GetVisualElementAnimationRepeatCount(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return -1; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); return pNode->GetRepeatCount(); @@ -262,7 +376,13 @@ AnimationTransaction::GetVisualElementAnimationRepeatCount(void) result AnimationTransaction::SetVisualElementAnimationAutoReverseEnabled(bool autoReverse) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetAutoReverseEnabled(autoReverse); @@ -273,7 +393,13 @@ AnimationTransaction::SetVisualElementAnimationAutoReverseEnabled(bool autoRever bool AnimationTransaction::IsVisualElementAnimationAutoReverseEnabled(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return false; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); bool autoReverse = pNode->IsAutoReverseEnabled(); @@ -289,7 +415,13 @@ AnimationTransaction::SetVisualElementAnimationScaleRatio(float scaleRatio) { SysTryReturnResult(NID_UI_ANIM, (scaleRatio > 0.f), E_INVALID_ARG, "Invalid argument(s) is used. scaleRatio = %f", scaleRatio); - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturnResult(NID_UI_ANIM, (pNode != null), E_INVALID_OPERATION, "Transaction isn't opened."); pNode->SetScaleRatio(scaleRatio); @@ -300,7 +432,13 @@ AnimationTransaction::SetVisualElementAnimationScaleRatio(float scaleRatio) float AnimationTransaction::GetVisualElementAnimationScaleRatio(void) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return 0.0f; + } + + _TransactionNode* pNode = pAnimationManager->GetCurrentTransaction(); SysTryReturn(NID_UI_ANIM, (pNode != null), 0.0f, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Transaction isn't opened."); return pNode->GetScaleRatio(); diff --git a/src/ui/animations/FUiAnimVisualElement.cpp b/src/ui/animations/FUiAnimVisualElement.cpp index 6efaf77..56e744e 100644 --- a/src/ui/animations/FUiAnimVisualElement.cpp +++ b/src/ui/animations/FUiAnimVisualElement.cpp @@ -31,8 +31,6 @@ #include "FUiAnim_VisualElementAnimationImpl.h" #include "FUiAnim_VisualElementImpl.h" -#include "FUiAnim_Debug.h" - #define CHECK_NOT_CONSTRUCTED \ SysAssertf(_pVisualElementImpl->__pSharedData == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); diff --git a/src/ui/animations/FUiAnim_AnimationGroupNode.cpp b/src/ui/animations/FUiAnim_AnimationGroupNode.cpp index 33db3db..f683f50 100644 --- a/src/ui/animations/FUiAnim_AnimationGroupNode.cpp +++ b/src/ui/animations/FUiAnim_AnimationGroupNode.cpp @@ -30,8 +30,6 @@ #include "FUiAnim_AnimationGroupNode.h" -#include "FUiAnim_Debug.h" - using namespace Tizen::Base; using namespace Tizen::Base::Collection; diff --git a/src/ui/animations/FUiAnim_AnimationManager.cpp b/src/ui/animations/FUiAnim_AnimationManager.cpp index cfd1748..f93b060 100644 --- a/src/ui/animations/FUiAnim_AnimationManager.cpp +++ b/src/ui/animations/FUiAnim_AnimationManager.cpp @@ -144,6 +144,7 @@ _AnimationManager::~_AnimationManager(void) } __committedList.RemoveAllNodes(); + __pInstance = null; } _AnimationManager* @@ -270,7 +271,11 @@ _AnimationManager::SetAnimatorEnabled(bool animating) #else if (animating) { - _DisplayManager::GetInstance()->AddWakeUpEvent(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); + if (pDisplayManager) + { + pDisplayManager->AddWakeUpEvent(); + } } #endif } diff --git a/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp b/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp index c9e25a9..b4f7d8b 100644 --- a/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp +++ b/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp @@ -586,7 +586,7 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase animIdentifier.Append(__animationId); - if (_AnimationManager::GetInstance()->GetCurrentTransaction() != null) + if (_AnimationManager::GetInstance() && _AnimationManager::GetInstance()->GetCurrentTransaction() != null) { animIdentifier.Append(TRANSACTION); } diff --git a/src/ui/animations/FUiAnim_Debug.cpp b/src/ui/animations/FUiAnim_Debug.cpp index 5a83a81..c67ce2d 100644 --- a/src/ui/animations/FUiAnim_Debug.cpp +++ b/src/ui/animations/FUiAnim_Debug.cpp @@ -269,13 +269,12 @@ _VeDebug::DumpVisualElementLayout(_VisualElementImpl* pElement, FILE* pFile) evas_object_geometry_get(pEvasObject, &absolute.x, &absolute.y, &absolute.width, &absolute.height); FloatRectangle realBounds = pElement->__bounds; - _RootVisualElement* pRoot = dynamic_cast<_RootVisualElement*>(pElement->__pPublicInstance); - if (pRoot) + _Window* pWindow = dynamic_cast< Tizen::Ui::_Window* >(static_cast< Tizen::Ui::_Window* >(pElement->GetUserData())); + if (pWindow) { - _NativeLayer* pLayer = pRoot->GetNativeLayer(); - FloatRectangle rect = pLayer->GetBounds(); - realBounds.x += rect.x; - realBounds.y += rect.y; + Rectangle windowRect = pWindow->GetBounds(); + realBounds.x += windowRect.x; + realBounds.y += windowRect.y; } _VisualElementCoordinateSystem::ConvertDimensionToPhysical(realBounds.width, realBounds.height); _VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.width, realBounds.height, relative.width, relative.height); diff --git a/src/ui/animations/FUiAnim_DisplayManager.cpp b/src/ui/animations/FUiAnim_DisplayManager.cpp index a56bf36..5f36a04 100644 --- a/src/ui/animations/FUiAnim_DisplayManager.cpp +++ b/src/ui/animations/FUiAnim_DisplayManager.cpp @@ -65,13 +65,14 @@ _DisplayManager::_DisplayManager(void) _DisplayManager::~_DisplayManager(void) { - while (__roots.GetCount() > 0) - { - _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(0)); +// while (__roots.GetCount() > 0) +// { +// _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(0)); - pRoot->Destroy(); - __roots.RemoveAt(0); - } +// pRoot->Destroy(); +// __roots.RemoveAt(0); +// } + __pInstance = null; } result diff --git a/src/ui/animations/FUiAnim_EflLayer.cpp b/src/ui/animations/FUiAnim_EflLayer.cpp index 75aa87a..07da1fe 100644 --- a/src/ui/animations/FUiAnim_EflLayer.cpp +++ b/src/ui/animations/FUiAnim_EflLayer.cpp @@ -260,8 +260,7 @@ namespace Tizen { namespace Ui { namespace Animations int _EflLayer::_countOfLayer = 0; _EflLayer::_EflLayer(void) - : _pRootVisualElement(null) - , _pEvas(null) + : _pEvas(null) , _pEcoreEvas(null) , _pWindow(null) , _pOnWindowDamagedHandler(null) @@ -281,8 +280,7 @@ _EflLayer::_EflLayer(void) } _EflLayer::_EflLayer(bool isMainType) - : _pRootVisualElement(null) - , _pEvas(null) + : _pEvas(null) , _pEcoreEvas(null) , _pWindow(null) , _pOnWindowDamagedHandler(null) diff --git a/src/ui/animations/FUiAnim_EflNode.cpp b/src/ui/animations/FUiAnim_EflNode.cpp index 36d3382..e882e6b 100644 --- a/src/ui/animations/FUiAnim_EflNode.cpp +++ b/src/ui/animations/FUiAnim_EflNode.cpp @@ -35,7 +35,6 @@ #include "FUi_CoordinateSystemUtils.h" #include "FUi_EcoreEvas.h" #include "FUi_EcoreEvasMgr.h" -#include "FUiAnim_Debug.h" #include "FUiAnim_EflLayer.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_MatrixUtil.h" diff --git a/src/ui/animations/FUiAnim_TransactionNode.h b/src/ui/animations/FUiAnim_TransactionNode.h index 673fda8..90dbc6f 100644 --- a/src/ui/animations/FUiAnim_TransactionNode.h +++ b/src/ui/animations/FUiAnim_TransactionNode.h @@ -32,8 +32,6 @@ #include "FUiAnim_VisualElementAnimationImpl.h" #include "FUiAnim_VariantEx.h" -#include "FUiAnim_Debug.h" - namespace Tizen { namespace Ui { namespace Animations { diff --git a/src/ui/animations/FUiAnim_VisualElementAnimationImpl.cpp b/src/ui/animations/FUiAnim_VisualElementAnimationImpl.cpp index 43c1524..01e311a 100644 --- a/src/ui/animations/FUiAnim_VisualElementAnimationImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementAnimationImpl.cpp @@ -44,7 +44,12 @@ _VisualElementAnimationImpl::_VisualElementAnimationImpl(void) , __pUserData(null) , __pEventTarget(null) { - _TransactionNode* pNode = _AnimationManager::GetInstance()->GetCurrentTransaction(false); + _TransactionNode* pNode = null; + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (pAnimationManager) + { + pAnimationManager->GetCurrentTransaction(false); + } if (pNode) { diff --git a/src/ui/animations/FUiAnim_VisualElementImpl.cpp b/src/ui/animations/FUiAnim_VisualElementImpl.cpp index 83c2f52..e0826a1 100644 --- a/src/ui/animations/FUiAnim_VisualElementImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementImpl.cpp @@ -57,7 +57,6 @@ #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_ControlVisualElement.h" #include "FUiAnim_MatrixUtil.h" -#include "FUiAnim_Debug.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_EflLayer.h" #include "FUiAnim_VisualElementSurfaceImpl.h" @@ -374,10 +373,10 @@ _VisualElementImpl::Destroy(void) } else { - _AnimationManager* pManager = _AnimationManager::GetInstance(); - if (pManager) + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (pAnimationManager) { - pManager->RemoveAllAnimations(*__pPublicInstance); + pAnimationManager->RemoveAllAnimations(*__pPublicInstance); } __pModel = null; @@ -480,11 +479,20 @@ _VisualElementImpl::SetVisualElementEventListener(IVisualElementEventListener* p result _VisualElementImpl::FlushI(void) { + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #ifdef VE_VSYNC_UPDATE - _DisplayManager::GetInstance()->RenderAll(); + if (pDisplayManager) + { + pDisplayManager->RenderAll(); + } #endif - return _DisplayManager::GetInstance()->Flush(); + result r = E_SUCCESS; + if (pDisplayManager) + { + r = pDisplayManager->Flush(); + } + return r; } bool @@ -494,6 +502,10 @@ _VisualElementImpl::CreateImplicitAnimationIfNeeded( const String& property, bool r = true; _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return r; + } if (likely(GetRoot()) && likely(GetSharedData().needSurface) @@ -1582,6 +1594,8 @@ _VisualElementImpl::SetShowOpacityI(float showOpacity) const String& property = *pVePropShowState; _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (pAnimationManager) + { if (likely(GetRoot()) && (unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled))) { // WARNING: @@ -1648,7 +1662,7 @@ _VisualElementImpl::SetShowOpacityI(float showOpacity) __pPresentation->SetShowStateProperty(SHOWOPACITY_VISIBLE(__showOpacity)); } InvokeOnShowStateChanged(oldShowState); - + } } return E_SUCCESS; @@ -3987,7 +4001,8 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement } // Setting implicit animation to the child. - if (!IS_PRESENTATION(this) && _AnimationManager::GetInstance()->IsImplicitAnimationEnabled() && child.__isImplicitAnimationEnabled) + if (!IS_PRESENTATION(this) && _AnimationManager::GetInstance() + && _AnimationManager::GetInstance()->IsImplicitAnimationEnabled() && child.__isImplicitAnimationEnabled) { child.RemoveAnimation(*pVePropActionAttach); @@ -4299,7 +4314,7 @@ _VisualElementImpl::RemoveChild(_VisualElementImpl& child, bool deallocate) return E_OBJ_NOT_FOUND; } - if (!IS_PRESENTATION(this) && (_AnimationManager::GetInstance()->IsImplicitAnimationEnabled() + if (!IS_PRESENTATION(this) && (_AnimationManager::GetInstance() && _AnimationManager::GetInstance()->IsImplicitAnimationEnabled() && child.__isImplicitAnimationEnabled) && child.IsAncestorDestroying() == false) { r = CreateElementTreeForDetachImplicitAnimation(child); @@ -6589,7 +6604,16 @@ _VisualElementImpl::AddAnimationI(const Tizen::Base::String* pKeyName, VisualEle // Use presentation tree for animation VisualElement* pPresentation = __pPresentation->__pPublicInstance; - r = _AnimationManager::GetInstance()->AddAnimation(*pPresentation, pKeyName, *pCloned); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + SysLog(NID_UI_ANIM, "Failed to add animation."); + + delete pCloned; + return E_SUCCESS; + } + + r = pAnimationManager->AddAnimation(*pPresentation, pKeyName, *pCloned); if (r != E_SUCCESS) { SysTryLog(NID_UI_ANIM, "[%s] Failed to add animation.", GetErrorMessage(r)); @@ -6623,6 +6647,11 @@ _VisualElementImpl::AddAnimationGroupI(const Tizen::Base::String* pKeyName, Visu { _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + if (!pAnimationManager) + { + return E_SUCCESS; + } + // Get presentation tree VisualElement* pPresentation = __pPresentation->__pPublicInstance; @@ -6690,17 +6719,26 @@ result _VisualElementImpl::RemoveAnimation(const Tizen::Base::String& keyName) { VisualElement* pPresentation = __pPresentation->__pPublicInstance; + result r = E_SUCCESS; + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); - return _AnimationManager::GetInstance()->RemoveAnimation(*pPresentation, keyName); + if (pAnimationManager) + { + r = pAnimationManager->RemoveAnimation(*pPresentation, keyName); + } + return r; } result _VisualElementImpl::RemoveAllAnimations(void) { VisualElement* pPresentation = __pPresentation->__pPublicInstance; + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); - _AnimationManager::GetInstance()->RemoveAllAnimations(*pPresentation); - + if (pAnimationManager) + { + pAnimationManager->RemoveAllAnimations(*pPresentation); + } return E_SUCCESS; } @@ -6711,7 +6749,13 @@ _VisualElementImpl::GetAnimationN(const Tizen::Base::String& keyName) const ClearLastResult(); - return _AnimationManager::GetInstance()->GetAnimationN(*pPresentation, keyName); + _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); + + if (pAnimationManager) + { + return pAnimationManager->GetAnimationN(*pPresentation, keyName); + } + return null; } bool diff --git a/src/ui/inc/FUiAnim_EflLayer.h b/src/ui/inc/FUiAnim_EflLayer.h index 4ff0139..701a8a7 100644 --- a/src/ui/inc/FUiAnim_EflLayer.h +++ b/src/ui/inc/FUiAnim_EflLayer.h @@ -57,11 +57,6 @@ public: void SetOpacity(float opacity); float GetOpacity(void); - _RootVisualElement* GetRootVisualElement(void) const - { - return _pRootVisualElement; - } - Evas* GetEvas(void) const { return _pEvas; @@ -111,7 +106,6 @@ protected: virtual result Configure(_RootVisualElement& rootElement); protected: - _RootVisualElement* _pRootVisualElement; Evas* _pEvas; Ecore_Evas* _pEcoreEvas; Evas_Object* _pWindow; -- 2.7.4