[4.0] Changed Update to reset only target properties each frame
[platform/core/uifw/dali-core.git] / dali / internal / update / animation / scene-graph-constraint-base.cpp
index 56cd82c..7c39de9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
 // CLASS HEADER
 #include <dali/internal/update/animation/scene-graph-constraint.h>
 
-// INTERNAL INCLUDES
-#include <dali/public-api/animation/active-constraint.h>
-
 namespace Dali
 {
 
@@ -35,12 +32,12 @@ namespace SceneGraph
   unsigned int ConstraintBase::mTotalInstanceCount   = 0;
 #endif
 
-ConstraintBase::ConstraintBase( PropertyOwnerContainer& ownerSet )
-: mWeight( Dali::ActiveConstraint::DEFAULT_WEIGHT ),
-  mRemoveAction( Dali::Constraint::DEFAULT_REMOVE_ACTION ),
+ConstraintBase::ConstraintBase( PropertyOwnerContainer& ownerSet, RemoveAction removeAction )
+: mRemoveAction( removeAction ),
   mFirstApply( true ),
   mDisconnected( true ),
-  mObservedOwners( ownerSet )
+  mObservedOwners( ownerSet ),
+  mLifecycleObserver( nullptr )
 {
 #ifdef DEBUG_ENABLED
   ++mCurrentInstanceCount;
@@ -55,18 +52,14 @@ ConstraintBase::~ConstraintBase()
     StopObservation();
   }
 
+  if( mLifecycleObserver != nullptr )
+  {
+    mLifecycleObserver->ObjectDestroyed();
+  }
+
 #ifdef DEBUG_ENABLED
   --mCurrentInstanceCount;
-#ifndef EMSCRIPTEN
-  memset ( &mWeight, 0xFA, sizeof(mWeight) ); // Fill with garbage pattern to help detect invalid memory access
 #endif
-#endif
-}
-
-void ConstraintBase::ResetDefaultProperties( BufferIndex updateBufferIndex )
-{
-  // Not used, since the weight property is reset by PropertyOwner
-  DALI_ASSERT_DEBUG( false );
 }
 
 unsigned int ConstraintBase::GetCurrentInstanceCount()