projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Dali-Text: Keyboard Shortcuts" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
animated-image
/
animated-image-visual.h
diff --git
a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
index
5c9b31c
..
8e91623
100644
(file)
--- a/
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
+++ b/
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
@@
-2,7
+2,7
@@
#define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_H
/*
#define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_H
/*
- * Copyright (c) 20
17
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-24,12
+24,14
@@
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/weak-handle.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/weak-handle.h>
#include <dali/public-api/adaptor-framework/timer.h>
-#include <dali/devel-api/adaptor-framework/
gif
-loading.h>
+#include <dali/devel-api/adaptor-framework/
animated-image
-loading.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
+#include <dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
namespace Dali
{
namespace Dali
{
@@
-40,6
+42,7
@@
namespace Toolkit
namespace Internal
{
namespace Internal
{
+class ImageVisualShaderFactory;
class AnimatedImageVisual;
typedef IntrusivePtr< AnimatedImageVisual > AnimatedImageVisualPtr;
class AnimatedImageVisual;
typedef IntrusivePtr< AnimatedImageVisual > AnimatedImageVisualPtr;
@@
-89,46
+92,54
@@
public:
* @brief Create the animated image Visual using the image URL.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @brief Create the animated image Visual using the image URL.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
- * @param[in] imageUrl The URL to gif resource to use
+ * @param[in] shaderFactory The ImageVisualShaderFactory object
+ * @param[in] imageUrl The URL to animated image resource to use
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl, const Property::Map& properties );
+ static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache,
ImageVisualShaderFactory& shaderFactory,
const VisualUrl& imageUrl, const Property::Map& properties );
/**
* @brief Create the animated image Visual using image URLs.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
/**
* @brief Create the animated image Visual using image URLs.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] shaderFactory The ImageVisualShaderFactory object
* @param[in] imageUrls A Property::Array containing the URLs to the image resources
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
* @param[in] imageUrls A Property::Array containing the URLs to the image resources
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const Property::Array& imageUrls, const Property::Map& properties );
+ static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache,
ImageVisualShaderFactory& shaderFactory,
const Property::Array& imageUrls, const Property::Map& properties );
/**
* @brief Create the animated image visual using the image URL.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
/**
* @brief Create the animated image visual using the image URL.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] shaderFactory The ImageVisualShaderFactory object
* @param[in] imageUrl The URL to animated image resource to use
*/
* @param[in] imageUrl The URL to animated image resource to use
*/
- static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl );
+ static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache,
ImageVisualShaderFactory& shaderFactory,
const VisualUrl& imageUrl );
public: // from Visual
/**
* @copydoc Visual::Base::GetNaturalSize
*/
public: // from Visual
/**
* @copydoc Visual::Base::GetNaturalSize
*/
- v
irtual void GetNaturalSize( Vector2& naturalSize )
;
+ v
oid GetNaturalSize( Vector2& naturalSize ) override
;
/**
* @copydoc Visual::Base::CreatePropertyMap
*/
/**
* @copydoc Visual::Base::CreatePropertyMap
*/
- v
irtual void DoCreatePropertyMap( Property::Map& map ) const
;
+ v
oid DoCreatePropertyMap( Property::Map& map ) const override
;
/**
* @copydoc Visual::Base::CreateInstancePropertyMap
*/
/**
* @copydoc Visual::Base::CreateInstancePropertyMap
*/
- virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+ void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+
+ /**
+ * @copydoc Visual::Base::OnDoAction
+ */
+ void OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes ) override;
protected:
protected:
@@
-136,18
+147,19
@@
protected:
* @brief Constructor.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @brief Constructor.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] shaderFactory The ImageVisualShaderFactory object
*/
*/
- AnimatedImageVisual( VisualFactoryCache& factoryCache );
+ AnimatedImageVisual( VisualFactoryCache& factoryCache
, ImageVisualShaderFactory& shaderFactory
);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
-
virtual ~AnimatedImageVisual()
;
+
~AnimatedImageVisual() override
;
/**
* @copydoc Visual::Base::DoSetProperties
*/
/**
* @copydoc Visual::Base::DoSetProperties
*/
- v
irtual void DoSetProperties( const Property::Map& propertyMap )
;
+ v
oid DoSetProperties( const Property::Map& propertyMap ) override
;
/**
* Helper method to set individual values by index key.
/**
* Helper method to set individual values by index key.
@@
-157,19
+169,19
@@
protected:
void DoSetProperty( Property::Index index, const Property::Value& value );
/**
void DoSetProperty( Property::Index index, const Property::Value& value );
/**
- * @copydoc Visual::Base::DoSetOnS
tag
e
+ * @copydoc Visual::Base::DoSetOnS
cen
e
*/
*/
- v
irtual void DoSetOnStage( Actor& actor )
;
+ v
oid DoSetOnScene( Actor& actor ) override
;
/**
/**
- * @copydoc Visual::Base::DoSetOffS
tag
e
+ * @copydoc Visual::Base::DoSetOffS
cen
e
*/
*/
- v
irtual void DoSetOffStage( Actor& actor )
;
+ v
oid DoSetOffScene( Actor& actor ) override
;
/**
* @copydoc Visual::Base::OnSetTransform
*/
/**
* @copydoc Visual::Base::OnSetTransform
*/
- v
irtual void OnSetTransform()
;
+ v
oid OnSetTransform() override
;
private:
/**
private:
/**
@@
-204,7
+216,7
@@
private:
* Called when the next frame is ready.
* @param[in] textureSet the texture set to apply
*/
* Called when the next frame is ready.
* @param[in] textureSet the texture set to apply
*/
- void FrameReady( TextureSet textureSet );
+ void FrameReady( TextureSet textureSet )
override
;
/**
* Display the next frame. It is called when the mFrameDelayTimer ticks.
/**
* Display the next frame. It is called when the mFrameDelayTimer ticks.
@@
-213,10
+225,10
@@
private:
bool DisplayNextFrame();
/**
bool DisplayNextFrame();
/**
- * Initialize the
gif
variables.
- * @param[in] imageUrl The url of the animated
gif
+ * Initialize the
animated image
variables.
+ * @param[in] imageUrl The url of the animated
image
*/
*/
- void Initialize
Gif
( const VisualUrl& imageUrl );
+ void Initialize
AnimatedImage
( const VisualUrl& imageUrl );
// Undefined
AnimatedImageVisual( const AnimatedImageVisual& animatedImageVisual );
// Undefined
AnimatedImageVisual( const AnimatedImageVisual& animatedImageVisual );
@@
-228,12
+240,12
@@
private:
Timer mFrameDelayTimer;
WeakHandle<Actor> mPlacementActor;
Timer mFrameDelayTimer;
WeakHandle<Actor> mPlacementActor;
+ ImageVisualShaderFactory& mImageVisualShaderFactory;
- // Variables for GIF player
- Dali::Vector<uint32_t> mFrameDelayContainer;
+ // Variables for Animated Image player
Vector4 mPixelArea;
VisualUrl mImageUrl;
Vector4 mPixelArea;
VisualUrl mImageUrl;
- std::unique_ptr<Dali::GifLoading> mGifLoading; // Only needed for animated gifs
+ Dali::AnimatedImageLoading mAnimatedImageLoading; // Only needed for animated image
uint32_t mCurrentFrameIndex; // Frame index into textureRects
// Variables for Multi-Image player
uint32_t mCurrentFrameIndex; // Frame index into textureRects
// Variables for Multi-Image player
@@
-242,6
+254,8
@@
private:
uint16_t mCacheSize;
uint16_t mBatchSize;
uint16_t mFrameDelay;
uint16_t mCacheSize;
uint16_t mBatchSize;
uint16_t mFrameDelay;
+ int16_t mLoopCount;
+ int16_t mCurrentLoopIndex;
uint16_t mUrlIndex;
// Shared variables
uint16_t mUrlIndex;
// Shared variables
@@
-250,7
+264,10
@@
private:
Dali::WrapMode::Type mWrapModeU:3;
Dali::WrapMode::Type mWrapModeV:3;
Dali::WrapMode::Type mWrapModeU:3;
Dali::WrapMode::Type mWrapModeV:3;
+ DevelAnimatedImageVisual::Action::Type mActionStatus:3;
+ DevelImageVisual::StopBehavior::Type mStopBehavior:2;
bool mStartFirstFrame:1;
bool mStartFirstFrame:1;
+ bool mIsJumpTo:1;
};
} // namespace Internal
};
} // namespace Internal