- The value is only stored so that it can be returned in the getter.
- Internally, we do not support any other style apart from STYLE_QUAD.
Change-Id: Ifad7dbfd60bbaa6761a8c0fe4c4e76ab1ba457c3
ImageActor actor = ImageActor::New(image);
actor.SetStyle(ImageActor::STYLE_NINE_PATCH);
- DALI_TEST_EQUALS( ImageActor::STYLE_QUAD, actor.GetStyle(), TEST_LOCATION ); //nine patch is deprecated
+ DALI_TEST_EQUALS( ImageActor::STYLE_NINE_PATCH, actor.GetStyle(), TEST_LOCATION );
Vector4 border(0.1,0.2,0.3,0.4);
actor.SetNinePatchBorder(border);
- //nine patch is deprecated
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().x, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().y, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().z, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().w, TEST_LOCATION );
+ DALI_TEST_EQUALS( 0.1f, actor.GetNinePatchBorder().x, TEST_LOCATION );
+ DALI_TEST_EQUALS( 0.2f, actor.GetNinePatchBorder().y, TEST_LOCATION );
+ DALI_TEST_EQUALS( 0.3f, actor.GetNinePatchBorder().z, TEST_LOCATION );
+ DALI_TEST_EQUALS( 0.4f, actor.GetNinePatchBorder().w, TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-int UtcDaliImageGetStyle(void)
+int UtcDaliImageActorGetStyle(void)
{
TestApplication application;
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( ImageActor::STYLE_QUAD, actor.GetStyle(), TEST_LOCATION ); //nine patch is deprecated
+ DALI_TEST_EQUALS( ImageActor::STYLE_NINE_PATCH, actor.GetStyle(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliImageSetNinePatchBorder(void)
+int UtcDaliImageActorSetNinePatchBorder(void)
{
TestApplication application;
ImageActor actor = ImageActor::New(image);
actor.SetStyle(ImageActor::STYLE_NINE_PATCH);
- DALI_TEST_EQUALS( ImageActor::STYLE_QUAD, actor.GetStyle(), TEST_LOCATION ); //nine patch is deprecated
+ DALI_TEST_EQUALS( ImageActor::STYLE_NINE_PATCH, actor.GetStyle(), TEST_LOCATION );
actor.SetNinePatchBorder(Vector4( 1.0f, 2.0f, 3.0f, 4.0f));
- //nine patch is deprecated
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().x, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().y, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().z, TEST_LOCATION );
- DALI_TEST_EQUALS( 0.0f, actor.GetNinePatchBorder().w, TEST_LOCATION );
+ DALI_TEST_EQUALS( 1.0f, actor.GetNinePatchBorder().x, TEST_LOCATION );
+ DALI_TEST_EQUALS( 2.0f, actor.GetNinePatchBorder().y, TEST_LOCATION );
+ DALI_TEST_EQUALS( 3.0f, actor.GetNinePatchBorder().z, TEST_LOCATION );
+ DALI_TEST_EQUALS( 4.0f, actor.GetNinePatchBorder().w, TEST_LOCATION );
END_TEST;
}
UpdateTexureRect();
}
+void ImageActor::SetStyle( Dali::ImageActor::Style style )
+{
+ DALI_LOG_WARNING( "SetStyle Deprecated. Only STYLE_QUAD supported." );
+ mStyle = style;
+}
+
+Dali::ImageActor::Style ImageActor::GetStyle() const
+{
+ DALI_LOG_WARNING( "GetStyle Deprecated. Only STYLE_QUAD supported." );
+ return mStyle;
+}
+
+void ImageActor::SetNinePatchBorder( const Vector4& border )
+{
+ DALI_LOG_WARNING( "SetNinePatchBorder Deprecated. Only STYLE_QUAD supported." );
+ mNinePatchBorder = border;
+}
+
+Vector4 ImageActor::GetNinePatchBorder() const
+{
+ DALI_LOG_WARNING( "GetNinePatchBorder Deprecated. Only STYLE_QUAD supported." );
+ return mNinePatchBorder;
+}
+
ImageActor::ImageActor()
: Actor( Actor::BASIC ),
mGridSize( 1u, 1u ),
mEffectTextureIndex( INVALID_TEXTURE_ID ),
mMinFilter( FilterMode::DEFAULT ),
mMagFilter( FilterMode::DEFAULT ),
+ mStyle( Dali::ImageActor::STYLE_QUAD ),
mIsPixelAreaSet( false )
{
}
void ClearPixelArea();
/**
+ * @copydoc Dali::ImageActor::SetStyle()
+ */
+ void SetStyle( Dali::ImageActor::Style style );
+
+ /**
+ * @copydoc Dali::ImageActor::GetStyle()
+ */
+ Dali::ImageActor::Style GetStyle() const;
+
+ /**
+ * @copydoc Dali::ImageActor::SetNinePatchBorder()
+ */
+ void SetNinePatchBorder( const Vector4& border );
+
+ /**
+ * @copydoc Dali::ImageActor::GetNinePatchBorder()
+ */
+ Vector4 GetNinePatchBorder() const;
+
+ /**
* @copydoc Dali::RenderableActor::SetSortModifier()
*/
void SetSortModifier(float modifier);
private:
- ShaderEffectPtr mShaderEffect; ///< Optional referenced shader effect
- RendererPtr mRenderer; ///< The renderer used to render the image
- PixelArea mPixelArea; ///< The pixel area of the image to render
- Vector4 mBlendColor; ///< The blend color for this ImageActor
- Uint16Pair mGridSize; ///< The geometry grid size
- int mRendererIndex; ///< The index location of mRenderer
- size_t mTextureIndex; ///< The texture index for this ImageActor's texture
- size_t mEffectTextureIndex; ///< The texture index for this ImageActor's effect texture
- FilterMode::Type mMinFilter; ///< The minification filter currently set
- FilterMode::Type mMagFilter; ///< The magnification filter currently set
- bool mIsPixelAreaSet; ///< Flag indicating if the pixel area has been set
+ ShaderEffectPtr mShaderEffect; ///< Optional referenced shader effect
+ RendererPtr mRenderer; ///< The renderer used to render the image
+ PixelArea mPixelArea; ///< The pixel area of the image to render
+ Vector4 mBlendColor; ///< The blend color for this ImageActor
+ Vector4 mNinePatchBorder; ///< Nine-patch not supported, but this is used to store what is set so it can be returned for backwards compatibility.
+ Uint16Pair mGridSize; ///< The geometry grid size
+ int mRendererIndex; ///< The index location of mRenderer
+ size_t mTextureIndex; ///< The texture index for this ImageActor's texture
+ size_t mEffectTextureIndex; ///< The texture index for this ImageActor's effect texture
+ FilterMode::Type mMinFilter; ///< The minification filter currently set
+ FilterMode::Type mMagFilter; ///< The magnification filter currently set
+ Dali::ImageActor::Style mStyle; ///< The style set by SetStyle. Not used internally, only used to store what is set so it can be returned for backwards compatibility.
+ bool mIsPixelAreaSet; ///< Flag indicating if the pixel area has been set
};
} // namespace Internal
void ImageActor::SetStyle(Style style)
{
- //deprecated - use ImageView instead for nine patch
+ GetImplementation(*this).SetStyle( style );
}
ImageActor::Style ImageActor::GetStyle() const
{
- //deprecated - use ImageView instead for nine patch
- return ImageActor::STYLE_QUAD;
+ return GetImplementation(*this).GetStyle();
}
void ImageActor::SetNinePatchBorder(const Vector4& border)
{
- //deprecated - use ImageView instead for nine patch
+ GetImplementation(*this).SetNinePatchBorder( border );
}
Vector4 ImageActor::GetNinePatchBorder() const
{
- //deprecated - use ImageView instead for nine patch
- return Vector4::ZERO;
+ return GetImplementation(*this).GetNinePatchBorder();
}
void ImageActor::SetSortModifier(float modifier)
*
* @pre image must be initialized.
* @param [in] style The new style.
+ *
+ * @note The style specified is set (so GetStyle will return what's set) but ignored internally.
*/
void SetStyle(Style style);
*
* @pre image must be initialized.
* @return The rendering style.
+ *
+ * @note This just returns the style set by SetStyle. In reality, only STYLE_QUAD is supported.
*/
Style GetStyle() const;