Commit ce805e44735e15d6b3970423317cc2678bf30ae1
Committed by
Gerrit Code Review
Merge "Changed dali demo table to use custom shaders for the stencil 9-patch ima…
…ge." into devel/master
Showing
3 changed files
with
10 additions
and
12 deletions
demo/dali-table-view.cpp
| ... | ... | @@ -465,7 +465,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 465 | 465 | content.Add( image ); |
| 466 | 466 | |
| 467 | 467 | // Add stencil |
| 468 | - ImageActor stencil = NewStencilImage(); | |
| 468 | + Toolkit::ImageView stencil = NewStencilImage(); | |
| 469 | 469 | stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); |
| 470 | 470 | image.Add( stencil ); |
| 471 | 471 | } |
| ... | ... | @@ -490,20 +490,18 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 490 | 490 | return content; |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | -ImageActor DaliTableView::NewStencilImage() | |
| 493 | +Toolkit::ImageView DaliTableView::NewStencilImage() | |
| 494 | 494 | { |
| 495 | - Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA ); | |
| 495 | + Toolkit::ImageView stencil = ImageView::New( TILE_BACKGROUND_ALPHA ); | |
| 496 | 496 | |
| 497 | - ImageActor stencilActor = ImageActor::New( alpha ); | |
| 497 | + stencil.SetParentOrigin( ParentOrigin::CENTER ); | |
| 498 | + stencil.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 499 | + stencil.SetDrawMode( DrawMode::STENCIL ); | |
| 498 | 500 | |
| 499 | - stencilActor.SetParentOrigin( ParentOrigin::CENTER ); | |
| 500 | - stencilActor.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 501 | - stencilActor.SetDrawMode( DrawMode::STENCIL ); | |
| 501 | + Property::Map shaderEffect = CreateAlphaDiscardEffect(); | |
| 502 | + stencil.SetProperty( Toolkit::ImageView::Property::IMAGE, shaderEffect ); | |
| 502 | 503 | |
| 503 | - Dali::ShaderEffect shaderEffect = CreateAlphaDiscardEffect(); | |
| 504 | - stencilActor.SetShaderEffect( shaderEffect ); | |
| 505 | - | |
| 506 | - return stencilActor; | |
| 504 | + return stencil; | |
| 507 | 505 | } |
| 508 | 506 | |
| 509 | 507 | bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event ) | ... | ... |
demo/dali-table-view.h
resources/images/item-background-alpha.9.png