X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Fscene-graph-frame-callback.h;h=4d3a061ebae39818e80e94471b2e01859fc5d74f;hb=refs%2Fchanges%2F71%2F265971%2F3;hp=2f876e24144ed487e300f7a1608d5d41ce144e05;hpb=2331505c12081d7fae9b6a9a5d744670ec166b32;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/manager/scene-graph-frame-callback.h b/dali/internal/update/manager/scene-graph-frame-callback.h index 2f876e2..4d3a061 100644 --- a/dali/internal/update/manager/scene-graph-frame-callback.h +++ b/dali/internal/update/manager/scene-graph-frame-callback.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -30,13 +30,10 @@ namespace Dali { - namespace Internal { - namespace SceneGraph { - class Node; class TransformManager; @@ -47,18 +44,17 @@ class TransformManager; class FrameCallback final : public PropertyOwner::Observer { public: - /** * Creates a new FrameCallback. * @param[in] frameCallbackInterface A reference to the FrameCallbackInterface implementation * @return A new FrameCallback. */ - static FrameCallback* New( FrameCallbackInterface& frameCallbackInterface ); + static FrameCallback* New(FrameCallbackInterface& frameCallbackInterface); /** * Non-virtual Destructor. */ - ~FrameCallback(); + ~FrameCallback() override; /** * Called from the update-thread when connecting to the scene-graph. @@ -66,14 +62,14 @@ public: * @param[in] transformManager The Transform Manager * @param[in] rootNode The rootNode of this frame-callback */ - void ConnectToSceneGraph( UpdateManager& updateManager, TransformManager& transformManager, Node& rootNode ); + void ConnectToSceneGraph(UpdateManager& updateManager, TransformManager& transformManager, Node& rootNode); // Movable but not copyable - FrameCallback( const FrameCallback& ) = delete; ///< Deleted copy constructor. - FrameCallback( FrameCallback&& ) = default; ///< Default move constructor. - FrameCallback& operator=( const FrameCallback& ) = delete; ///< Deleted copy assignment operator. - FrameCallback& operator=( FrameCallback&& ) = default; ///< Default move assignment operator. + FrameCallback(const FrameCallback&) = delete; ///< Deleted copy constructor. + FrameCallback(FrameCallback&&) = default; ///< Default move constructor. + FrameCallback& operator=(const FrameCallback&) = delete; ///< Deleted copy assignment operator. + FrameCallback& operator=(FrameCallback&&) = default; ///< Default move assignment operator. /** * Called from the update-thread after the scene has been updated, and is ready to render. @@ -82,7 +78,7 @@ public: * @param[in] nodeHierarchyChanged Whether the node hierarchy has changed * @return Whether to continue calling this FrameCallback or not. */ - bool Update( BufferIndex bufferIndex, float elapsedSeconds, bool nodeHierarchyChanged ); + bool Update(BufferIndex bufferIndex, float elapsedSeconds, bool nodeHierarchyChanged); /** * Invalidates this FrameCallback and will no longer be associated with the FrameCallbackInterface. @@ -95,31 +91,34 @@ public: * @param[in] iFace The FrameCallbackInterface pointer to compare with * @return True if iFace matches our internally stored FrameCallbackInterface. */ - inline bool operator==( const FrameCallbackInterface* iFace ) + inline bool operator==(const FrameCallbackInterface* iFace) { return mFrameCallbackInterface == iFace; } private: - // From PropertyOwner::Observer /** * @copydoc PropertyOwner::Observer::PropertyOwnerConnected() */ - virtual void PropertyOwnerConnected( PropertyOwner& owner ) { /* Nothing to do */ } + void PropertyOwnerConnected(PropertyOwner& owner) override + { /* Nothing to do */ + } /** * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected() */ - virtual void PropertyOwnerDisconnected( BufferIndex updateBufferIndex, PropertyOwner& owner ) { /* Nothing to do */ } + void PropertyOwnerDisconnected(BufferIndex updateBufferIndex, PropertyOwner& owner) override + { /* Nothing to do */ + } /** * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected() * * Will use this to disconnect the frame-callback if the accompanying node is destroyed */ - virtual void PropertyOwnerDestroyed( PropertyOwner& owner ); + void PropertyOwnerDestroyed(PropertyOwner& owner) override; // Construction @@ -127,13 +126,13 @@ private: * Constructor. * @param[in] frameCallbackInterface A pointer to the FrameCallbackInterface implementation */ - FrameCallback( FrameCallbackInterface* frameCallbackInterface ); + FrameCallback(FrameCallbackInterface* frameCallbackInterface); private: - - Mutex mMutex; - std::unique_ptr< UpdateProxy > mUpdateProxy{ nullptr }; ///< A unique pointer to the implementation of the UpdateProxy. - FrameCallbackInterface* mFrameCallbackInterface; + Mutex mMutex; + std::unique_ptr mUpdateProxy{nullptr}; ///< A unique pointer to the implementation of the UpdateProxy. + FrameCallbackInterface* mFrameCallbackInterface; + bool mValid{true}; ///< Set to false when Invalidate() is called. }; /** @@ -142,7 +141,7 @@ private: * @param[in] iFace The FrameCallbackInterface pointer * @return True if iFace matches the internally stored FrameCallbackInterface. */ -inline bool operator==( const OwnerPointer< FrameCallback >& frameCallback, const FrameCallbackInterface* iFace ) +inline bool operator==(const OwnerPointer& frameCallback, const FrameCallbackInterface* iFace) { return *frameCallback == iFace; }