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 Version 2.0.5" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
gradient
/
gradient-visual.h
diff --git
a/dali-toolkit/internal/visuals/gradient/gradient-visual.h
b/dali-toolkit/internal/visuals/gradient/gradient-visual.h
index
1726c51
..
71ae1d6
100644
(file)
--- a/
dali-toolkit/internal/visuals/gradient/gradient-visual.h
+++ b/
dali-toolkit/internal/visuals/gradient/gradient-visual.h
@@
-2,7
+2,7
@@
#define DALI_TOOLKIT_INTERNAL_GRADIENT_VISUAL_H
/*
#define DALI_TOOLKIT_INTERNAL_GRADIENT_VISUAL_H
/*
- * Copyright (c) 201
5
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
9
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.
@@
-18,6
+18,9
@@
*
*/
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/gradient/gradient.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/gradient/gradient.h>
@@
-33,6
+36,8
@@
namespace Internal
{
class Gradient;
{
class Gradient;
+class GradientVisual;
+typedef IntrusivePtr< GradientVisual > GradientVisualPtr;
/**
* The visual which renders smooth transition of colors to the control's quad.
/**
* The visual which renders smooth transition of colors to the control's quad.
@@
-80,49
+85,59
@@
public:
};
/**
};
/**
- * @brief C
onstructor
.
+ * @brief C
reate a new gradient visual
.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] properties A Property::Map containing settings for this visual
+ * @return A smart-pointer to the newly allocated visual.
*/
*/
- GradientVisual( VisualFactoryCache& factoryCache );
+ static GradientVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
+
+public: // from Visual
/**
/**
- * @
brief A reference counted object may only be deleted by calling Unreference().
+ * @
copydoc Visual::Base::CreatePropertyMap
*/
*/
-
~GradientVisual()
;
+
void DoCreatePropertyMap( Property::Map& map ) const override
;
-public: // from Visual
+ /**
+ * @copydoc Visual::Base::CreateInstancePropertyMap
+ */
+ void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+
+protected:
/**
/**
- * @copydoc Visual::Base::SetSize
+ * @brief Constructor.
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
*/
-
virtual void SetSize( const Vector2& siz
e );
+
GradientVisual( VisualFactoryCache& factoryCach
e );
/**
/**
- * @
copydoc Visual::Base::CreatePropertyMap
+ * @
brief A reference counted object may only be deleted by calling Unreference().
*/
*/
- virtual
void DoCreatePropertyMap( Property::Map& map ) const
;
+ virtual
~GradientVisual()
;
/**
/**
- * @copydoc Visual::Base::DoSetPropert
y
+ * @copydoc Visual::Base::DoSetPropert
ies
*/
*/
- v
irtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue )
;
+ v
oid DoSetProperties( const Property::Map& propertyMap ) override
;
/**
/**
- * @copydoc Visual::Base::
DoGetProperty
+ * @copydoc Visual::Base::
OnSetTransform
*/
*/
- v
irtual Dali::Property::Value DoGetProperty( Dali::Property::Index index )
;
+ v
oid OnSetTransform() override
;
-protected:
/**
/**
- * @copydoc Visual::Base::Do
Initializ
e
+ * @copydoc Visual::Base::Do
SetOnScen
e
*/
*/
- v
irtual void DoInitialize( Actor& actor, const Property::Map& propertyMap )
;
+ v
oid DoSetOnScene( Actor& actor ) override
;
/**
/**
- * @copydoc Visual::Base::
DoSetOnStage
+ * @copydoc Visual::Base::
UpdateShader
*/
*/
- v
irtual void DoSetOnStage( Actor& actor )
;
+ v
oid UpdateShader() override
;
private:
private:
@@
-139,6
+154,12
@@
private:
bool NewGradient(Type gradientType, const Property::Map& propertyMap);
/**
bool NewGradient(Type gradientType, const Property::Map& propertyMap);
/**
+ * @brief Get a shader for the current properties.
+ * @return The shader for the current properties.
+ */
+ Shader GetShader();
+
+ /**
* Get the stop-offsets from the property.
* The valid property type are ARRAY, VECTOR2, VECTOR3, VECTOR4.
*
* Get the stop-offsets from the property.
* The valid property type are ARRAY, VECTOR2, VECTOR3, VECTOR4.
*
@@
-158,6
+179,7
@@
private:
Matrix3 mGradientTransform;
IntrusivePtr<Gradient> mGradient;
Type mGradientType;
Matrix3 mGradientTransform;
IntrusivePtr<Gradient> mGradient;
Type mGradientType;
+ bool mIsOpaque; ///< Set to false if any of the stop colors are not opaque
};
} // namespace Internal
};
} // namespace Internal