From fe966ea4b744b888cdee5f1e2e1e3b1a67ff1046 Mon Sep 17 00:00:00 2001 From: Kimmo Hoikka Date: Wed, 9 Dec 2015 13:44:31 +0000 Subject: [PATCH] Remove some dead code - double buffered property (not used) - property boolean (not used) Change-Id: I4a27c94b9acf292bce26d85baf7e11ce121c4a91 --- dali/internal/event/rendering/geometry-impl.cpp | 1 - dali/internal/event/rendering/renderer-impl.h | 1 - .../update/common/double-buffered-property.h | 376 --------------------- dali/internal/update/common/property-boolean.h | 131 ------- .../update/common/property-owner-messages.h | 82 ----- .../update/rendering/scene-graph-geometry.h | 2 - .../update/rendering/scene-graph-material.h | 1 - .../update/rendering/scene-graph-renderer.h | 4 - 8 files changed, 598 deletions(-) delete mode 100644 dali/internal/update/common/double-buffered-property.h delete mode 100644 dali/internal/update/common/property-boolean.h diff --git a/dali/internal/event/rendering/geometry-impl.cpp b/dali/internal/event/rendering/geometry-impl.cpp index 1ed06bb..4ee6fde 100644 --- a/dali/internal/event/rendering/geometry-impl.cpp +++ b/dali/internal/event/rendering/geometry-impl.cpp @@ -23,7 +23,6 @@ #include // Dali::Internal::ObjectHelper #include // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END -#include #include namespace Dali diff --git a/dali/internal/event/rendering/renderer-impl.h b/dali/internal/event/rendering/renderer-impl.h index 50b57a8..db1e13d 100644 --- a/dali/internal/event/rendering/renderer-impl.h +++ b/dali/internal/event/rendering/renderer-impl.h @@ -27,7 +27,6 @@ #include // Dali::Internal::Object #include // Dali::Internal::Material #include // Dali::Internal::Geometry -#include namespace Dali { diff --git a/dali/internal/update/common/double-buffered-property.h b/dali/internal/update/common/double-buffered-property.h deleted file mode 100644 index 0b23260..0000000 --- a/dali/internal/update/common/double-buffered-property.h +++ /dev/null @@ -1,376 +0,0 @@ -#ifndef __DALI_INTERNAL_SCENE_GRAPH_DOUBLE_BUFFERED_PROPERTY_H__ -#define __DALI_INTERNAL_SCENE_GRAPH_DOUBLE_BUFFERED_PROPERTY_H__ - -/* - * Copyright (c) 2015 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace SceneGraph -{ - -namespace DoubleBufferedPropertyFlags -{ -/** - * Dirty flags record whether a doubleBuffered property has changed. - * In the frame following a change, the property is copied from the most recent - * buffer to the old buffer. - */ -static const unsigned int CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame -static const unsigned int COPIED_FLAG = 0x01; ///< Indicates that the value was copied during the previous frame -static const unsigned int SET_FLAG = 0x02; ///< Indicates that the value was Set during the previous frame -} - -/** - * Base class to reduce code size from the templates. - */ -class DoubleBufferedPropertyBase : public PropertyInputImpl -{ -public: - - /** - * Constructor, initialize the dirty flag - */ - DoubleBufferedPropertyBase() - : PropertyInputImpl(), - mDirtyFlags( DoubleBufferedPropertyFlags::COPIED_FLAG ) - {} - - /** - * Virtual destructor. - */ - virtual ~DoubleBufferedPropertyBase() - {} - - /** - * Auto-age the property: if it was set the previous frame, - * then copy the value into the current frame's buffer. - */ - virtual void CopyPrevious( BufferIndex updateBufferIndex ) = 0; - - -protected: // for derived classes - /** - * Flag that the property has been Set during the current frame. - */ - void OnSet() - { - mDirtyFlags = DoubleBufferedPropertyFlags::SET_FLAG; - } - -public: // From PropertyBase - - /** - * @copydoc Dali::Internal::PropertyInputImpl::InputChanged() - */ - virtual bool InputChanged() const - { - return ( DoubleBufferedPropertyFlags::CLEAN_FLAG != mDirtyFlags ); - } - - /** - * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized() - */ - virtual bool InputInitialized() const - { - return true; // DoubleBuffered properties are always valid - } - -protected: // so that ResetToBaseValue can set it directly - - unsigned int mDirtyFlags; ///< Flag whether value changed during previous 2 frames - -}; - -/** - * A doubleBuffered property of a scene-graph object. - */ -template -class DoubleBufferedPropertyImpl : public DoubleBufferedPropertyBase -{ -public: - /** - * Create an doubleBuffered property. - * @param [in] initialValue The initial value of the property. - */ - DoubleBufferedPropertyImpl( typename ParameterType::PassingType initialValue ) - : mValue( initialValue ) - { - } - - /** - * Virtual destructor. - */ - virtual ~DoubleBufferedPropertyImpl() - { - } - - /** - * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType() - */ - virtual Dali::Property::Type GetType() const - { - return Dali::PropertyTypes::Get(); - } - - /** - * @copydoc Dali::Internal::SceneGraph::DoubleBufferedPropertyBase::CopyPrevious() - */ - virtual void CopyPrevious( BufferIndex updateBufferIndex ) - { - if( DoubleBufferedPropertyFlags::SET_FLAG == mDirtyFlags) - { - mValue[ updateBufferIndex ] = mValue[ 1-updateBufferIndex ]; - mDirtyFlags = ( mDirtyFlags >> 1 ); - } - } - - /** - * Set the property value. This will persist for the current frame, and will - * be copied to the other buffer next frame (unless it is set again) - * @param[in] bufferIndex The buffer to write. - * @param[in] value The new property value. - */ - void Set(BufferIndex bufferIndex, typename ParameterType::PassingType value ) - { - // check if the value actually changed to avoid dirtying nodes unnecessarily - if( mValue[bufferIndex] != value ) - { - mValue[bufferIndex] = value; - - OnSet(); - } - } - - /** - * @copydoc Dali::SceneGraph::DoubleBufferedProperty::Get() - */ - const T& Get(size_t bufferIndex) const - { - return mValue[bufferIndex]; - } - - /** - * Retrieve the property value. - * @param[in] bufferIndex The buffer to read. - * @return The property value. - */ - const T& operator[](size_t bufferIndex) const - { - return mValue[bufferIndex]; - } - -protected: - DoubleBuffered mValue; ///< The double-buffered property value - -private: // Undefined - DoubleBufferedPropertyImpl(const DoubleBufferedPropertyImpl& property); - DoubleBufferedPropertyImpl& operator=(const DoubleBufferedPropertyImpl& rhs); - -}; - -template -class DoubleBufferedProperty; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( bool value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetBoolean - */ - virtual const bool& GetBoolean( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( int value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetInteger - */ - virtual const int& GetInteger( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( float value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetFloat - */ - virtual const float& GetFloat( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Vector2& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetVector2 - */ - virtual const Vector2& GetVector2( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Vector3& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetVector3 - */ - virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Vector4& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetVector4 - */ - virtual const Vector4& GetVector4( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Quaternion& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetQuaternion - */ - virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Matrix3& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetMatrix3 - */ - virtual const Matrix3& GetMatrix3( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -template<> -class DoubleBufferedProperty : public DoubleBufferedPropertyImpl -{ -public: - /** - * Constructor - */ - DoubleBufferedProperty( const Matrix& value ) : DoubleBufferedPropertyImpl( value ) {}; - - /** - * copydoc PropertyInputImpl::GetMatrix - */ - virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const - { - return mValue[bufferIndex]; - } -}; - -} // namespace SceneGraph - -} // namespace Internal - -} // namespace Dali - -#endif // __DALI_INTERNAL_SCENE_GRAPH_DOUBLE_BUFFERED_PROPERTY_H__ diff --git a/dali/internal/update/common/property-boolean.h b/dali/internal/update/common/property-boolean.h deleted file mode 100644 index b166e83..0000000 --- a/dali/internal/update/common/property-boolean.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__ -#define __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__ - -/* - * Copyright (c) 2015 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// INTERNAL INCLUDES -#include -#include -#include -#include -#include -#include - -namespace Dali -{ - -namespace Internal -{ - -namespace SceneGraph -{ - -/** - * A Boolean non-animatable property. - */ -class PropertyBoolean : public PropertyInputImpl -{ -public: - - /** - * Create an non-animatable property. - * @param [in] initialValue The initial value of the property. - */ - PropertyBoolean( bool initialValue ) - : mValue( initialValue ), - mDirtyFlag( true ) - { - } - - /** - * Virtual destructor. - */ - virtual ~PropertyBoolean() - { - } - - /** - * Clear the dirty flag - */ - void Clear() - { - mDirtyFlag = false; - } - - /** - * @copydoc Dali::Internal::PropertyInputImpl::GetType() - */ - virtual Dali::Property::Type GetType() const - { - return Dali::PropertyTypes::Get(); - } - - /** - * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized() - */ - virtual bool InputInitialized() const - { - return true; - } - - /** - * @copydoc Dali::Internal::PropertyInputImpl::InputChanged() - */ - virtual bool InputChanged() const - { - return mDirtyFlag; - } - - /** - * @copydoc Dali::PropertyInput::GetBoolean() - */ - virtual const bool& GetBoolean( BufferIndex bufferIndex ) const - { - return mValue; - } - - /** - * Flag that the property has been Set during the current frame. - */ - void OnSet() - { - mDirtyFlag = true; - } - -private: - - // Undefined - PropertyBoolean(const PropertyBoolean& property); - - // Undefined - PropertyBoolean& operator=(const PropertyBoolean& rhs); - -public: - bool mValue; ///< The property value - -private: - bool mDirtyFlag; -}; - -} // namespace SceneGraph - -} // namespace Internal - -} // namespace Dali - -#endif // __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__ diff --git a/dali/internal/update/common/property-owner-messages.h b/dali/internal/update/common/property-owner-messages.h index 0b4e23b..c8570fb 100644 --- a/dali/internal/update/common/property-owner-messages.h +++ b/dali/internal/update/common/property-owner-messages.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -221,87 +220,6 @@ private: }; -/** - * Template class for sending messages to double buffered properties in a PropertyOwner - */ -template< typename P > -class DoubleBufferedPropertyMessage : public PropertyOwnerMessageBase -{ -public: - - typedef void(DoubleBufferedProperty

::*MemberFunction)( BufferIndex, typename ParameterType< P >::PassingType ); - - /** - * Create a message. - * @note The scene object is expected to be const in the thread which sends this message. - * However it can be modified when Process() is called in a different thread. - * @param[in] eventThreadServices The object used to send messages to the scene graph - * @param[in] sceneObject The property owner scene object - * @param[in] property The property to set. - * @param[in] member The member function of the object. - * @param[in] value The new value of the property. - */ - static void Send( EventThreadServices& eventThreadServices, - const PropertyOwner* sceneObject, - const DoubleBufferedProperty

* property, - MemberFunction member, - typename ParameterType< P >::PassingType value ) - { - // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( DoubleBufferedPropertyMessage ) ); - - // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) DoubleBufferedPropertyMessage( sceneObject, property, member, value ); - } - - /** - * Virtual destructor - */ - virtual ~DoubleBufferedPropertyMessage() - { - } - - /** - * @copydoc MessageBase::Process - */ - virtual void Process( BufferIndex updateBufferIndex ) - { - DALI_ASSERT_DEBUG( mProperty && "Message does not have an object" ); - (mProperty->*mMemberFunction)( updateBufferIndex, - ParameterType< P >::PassObject( mParam ) ); - } - -private: - - /** - * Create a message. - * @note The property owner is expected to be const in the thread which sends this message. - * However it can be modified when Process() is called in a different thread. - * @param[in] sceneObject the property owner scene object - * @param[in] property The property to set. - * @param[in] member The member function of the object. - * @param[in] value The new value of the property. - */ - DoubleBufferedPropertyMessage( const PropertyOwner* sceneObject, - const DoubleBufferedProperty

* property, - MemberFunction member, - typename ParameterType< P >::PassingType value ) - : PropertyOwnerMessageBase(), - mSceneObject( const_cast< PropertyOwner* >( sceneObject ) ), - mProperty( const_cast< DoubleBufferedProperty

* >( property ) ), - mMemberFunction( member ), - mParam( value ) - { - } - -private: - PropertyOwner* mSceneObject; - DoubleBufferedProperty

* mProperty; - MemberFunction mMemberFunction; - typename ParameterType< P >::HolderType mParam; -}; - - // Messages for PropertyOwner inline void InstallCustomPropertyMessage( EventThreadServices& eventThreadServices, const PropertyOwner& owner, PropertyBase* property ) diff --git a/dali/internal/update/rendering/scene-graph-geometry.h b/dali/internal/update/rendering/scene-graph-geometry.h index 4e58fba..b4eddac 100644 --- a/dali/internal/update/rendering/scene-graph-geometry.h +++ b/dali/internal/update/rendering/scene-graph-geometry.h @@ -21,9 +21,7 @@ #include #include #include -#include #include -#include #include #include #include diff --git a/dali/internal/update/rendering/scene-graph-material.h b/dali/internal/update/rendering/scene-graph-material.h index f67ac52..29fa429 100644 --- a/dali/internal/update/rendering/scene-graph-material.h +++ b/dali/internal/update/rendering/scene-graph-material.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/dali/internal/update/rendering/scene-graph-renderer.h b/dali/internal/update/rendering/scene-graph-renderer.h index 0c16aed..b2a4517 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.h +++ b/dali/internal/update/rendering/scene-graph-renderer.h @@ -20,11 +20,7 @@ #include #include -#include -#include -#include #include -#include #include #include #include -- 2.7.4