summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorChu Hoang <c.hoang@samsung.com>2015-11-13 14:04:38 +0000
committerChu Hoang <c.hoang@samsung.com>2015-11-13 14:04:38 +0000
commit4d6f7ab7679e71e99c9c196b684d14cbfc85213d (patch)
tree66d82cc1cfbb34cbfbfba324810cb75c4e6efec0 /demo
parent9469a93437f1a6a896c2be5911d604ea9048c703 (diff)
downloaddali-demo-4d6f7ab7679e71e99c9c196b684d14cbfc85213d.tar.gz
dali-demo-4d6f7ab7679e71e99c9c196b684d14cbfc85213d.tar.bz2
dali-demo-4d6f7ab7679e71e99c9c196b684d14cbfc85213d.zip
Changed dali demo table to use custom shaders for the stencil 9-patch image.
Updated the item-background-9.png to look nicer. Change-Id: Ied0c432abac9448dfe6c34bc594358e0334fa7fd
Diffstat (limited to 'demo')
-rw-r--r--demo/dali-table-view.cpp20
-rw-r--r--demo/dali-table-view.h2
2 files changed, 10 insertions, 12 deletions
diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp
index ecfd9ed3..e1ff174a 100644
--- a/demo/dali-table-view.cpp
+++ b/demo/dali-table-view.cpp
@@ -465,7 +465,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
content.Add( image );
// Add stencil
- ImageActor stencil = NewStencilImage();
+ Toolkit::ImageView stencil = NewStencilImage();
stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
image.Add( stencil );
}
@@ -490,20 +490,18 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
return content;
}
-ImageActor DaliTableView::NewStencilImage()
+Toolkit::ImageView DaliTableView::NewStencilImage()
{
- Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA );
+ Toolkit::ImageView stencil = ImageView::New( TILE_BACKGROUND_ALPHA );
- ImageActor stencilActor = ImageActor::New( alpha );
+ stencil.SetParentOrigin( ParentOrigin::CENTER );
+ stencil.SetAnchorPoint( AnchorPoint::CENTER );
+ stencil.SetDrawMode( DrawMode::STENCIL );
- stencilActor.SetParentOrigin( ParentOrigin::CENTER );
- stencilActor.SetAnchorPoint( AnchorPoint::CENTER );
- stencilActor.SetDrawMode( DrawMode::STENCIL );
+ Property::Map shaderEffect = CreateAlphaDiscardEffect();
+ stencil.SetProperty( Toolkit::ImageView::Property::IMAGE, shaderEffect );
- Dali::ShaderEffect shaderEffect = CreateAlphaDiscardEffect();
- stencilActor.SetShaderEffect( shaderEffect );
-
- return stencilActor;
+ return stencil;
}
bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
diff --git a/demo/dali-table-view.h b/demo/dali-table-view.h
index 33c0e9bd..aa2a4698 100644
--- a/demo/dali-table-view.h
+++ b/demo/dali-table-view.h
@@ -151,7 +151,7 @@ private: // Application callbacks & implementation
*
* @return The stencil image
*/
- Dali::ImageActor NewStencilImage();
+ Dali::Toolkit::ImageView NewStencilImage();
// Signal handlers