Commit ce805e44735e15d6b3970423317cc2678bf30ae1

Authored by Kimmo Hoikka
Committed by Gerrit Code Review
2 parents 3e792bb4 4d6f7ab7

Merge "Changed dali demo table to use custom shaders for the stencil 9-patch ima…

…ge." into devel/master
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
... ... @@ -151,7 +151,7 @@ private: // Application callbacks & implementation
151 151 *
152 152 * @return The stencil image
153 153 */
154   - Dali::ImageActor NewStencilImage();
  154 + Dali::Toolkit::ImageView NewStencilImage();
155 155  
156 156 // Signal handlers
157 157  
... ...
resources/images/item-background-alpha.9.png

385 Bytes | W: | H:

254 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin