Merge "use modern construct '= default' for special functions." into devel/master
authorDavid Steele <david.steele@samsung.com>
Fri, 23 Oct 2020 10:32:46 +0000 (10:32 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 23 Oct 2020 10:32:46 +0000 (10:32 +0000)
1  2 
dali/internal/update/animation/scene-graph-animation.cpp
dali/internal/update/manager/transform-manager.cpp
dali/internal/update/manager/update-manager.h

@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * Copyright (c) 2019 Samsung Electronics Co., Ltd.
 + * Copyright (c) 2020 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.
@@@ -78,14 -78,11 +78,12 @@@ Animation::Animation( float durationSec
    mDisconnectAction(disconnectAction),
    mState(Stopped),
    mProgressReachedSignalRequired( false ),
 -  mAutoReverseEnabled( false )
 +  mAutoReverseEnabled( false ),
 +  mIsActive{ false }
  {
  }
  
- Animation::~Animation()
- {
- }
+ Animation::~Animation() = default;
  
  void Animation::operator delete( void* ptr )
  {
@@@ -427,8 -424,6 +425,8 @@@ void Animation::Update( BufferIndex buf
  
  void Animation::UpdateAnimators( BufferIndex bufferIndex, bool bake, bool animationFinished )
  {
 +  mIsActive[bufferIndex] = false;
 +
    const Vector2 playRange( mPlayRange * mDurationSeconds );
    float elapsedSecondsClamped = Clamp( mElapsedSeconds, playRange.x, playRange.y );
  
              progress = Clamp((elapsedSecondsClamped - intervalDelay) / animatorDuration, 0.0f , 1.0f );
            }
            animator->Update(bufferIndex, progress, bake);
 +
 +          if (animatorDuration > 0.0f && (elapsedSecondsClamped - intervalDelay) <= animatorDuration)
 +          {
 +            mIsActive[bufferIndex] = true;
 +          }
          }
          applied = true;
        }
@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * Copyright (c) 2018 Samsung Electronics Co., Ltd.
 + * Copyright (c) 2020 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.
@@@ -82,8 -82,7 +82,7 @@@ TransformManager::TransformManager(
   mReorder(false)
  {}
  
- TransformManager::~TransformManager()
- {}
+ TransformManager::~TransformManager() = default;
  
  TransformId TransformManager::CreateTransform()
  {
@@@ -229,10 -228,8 +228,10 @@@ void TransformManager::ResetToBaseValue
    }
  }
  
 -void TransformManager::Update()
 +bool TransformManager::Update()
  {
 +  bool componentsChanged = false;
 +
    if( mReorder )
    {
      //If some transform component has change its parent or has been removed since last update
      mBoundingSpheres[i] = mWorld[i].GetTranslation();
      mBoundingSpheres[i].w = Length( centerToEdgeWorldSpace );
  
 +    componentsChanged = componentsChanged || mComponentDirty[i];
      mComponentDirty[i] = false;
    }
 +
 +  return componentsChanged;
  }
  
  void TransformManager::SwapComponents( unsigned int i, unsigned int j )
@@@ -387,26 -381,31 +386,26 @@@ Vector3& TransformManager::GetVector3Pr
      case TRANSFORM_PROPERTY_POSITION:
      {
        TransformId index( mIds[id] );
 -      mComponentDirty[ index ] = true;
        return mTxComponentAnimatable[ index ].mPosition;
      }
      case TRANSFORM_PROPERTY_SCALE:
      {
        TransformId index( mIds[id] );
 -      mComponentDirty[ index ] = true;
        return mTxComponentAnimatable[ index ].mScale;
      }
      case TRANSFORM_PROPERTY_PARENT_ORIGIN:
      {
        TransformId index( mIds[id] );
 -      mComponentDirty[ index ] = true;
        return mTxComponentStatic[ index ].mParentOrigin;
      }
      case TRANSFORM_PROPERTY_ANCHOR_POINT:
      {
        TransformId index( mIds[id] );
 -      mComponentDirty[ index ] = true;
        return mTxComponentStatic[ index ].mAnchorPoint;
      }
      case TRANSFORM_PROPERTY_SIZE:
      {
        TransformId index( mIds[id] );
 -      mComponentDirty[ index ] = true;
        return mSize[ index ];
      }
      default:
@@@ -835,6 -834,7 +834,6 @@@ void TransformManager::BakeZVector3Prop
  Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id )
  {
    TransformId index( mIds[id] );
 -  mComponentDirty[ index ] = true;
    return mTxComponentAnimatable[ index ].mOrientation;
  }
  
@@@ -98,9 -98,7 +98,7 @@@ struct NodeDepthPai
  
  struct NodeDepths
  {
-   NodeDepths()
-   {
-   }
+   NodeDepths() = default;
  
    void Add( SceneGraph::Node* node, uint32_t sortedDepth )
    {
@@@ -646,14 -644,6 +644,14 @@@ public
    void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
  
    /**
 +   * Request to render the current frame
 +   * @note This is a temporary workaround (to be removed in the future) to request the rendering of
 +   *       the current frame if the color or visibility of any actor is updated. It MUST NOT be used
 +   *       for any other purposes.
 +   */
 +  void RequestRendering();
 +
 +  /**
     * Sets the depths of all layers.
     * @param layers The layers in depth order.
     * @param[in] rootLayer The root layer of the sorted layers.
@@@ -719,9 -709,8 +717,9 @@@ private
     * Perform animation updates
     * @param[in] bufferIndex to use
     * @param[in] elapsedSeconds time since last frame
 +   * @return true if at least one animations is currently active or false otherwise
     */
 -  void Animate( BufferIndex bufferIndex, float elapsedSeconds );
 +  bool Animate( BufferIndex bufferIndex, float elapsedSeconds );
  
    /**
     * Applies constraints to CustomObjects
@@@ -1119,17 -1108,6 +1117,17 @@@ inline void SetRenderingBehaviorMessage
    new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
  }
  
 +inline void RequestRenderingMessage( UpdateManager& manager )
 +{
 +  using LocalType = Message<UpdateManager>;
 +
 +  // Reserve some memory inside the message queue
 +  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 +
 +  // Construct message in the message queue memory; note that delete should not be called on the return value
 +  new (slot) LocalType( &manager, &UpdateManager::RequestRendering );
 +}
 +
  /**
   * Create a message for setting the depth of a layer
   * @param[in] manager The update manager
@@@ -1348,9 -1326,7 +1346,7 @@@ public
    /**
     * Virtual destructor
     */
-   ~IndexBufferMessage() override
-   {
-   }
+   ~IndexBufferMessage() override = default;
  
    /**
     * @copydoc MessageBase::Process