Commit fc74c49e34fbe0ba1dc3c5d86302e5cd3436e2ac

Authored by Lee Morgan
2 parents eaa55256 c0dcb9c9

[dali_1.1.7] Merge branch 'devel/master'

Change-Id: Icf5d9e2bffe4d282c415a2b48b41ab562fc4fb81
demo/dali-table-view.cpp
1 /* 1 /*
2 - * Copyright (c) 2014 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -37,17 +37,10 @@ using namespace Dali::Toolkit; @@ -37,17 +37,10 @@ using namespace Dali::Toolkit;
37 namespace 37 namespace
38 { 38 {
39 39
40 -const std::string BUTTON_BACKWARD( "Backward" );  
41 -const std::string BUTTON_FORWARD( "Forward" );  
42 -const std::string BUTTON_QUIT( "Quit" );  
43 -const std::string BUTTON_OK( "Ok" );  
44 -const std::string BUTTON_CANCEL( "Cancel" );  
45 -  
46 const std::string LOGO_PATH( DALI_IMAGE_DIR "Logo-for-demo.png" ); 40 const std::string LOGO_PATH( DALI_IMAGE_DIR "Logo-for-demo.png" );
47 const std::string DEFAULT_TOOLBAR_IMAGE_PATH( DALI_IMAGE_DIR "top-bar.png" ); 41 const std::string DEFAULT_TOOLBAR_IMAGE_PATH( DALI_IMAGE_DIR "top-bar.png" );
48 -const std::string BUTTON_BACKGROUND(DALI_IMAGE_DIR "button-background.png");  
49 -const std::string TILE_BACKGROUND(DALI_IMAGE_DIR "item-background.png");  
50 -const std::string TILE_BACKGROUND_ALPHA(DALI_IMAGE_DIR "item-background-alpha.png"); 42 +const std::string TILE_BACKGROUND(DALI_IMAGE_DIR "item-background.9.png");
  43 +const std::string TILE_BACKGROUND_ALPHA(DALI_IMAGE_DIR "item-background-alpha.9.png");
51 44
52 const char * const DEFAULT_TOOLBAR_TEXT( "TOUCH TO LAUNCH EXAMPLE" ); 45 const char * const DEFAULT_TOOLBAR_TEXT( "TOUCH TO LAUNCH EXAMPLE" );
53 46
@@ -85,7 +78,6 @@ const float SCALE_SPEED_SIN = 0.1f; @@ -85,7 +78,6 @@ const float SCALE_SPEED_SIN = 0.1f;
85 78
86 const unsigned int BACKGROUND_ANIMATION_DURATION = 15000; // 15 secs 79 const unsigned int BACKGROUND_ANIMATION_DURATION = 15000; // 15 secs
87 80
88 -const float BACKGROUND_Z = -1.0f;  
89 const Vector4 BACKGROUND_COLOR( 0.3569f, 0.5451f, 0.7294f, 1.0f ); 81 const Vector4 BACKGROUND_COLOR( 0.3569f, 0.5451f, 0.7294f, 1.0f );
90 82
91 const float BUBBLE_MIN_Z = -1.0; 83 const float BUBBLE_MIN_Z = -1.0;
@@ -107,12 +99,6 @@ Control CreateBackground( std::string stylename ) @@ -107,12 +99,6 @@ Control CreateBackground( std::string stylename )
107 return background; 99 return background;
108 } 100 }
109 101
110 -// These values depend on the tile image  
111 -const float IMAGE_BORDER_LEFT = 11.0f;  
112 -const float IMAGE_BORDER_RIGHT = IMAGE_BORDER_LEFT;  
113 -const float IMAGE_BORDER_TOP = IMAGE_BORDER_LEFT;  
114 -const float IMAGE_BORDER_BOTTOM = IMAGE_BORDER_LEFT;  
115 -  
116 /** 102 /**
117 * Constraint to return a position for a bubble based on the scroll value and vertical wrapping 103 * Constraint to return a position for a bubble based on the scroll value and vertical wrapping
118 */ 104 */
@@ -165,18 +151,13 @@ DaliTableView::DaliTableView( Application& application ) @@ -165,18 +151,13 @@ DaliTableView::DaliTableView( Application& application )
165 mScrollViewEffect(), 151 mScrollViewEffect(),
166 mScrollRulerX(), 152 mScrollRulerX(),
167 mScrollRulerY(), 153 mScrollRulerY(),
168 - mButtons(),  
169 mPressedActor(), 154 mPressedActor(),
170 mAnimationTimer(), 155 mAnimationTimer(),
171 mLogoTapDetector(), 156 mLogoTapDetector(),
172 mVersionPopup(), 157 mVersionPopup(),
173 - mButtonsPageRelativeSize(),  
174 mPages(), 158 mPages(),
175 - mTableViewImages(),  
176 - mBackgroundActors(),  
177 mBackgroundAnimations(), 159 mBackgroundAnimations(),
178 mExampleList(), 160 mExampleList(),
179 - mExampleMap(),  
180 mTotalPages(), 161 mTotalPages(),
181 mScrolling( false ), 162 mScrolling( false ),
182 mSortAlphabetically( false ), 163 mSortAlphabetically( false ),
@@ -192,7 +173,6 @@ DaliTableView::~DaliTableView() @@ -192,7 +173,6 @@ DaliTableView::~DaliTableView()
192 void DaliTableView::AddExample( Example example ) 173 void DaliTableView::AddExample( Example example )
193 { 174 {
194 mExampleList.push_back( example ); 175 mExampleList.push_back( example );
195 - mExampleMap[ example.name ] = example;  
196 } 176 }
197 177
198 void DaliTableView::SortAlphabetically( bool sortAlphabetically ) 178 void DaliTableView::SortAlphabetically( bool sortAlphabetically )
@@ -274,14 +254,13 @@ void DaliTableView::Initialize( Application& application ) @@ -274,14 +254,13 @@ void DaliTableView::Initialize( Application& application )
274 mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 254 mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
275 255
276 // Create solid background colour. 256 // Create solid background colour.
277 - ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR ); 257 + Control backgroundColourActor = Control::New();
  258 + backgroundColourActor.SetBackgroundColor( BACKGROUND_COLOR );
278 backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER ); 259 backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER );
279 backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER ); 260 backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );
280 backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 261 backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
281 backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) ); 262 backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );
282 263
283 - // Force the filled background right to the back  
284 - backgroundColourActor.SetSortModifier( DemoHelper::BACKGROUND_DEPTH_INDEX );  
285 mScrollViewLayer.Add( backgroundColourActor ); 264 mScrollViewLayer.Add( backgroundColourActor );
286 265
287 // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show 266 // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
@@ -289,7 +268,7 @@ void DaliTableView::Initialize( Application& application ) @@ -289,7 +268,7 @@ void DaliTableView::Initialize( Application& application )
289 bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 268 bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
290 bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER ); 269 bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );
291 bubbleContainer.SetParentOrigin( ParentOrigin::CENTER ); 270 bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );
292 - mScrollViewLayer.Add( bubbleContainer ); 271 + backgroundColourActor.Add( bubbleContainer );
293 272
294 SetupBackground( bubbleContainer ); 273 SetupBackground( bubbleContainer );
295 274
@@ -372,8 +351,8 @@ void DaliTableView::Populate() @@ -372,8 +351,8 @@ void DaliTableView::Populate()
372 351
373 for( int t = 0; t < mTotalPages; t++ ) 352 for( int t = 0; t < mTotalPages; t++ )
374 { 353 {
375 - // Create Table. (contains up to 9 Examples)  
376 - TableView page = TableView::New( 3, 3 ); 354 + // Create Table
  355 + TableView page = TableView::New( ROWS_PER_PAGE, EXAMPLES_PER_ROW );
377 page.SetAnchorPoint( AnchorPoint::CENTER ); 356 page.SetAnchorPoint( AnchorPoint::CENTER );
378 page.SetParentOrigin( ParentOrigin::CENTER ); 357 page.SetParentOrigin( ParentOrigin::CENTER );
379 page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 358 page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -478,17 +457,12 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit @@ -478,17 +457,12 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit
478 // create background image 457 // create background image
479 if( addBackground ) 458 if( addBackground )
480 { 459 {
481 - Image bg = ResourceImage::New( TILE_BACKGROUND );  
482 - ImageActor image = ImageActor::New( bg ); 460 + ImageView image = ImageView::New( TILE_BACKGROUND );
483 image.SetAnchorPoint( AnchorPoint::CENTER ); 461 image.SetAnchorPoint( AnchorPoint::CENTER );
484 image.SetParentOrigin( ParentOrigin::CENTER ); 462 image.SetParentOrigin( ParentOrigin::CENTER );
485 // make the image 100% of tile 463 // make the image 100% of tile
486 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 464 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
487 465
488 - // move image back to get text appear in front  
489 - image.SetZ( -1 );  
490 - image.SetStyle( ImageActor::STYLE_NINE_PATCH );  
491 - image.SetNinePatchBorder( Vector4( IMAGE_BORDER_LEFT, IMAGE_BORDER_TOP, IMAGE_BORDER_RIGHT, IMAGE_BORDER_BOTTOM ) );  
492 content.Add( image ); 466 content.Add( image );
493 467
494 // Add stencil 468 // Add stencil
@@ -522,8 +496,6 @@ ImageActor DaliTableView::NewStencilImage() @@ -522,8 +496,6 @@ ImageActor DaliTableView::NewStencilImage()
522 Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA ); 496 Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA );
523 497
524 ImageActor stencilActor = ImageActor::New( alpha ); 498 ImageActor stencilActor = ImageActor::New( alpha );
525 - stencilActor.SetStyle( ImageActor::STYLE_NINE_PATCH );  
526 - stencilActor.SetNinePatchBorder( Vector4( IMAGE_BORDER_LEFT, IMAGE_BORDER_TOP, IMAGE_BORDER_RIGHT, IMAGE_BORDER_BOTTOM ) );  
527 499
528 stencilActor.SetParentOrigin( ParentOrigin::CENTER ); 500 stencilActor.SetParentOrigin( ParentOrigin::CENTER );
529 stencilActor.SetAnchorPoint( AnchorPoint::CENTER ); 501 stencilActor.SetAnchorPoint( AnchorPoint::CENTER );
@@ -551,18 +523,19 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent&amp; event ) @@ -551,18 +523,19 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent&amp; event )
551 if( ( TouchPoint::Up == point.state ) && 523 if( ( TouchPoint::Up == point.state ) &&
552 ( mPressedActor == actor ) ) 524 ( mPressedActor == actor ) )
553 { 525 {
554 - std::string name = actor.GetName();  
555 - ExampleMapConstIter iter = mExampleMap.find( name );  
556 -  
557 - AccessibilityManager accessibilityManager = AccessibilityManager::Get();  
558 -  
559 - if( iter != mExampleMap.end() ) 526 + // ignore Example button presses when scrolling or button animating.
  527 + if( ( !mScrolling ) && ( !mPressedAnimation ) )
560 { 528 {
561 - // ignore Example button presses when scrolling or button animating.  
562 - if( ( !mScrolling ) && ( !mPressedAnimation ) ) 529 + std::string name = actor.GetName();
  530 + const ExampleListIter end = mExampleList.end();
  531 + for( ExampleListIter iter = mExampleList.begin(); iter != end; ++iter )
563 { 532 {
564 - // do nothing, until pressed animation finished.  
565 - consumed = true; 533 + if( (*iter).name == name )
  534 + {
  535 + // do nothing, until pressed animation finished.
  536 + consumed = true;
  537 + break;
  538 + }
566 } 539 }
567 } 540 }
568 541
@@ -590,32 +563,14 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation&amp; source ) @@ -590,32 +563,14 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation&amp; source )
590 if( mPressedActor ) 563 if( mPressedActor )
591 { 564 {
592 std::string name = mPressedActor.GetName(); 565 std::string name = mPressedActor.GetName();
593 - ExampleMapConstIter iter = mExampleMap.find( name );  
594 566
595 - if( iter == mExampleMap.end() ) 567 + std::stringstream stream;
  568 + stream << DALI_EXAMPLE_BIN << name.c_str();
  569 + pid_t pid = fork();
  570 + if( pid == 0)
596 { 571 {
597 - if( name == BUTTON_QUIT )  
598 - {  
599 - // Move focus to the OK button  
600 - AccessibilityManager accessibilityManager = AccessibilityManager::Get();  
601 -  
602 - // Enable the group mode and wrap mode  
603 - accessibilityManager.SetGroupMode( true );  
604 - accessibilityManager.SetWrapMode( true );  
605 - }  
606 - }  
607 - else  
608 - {  
609 - const Example& example( iter->second );  
610 -  
611 - std::stringstream stream;  
612 - stream << DALI_EXAMPLE_BIN << example.name.c_str();  
613 - pid_t pid = fork();  
614 - if( pid == 0)  
615 - {  
616 - execlp( stream.str().c_str(), example.name.c_str(), NULL );  
617 - DALI_ASSERT_ALWAYS(false && "exec failed!");  
618 - } 572 + execlp( stream.str().c_str(), name.c_str(), NULL );
  573 + DALI_ASSERT_ALWAYS(false && "exec failed!");
619 } 574 }
620 mPressedActor.Reset(); 575 mPressedActor.Reset();
621 } 576 }
@@ -762,18 +717,13 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage dis @@ -762,18 +717,13 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage dis
762 for( int i = 0; i < count; ++i ) 717 for( int i = 0; i < count; ++i )
763 { 718 {
764 float randSize = Random::Range( 10.0f, 400.0f ); 719 float randSize = Random::Range( 10.0f, 400.0f );
765 - ImageActor dfActor = ImageActor::New( distanceField ); 720 + ImageView dfActor = ImageView::New( distanceField );
766 dfActor.SetSize( Vector2( randSize, randSize ) ); 721 dfActor.SetSize( Vector2( randSize, randSize ) );
767 dfActor.SetParentOrigin( ParentOrigin::CENTER ); 722 dfActor.SetParentOrigin( ParentOrigin::CENTER );
768 723
769 - // Force the bubbles just in front of the solid background  
770 - dfActor.SetSortModifier( DemoHelper::BACKGROUND_DEPTH_INDEX + 1 );  
771 -  
772 - ShaderEffect effect = Toolkit::CreateDistanceFieldEffect();  
773 - dfActor.SetShaderEffect( effect ); 724 + Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect();
  725 + dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, effect );
774 dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] ); 726 dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] );
775 - effect.SetUniform("uOutlineParams", Vector2( 0.55f, 0.00f ) );  
776 - effect.SetUniform("uSmoothing", 0.5f );  
777 layer.Add( dfActor ); 727 layer.Add( dfActor );
778 } 728 }
779 729
demo/dali-table-view.h
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 #define __DALI_DEMO_H__ 2 #define __DALI_DEMO_H__
3 3
4 /* 4 /*
5 - * Copyright (c) 2014 Samsung Electronics Co., Ltd. 5 + * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6 * 6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License. 8 * you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@ @@ -18,8 +18,6 @@
18 * 18 *
19 */ 19 */
20 20
21 -#include <map>  
22 -  
23 #include <dali/dali.h> 21 #include <dali/dali.h>
24 #include <dali-toolkit/dali-toolkit.h> 22 #include <dali-toolkit/dali-toolkit.h>
25 #include <dali-toolkit/devel-api/controls/popup/popup.h> 23 #include <dali-toolkit/devel-api/controls/popup/popup.h>
@@ -27,19 +25,8 @@ @@ -27,19 +25,8 @@
27 class Example; 25 class Example;
28 26
29 typedef std::vector<Example> ExampleList; 27 typedef std::vector<Example> ExampleList;
30 -typedef std::map<std::string,Example> ExampleMap;  
31 typedef ExampleList::iterator ExampleListIter; 28 typedef ExampleList::iterator ExampleListIter;
32 typedef ExampleList::const_iterator ExampleListConstIter; 29 typedef ExampleList::const_iterator ExampleListConstIter;
33 -typedef ExampleMap::iterator ExampleMapIter;  
34 -typedef ExampleMap::const_iterator ExampleMapConstIter;  
35 -  
36 -typedef std::vector<Dali::Toolkit::TableView> TableViewList;  
37 -typedef TableViewList::iterator TableViewListIter;  
38 -typedef TableViewList::const_iterator TableViewListConstIter;  
39 -  
40 -typedef std::vector<Dali::ImageActor> ImageActorList;  
41 -typedef ImageActorList::iterator ImageActorListIter;  
42 -typedef ImageActorList::const_iterator ImageActorListConstIter;  
43 30
44 typedef std::vector<Dali::Animation> AnimationList; 31 typedef std::vector<Dali::Animation> AnimationList;
45 typedef AnimationList::iterator AnimationListIter; 32 typedef AnimationList::iterator AnimationListIter;
@@ -384,19 +371,14 @@ private: @@ -384,19 +371,14 @@ private:
384 Dali::Toolkit::ScrollViewEffect mScrollViewEffect; ///< Effect to be applied to the scroll view 371 Dali::Toolkit::ScrollViewEffect mScrollViewEffect; ///< Effect to be applied to the scroll view
385 Dali::Toolkit::RulerPtr mScrollRulerX; ///< ScrollView X (horizontal) ruler 372 Dali::Toolkit::RulerPtr mScrollRulerX; ///< ScrollView X (horizontal) ruler
386 Dali::Toolkit::RulerPtr mScrollRulerY; ///< ScrollView Y (vertical) ruler 373 Dali::Toolkit::RulerPtr mScrollRulerY; ///< ScrollView Y (vertical) ruler
387 - Dali::Toolkit::TableView mButtons; ///< Navigation buttons  
388 Dali::Actor mPressedActor; ///< The currently pressed actor. 374 Dali::Actor mPressedActor; ///< The currently pressed actor.
389 Dali::Timer mAnimationTimer; ///< Timer used to turn off animation after a specific time period 375 Dali::Timer mAnimationTimer; ///< Timer used to turn off animation after a specific time period
390 Dali::TapGestureDetector mLogoTapDetector; ///< To detect taps on the logo 376 Dali::TapGestureDetector mLogoTapDetector; ///< To detect taps on the logo
391 Dali::Toolkit::Popup mVersionPopup; ///< Displays DALi library version information 377 Dali::Toolkit::Popup mVersionPopup; ///< Displays DALi library version information
392 - Dali::Vector3 mButtonsPageRelativeSize; ///< Size of a buttons page relative to the stage size  
393 378
394 std::vector< Dali::Actor > mPages; ///< List of pages. 379 std::vector< Dali::Actor > mPages; ///< List of pages.
395 - std::vector< Dali::Actor > mTableViewImages; ///< Offscreen render of tableview  
396 - std::vector< Dali::Actor > mBackgroundActors; ///< List of background actors used in the effect  
397 AnimationList mBackgroundAnimations; ///< List of background bubble animations 380 AnimationList mBackgroundAnimations; ///< List of background bubble animations
398 ExampleList mExampleList; ///< List of examples. 381 ExampleList mExampleList; ///< List of examples.
399 - ExampleMap mExampleMap; ///< Map LUT for examples.  
400 382
401 int mTotalPages; ///< Total pages within scrollview. 383 int mTotalPages; ///< Total pages within scrollview.
402 384
examples/benchmark/benchmark.cpp
@@ -225,9 +225,8 @@ Renderer CreateRenderer( unsigned int index ) @@ -225,9 +225,8 @@ Renderer CreateRenderer( unsigned int index )
225 225
226 const char* imagePath = !gNinePatch ? IMAGE_PATH[index] : NINEPATCH_IMAGE_PATH[index]; 226 const char* imagePath = !gNinePatch ? IMAGE_PATH[index] : NINEPATCH_IMAGE_PATH[index];
227 Image image = ResourceImage::New(imagePath); 227 Image image = ResourceImage::New(imagePath);
228 - Sampler textureSampler = Sampler::New( image, "sTexture" );  
229 Material material = Material::New( shader ); 228 Material material = Material::New( shader );
230 - material.AddSampler(textureSampler); 229 + material.AddTexture( image, "sTexture" );
231 material.SetBlendMode( BlendingMode::OFF ); 230 material.SetBlendMode( BlendingMode::OFF );
232 renderers[index] = Renderer::New( QuadMesh(), material ); 231 renderers[index] = Renderer::New( QuadMesh(), material );
233 } 232 }
@@ -339,8 +338,7 @@ public: @@ -339,8 +338,7 @@ public:
339 338
340 for( size_t i(0); i<actorCount; ++i ) 339 for( size_t i(0); i<actorCount; ++i )
341 { 340 {
342 - Image image = ResourceImage::New(ImagePath(i));  
343 - mImageView[i] = ImageView::New(image); 341 + mImageView[i] = ImageView::New(ImagePath(i));
344 mImageView[i].SetSize(Vector3(0.0f,0.0f,0.0f)); 342 mImageView[i].SetSize(Vector3(0.0f,0.0f,0.0f));
345 mImageView[i].SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); 343 mImageView[i].SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
346 stage.Add(mImageView[i]); 344 stage.Add(mImageView[i]);
examples/buttons/buttons-example.cpp
@@ -158,7 +158,7 @@ class ButtonsController: public ConnectionTracker @@ -158,7 +158,7 @@ class ButtonsController: public ConnectionTracker
158 158
159 // Radio 1 159 // Radio 1
160 { 160 {
161 - ImageActor image = ImageActor::New( ResourceImage::New( SMALL_IMAGE_1 ) ); 161 + Toolkit::ImageView image = Toolkit::ImageView::New( ResourceImage::New( SMALL_IMAGE_1 ) );
162 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); 162 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
163 163
164 mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( "1" ); 164 mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( "1" );
@@ -175,7 +175,7 @@ class ButtonsController: public ConnectionTracker @@ -175,7 +175,7 @@ class ButtonsController: public ConnectionTracker
175 { 175 {
176 radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; 176 radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING;
177 177
178 - ImageActor image = ImageActor::New( ResourceImage::New( SMALL_IMAGE_2 ) ); 178 + Toolkit::ImageView image = Toolkit::ImageView::New( ResourceImage::New( SMALL_IMAGE_2 ) );
179 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); 179 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
180 180
181 mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( "2" ); 181 mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( "2" );
@@ -191,7 +191,7 @@ class ButtonsController: public ConnectionTracker @@ -191,7 +191,7 @@ class ButtonsController: public ConnectionTracker
191 { 191 {
192 radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; 192 radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING;
193 193
194 - ImageActor image = ImageActor::New( ResourceImage::New( SMALL_IMAGE_3 ) ); 194 + Toolkit::ImageView image = Toolkit::ImageView::New( ResourceImage::New( SMALL_IMAGE_3 ) );
195 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); 195 image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
196 196
197 mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( "3" ); 197 mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( "3" );
@@ -258,10 +258,10 @@ class ButtonsController: public ConnectionTracker @@ -258,10 +258,10 @@ class ButtonsController: public ConnectionTracker
258 textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT ); 258 textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
259 textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); 259 textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
260 260
261 - ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) );  
262 - imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );  
263 - imageActor.SetPadding( Padding( DP(20.0f), 0.0f, 0.0f, 0.0f ) );  
264 - tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) ); 261 + Toolkit::ImageView image = Toolkit::ImageView::New( ResourceImage::New( ENABLED_IMAGE ) );
  262 + image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
  263 + image.SetPadding( Padding( DP(20.0f), 0.0f, 0.0f, 0.0f ) );
  264 + tableView.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
265 265
266 radioButtonsGroup1.Add( tableView ); 266 radioButtonsGroup1.Add( tableView );
267 267
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -170,9 +170,16 @@ public: @@ -170,9 +170,16 @@ public:
170 Stage stage = Stage::GetCurrent(); 170 Stage stage = Stage::GetCurrent();
171 171
172 // Background image: 172 // Background image:
173 - ResourceImage backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, ImageDimensions( stage.GetSize().width, stage.GetSize().height ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR );  
174 - Toolkit::ImageView background = Toolkit::ImageView::New( backgroundImage );  
175 - background.SetZ( -2.0f ); 173 + Dali::Property::Map backgroundImage;
  174 + backgroundImage.Insert( "renderer-type", "image-renderer" );
  175 + backgroundImage.Insert( "image-url", BACKGROUND_IMAGE );
  176 + backgroundImage.Insert( "image-desired-width", stage.GetSize().width );
  177 + backgroundImage.Insert( "image-desired-height", stage.GetSize().height );
  178 + backgroundImage.Insert( "image-fitting-mode", "scale-to-fill" );
  179 + backgroundImage.Insert( "image-sampling-mode", "box-then-nearest" );
  180 +
  181 + Toolkit::ImageView background = Toolkit::ImageView::New();
  182 + background.SetProperty( Toolkit::ImageView::Property::IMAGE, backgroundImage );
176 background.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 183 background.SetAnchorPoint( AnchorPoint::TOP_LEFT );
177 background.SetSize( stage.GetSize() ); 184 background.SetSize( stage.GetSize() );
178 stage.Add( background ); 185 stage.Add( background );
@@ -206,17 +213,31 @@ public: @@ -206,17 +213,31 @@ public:
206 mDesiredBox.SetSize( stage.GetSize() * mImageStageScale ); 213 mDesiredBox.SetSize( stage.GetSize() * mImageStageScale );
207 mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); 214 mDesiredBox.SetParentOrigin( ParentOrigin::CENTER );
208 mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); 215 mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER );
209 - mDesiredBox.SetPosition( 0, 0, -1 );  
210 216
211 mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); 217 mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height );
212 mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); 218 mHeightBox.SetParentOrigin( ParentOrigin::CENTER );
213 mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); 219 mHeightBox.SetAnchorPoint( AnchorPoint::CENTER );
214 - mHeightBox.SetPosition( 0, 0, -1 );  
215 220
216 mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); 221 mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height );
217 mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); 222 mWidthBox.SetParentOrigin( ParentOrigin::CENTER );
218 mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); 223 mWidthBox.SetAnchorPoint( AnchorPoint::CENTER );
219 - mWidthBox.SetPosition( 0, 0, -1 ); 224 +
  225 + // Initialize the actor
  226 + mImageView = Toolkit::ImageView::New( IMAGE_PATHS[ 0 ] );
  227 +
  228 + // Reposition the actor
  229 + mImageView.SetParentOrigin( ParentOrigin::CENTER );
  230 + mImageView.SetAnchorPoint( AnchorPoint::CENTER );
  231 +
  232 + // Display the actor on the stage
  233 + mDesiredBox.Add( mImageView );
  234 +
  235 + mImageView.SetSize( stage.GetSize() * mImageStageScale );
  236 +
  237 + // Setup the pinch detector for scaling the desired image load dimensions:
  238 + mPinchDetector = PinchGestureDetector::New();
  239 + mPinchDetector.Attach( mImageView );
  240 + mPinchDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPinch );
220 241
221 // Make a grab-handle for resizing the image: 242 // Make a grab-handle for resizing the image:
222 mGrabCorner = Toolkit::PushButton::New(); 243 mGrabCorner = Toolkit::PushButton::New();
@@ -233,28 +254,11 @@ public: @@ -233,28 +254,11 @@ public:
233 grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); 254 grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
234 255
235 grabCornerLayer.Add( mGrabCorner ); 256 grabCornerLayer.Add( mGrabCorner );
236 - mDesiredBox.Add( grabCornerLayer ); 257 + mImageView.Add( grabCornerLayer );
237 mPanGestureDetector = PanGestureDetector::New(); 258 mPanGestureDetector = PanGestureDetector::New();
238 mPanGestureDetector.Attach( mGrabCorner ); 259 mPanGestureDetector.Attach( mGrabCorner );
239 mPanGestureDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPan ); 260 mPanGestureDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPan );
240 261
241 - // Initialize the actor  
242 - mImageActor = ImageActor::New();  
243 -  
244 - // Reposition the actor  
245 - mImageActor.SetParentOrigin( ParentOrigin::CENTER );  
246 - mImageActor.SetAnchorPoint( AnchorPoint::CENTER );  
247 - mImageActor.SetSortModifier(5.f);  
248 -  
249 - // Display the actor on the stage  
250 - background.Add( mImageActor );  
251 -  
252 - mImageActor.SetSize( stage.GetSize() * mImageStageScale );  
253 -  
254 - // Setup the pinch detector for scaling the desired image load dimensions:  
255 - mPinchDetector = PinchGestureDetector::New();  
256 - mPinchDetector.Attach( mImageActor );  
257 - mPinchDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPinch );  
258 262
259 // Tie-in input event handlers: 263 // Tie-in input event handlers:
260 stage.KeyEventSignal().Connect( this, &ImageScalingAndFilteringController::OnKeyEvent ); 264 stage.KeyEventSignal().Connect( this, &ImageScalingAndFilteringController::OnKeyEvent );
@@ -520,8 +524,8 @@ public: @@ -520,8 +524,8 @@ public:
520 void OnImageLoaded( ResourceImage image ) 524 void OnImageLoaded( ResourceImage image )
521 { 525 {
522 DALI_ASSERT_DEBUG( image == mNextImage ); 526 DALI_ASSERT_DEBUG( image == mNextImage );
523 - mImageActor.SetImage( image );  
524 - mImageActor.SetSize( Size( image.GetWidth(), image.GetHeight() ) ); 527 + mImageView.SetImage( image );
  528 + mImageView.SetSize( Size( image.GetWidth(), image.GetHeight() ) );
525 } 529 }
526 530
527 bool OnControlTouched( Actor actor, const TouchEvent& event ) 531 bool OnControlTouched( Actor actor, const TouchEvent& event )
@@ -695,7 +699,7 @@ private: @@ -695,7 +699,7 @@ private:
695 float mLastPinchScale; 699 float mLastPinchScale;
696 Toolkit::PushButton mGrabCorner; 700 Toolkit::PushButton mGrabCorner;
697 PanGestureDetector mPanGestureDetector; 701 PanGestureDetector mPanGestureDetector;
698 - ImageActor mImageActor; 702 + Toolkit::ImageView mImageView;
699 ResourceImage mNextImage; //< Currently-loading image 703 ResourceImage mNextImage; //< Currently-loading image
700 Vector2 mImageStageScale; 704 Vector2 mImageStageScale;
701 int mCurrentPath; 705 int mCurrentPath;
examples/line-mesh/line-mesh-example.cpp
@@ -151,12 +151,11 @@ public: @@ -151,12 +151,11 @@ public:
151 // Hide the indicator bar 151 // Hide the indicator bar
152 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); 152 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
153 153
154 - mImage = ResourceImage::New( MATERIAL_SAMPLE );  
155 - mSampler = Sampler::New(mImage, "sTexture");  
156 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); 154 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
157 155
158 mMaterial = Material::New( mShader ); 156 mMaterial = Material::New( mShader );
159 - mMaterial.AddSampler( mSampler ); 157 + mImage = ResourceImage::New( MATERIAL_SAMPLE );
  158 + mMaterial.AddTexture(mImage, "sTexture");
160 159
161 mGeometry = CreateGeometry(); 160 mGeometry = CreateGeometry();
162 161
@@ -204,7 +203,8 @@ public: @@ -204,7 +203,8 @@ public:
204 bool OnTimer() 203 bool OnTimer()
205 { 204 {
206 Image image = ResourceImage::New( MATERIAL_SAMPLE2 ); 205 Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
207 - mSampler.SetImage( image ); 206 +
  207 + mMaterial.SetTextureImage(0,image);
208 return false; 208 return false;
209 } 209 }
210 210
@@ -225,7 +225,6 @@ private: @@ -225,7 +225,6 @@ private:
225 Vector3 mStageSize; ///< The size of the stage 225 Vector3 mStageSize; ///< The size of the stage
226 226
227 Image mImage; 227 Image mImage;
228 - Sampler mSampler;  
229 Shader mShader; 228 Shader mShader;
230 Material mMaterial; 229 Material mMaterial;
231 Geometry mGeometry; 230 Geometry mGeometry;
examples/mesh-sorting/mesh-sorting-example.cpp
@@ -169,9 +169,8 @@ public: @@ -169,9 +169,8 @@ public:
169 for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i) 169 for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)
170 { 170 {
171 Image image = ResourceImage::New( MATERIAL_SAMPLES[i] ); 171 Image image = ResourceImage::New( MATERIAL_SAMPLES[i] );
172 - Sampler sampler = Sampler::New(image, "sTexture");  
173 Material material = Material::New( mShader ); 172 Material material = Material::New( mShader );
174 - material.AddSampler( sampler ); 173 + material.AddTexture(image, "sTexture");
175 if( i==0 ) { firstMat = material; } 174 if( i==0 ) { firstMat = material; }
176 175
177 Renderer renderer = Renderer::New( mGeometry, material ); 176 Renderer renderer = Renderer::New( mGeometry, material );
examples/motion-blur/motion-blur-example.cpp
@@ -209,19 +209,18 @@ public: @@ -209,19 +209,18 @@ public:
209 mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) ); 209 mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) );
210 210
211 Image image = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y ); 211 Image image = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
212 - mMotionBlurImageActor = ImageActor::New(image);  
213 - mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER );  
214 - mMotionBlurImageActor.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y); 212 + mMotionBlurImageView = ImageView::New(image);
  213 + mMotionBlurImageView.SetParentOrigin( ParentOrigin::CENTER );
  214 + mMotionBlurImageView.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
215 215
216 - mContentLayer.Add( mMotionBlurImageActor ); 216 + mContentLayer.Add( mMotionBlurImageView );
217 217
218 // Create shader used for doing motion blur 218 // Create shader used for doing motion blur
219 - mMotionBlurEffect = Toolkit::CreateMotionBlurEffect();  
220 - Dali::Property::Index uModelProperty = mMotionBlurEffect.GetPropertyIndex( "uModelLastFrame" );  
221 - Constraint constraint = Constraint::New<Matrix>( mMotionBlurEffect, uModelProperty, EqualToConstraint() );  
222 - constraint.AddSource( Source( mMotionBlurImageActor , Actor::Property::WORLD_MATRIX ) );  
223 - constraint.Apply();  
224 - mMotionBlurImageActor.SetShaderEffect( mMotionBlurEffect ); 219 + mMotionBlurEffect = CreateMotionBlurEffect();
  220 +
  221 + // set actor shader to the blur one
  222 + Toolkit::SetMotionBlurProperties( mMotionBlurImageView, MOTION_BLUR_NUM_SAMPLES );
  223 + mMotionBlurImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
225 224
226 225
227 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS 226 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
@@ -231,17 +230,15 @@ public: @@ -231,17 +230,15 @@ public:
231 // Motion blurred actor 2 230 // Motion blurred actor 2
232 // 231 //
233 232
234 - mMotionBlurImageActor2 = ImageActor::New(image);  
235 - mMotionBlurImageActor2.SetParentOrigin( ParentOrigin::CENTER );  
236 - mMotionBlurImageActor2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);  
237 - mMotionBlurImageActor2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);  
238 - mMotionBlurImageActor.Add( mMotionBlurImageActor2 );  
239 -  
240 - // Create shader used for doing motion blur  
241 - mMotionBlurEffect2 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES); 233 + mMotionBlurImageView2 = ImageView::New(image);
  234 + mMotionBlurImageView2.SetParentOrigin( ParentOrigin::CENTER );
  235 + mMotionBlurImageView2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
  236 + mMotionBlurImageView2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);
  237 + mMotionBlurImageView.Add( mMotionBlurImageView2 );
242 238
243 // set actor shader to the blur one 239 // set actor shader to the blur one
244 - mMotionBlurImageActor2.SetShaderEffect( mMotionBlurEffect2 ); 240 + Toolkit::SetMotionBlurProperties( mMotionBlurImageView2, MOTION_BLUR_NUM_SAMPLES );
  241 + mMotionBlurImageView2.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
245 242
246 243
247 /////////////////////////////////////////////////////// 244 ///////////////////////////////////////////////////////
@@ -249,17 +246,15 @@ public: @@ -249,17 +246,15 @@ public:
249 // Motion blurred actor 3 246 // Motion blurred actor 3
250 // 247 //
251 248
252 - mMotionBlurImageActor3 = ImageActor::New(image);  
253 - mMotionBlurImageActor3.SetParentOrigin( ParentOrigin::CENTER );  
254 - mMotionBlurImageActor3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);  
255 - mMotionBlurImageActor3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);  
256 - mMotionBlurImageActor.Add( mMotionBlurImageActor3 );  
257 -  
258 - // Create shader used for doing motion blur  
259 - mMotionBlurEffect3 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES); 249 + mMotionBlurImageView3 = ImageView::New(image);
  250 + mMotionBlurImageView3.SetParentOrigin( ParentOrigin::CENTER );
  251 + mMotionBlurImageView3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
  252 + mMotionBlurImageView3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);
  253 + mMotionBlurImageView.Add( mMotionBlurImageView3 );
260 254
261 // set actor shader to the blur one 255 // set actor shader to the blur one
262 - mMotionBlurImageActor3.SetShaderEffect( mMotionBlurEffect3 ); 256 + Toolkit::SetMotionBlurProperties( mMotionBlurImageView3, MOTION_BLUR_NUM_SAMPLES );
  257 + mMotionBlurImageView3.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
263 258
264 259
265 /////////////////////////////////////////////////////// 260 ///////////////////////////////////////////////////////
@@ -267,35 +262,30 @@ public: @@ -267,35 +262,30 @@ public:
267 // Motion blurred actor 4 262 // Motion blurred actor 4
268 // 263 //
269 264
270 - mMotionBlurImageActor4 = ImageActor::New(image);  
271 - mMotionBlurImageActor4.SetParentOrigin( ParentOrigin::CENTER );  
272 - mMotionBlurImageActor4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);  
273 - mMotionBlurImageActor4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);  
274 - mMotionBlurImageActor.Add( mMotionBlurImageActor4 );  
275 -  
276 - // Create shader used for doing motion blur  
277 - mMotionBlurEffect4 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES); 265 + mMotionBlurImageView4 = ImageView::New(image);
  266 + mMotionBlurImageView4.SetParentOrigin( ParentOrigin::CENTER );
  267 + mMotionBlurImageView4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
  268 + mMotionBlurImageView4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);
  269 + mMotionBlurImageView.Add( mMotionBlurImageView4 );
278 270
279 // set actor shader to the blur one 271 // set actor shader to the blur one
280 - mMotionBlurImageActor4.SetShaderEffect( mMotionBlurEffect4 );  
281 - 272 + Toolkit::SetMotionBlurProperties( mMotionBlurImageView4, MOTION_BLUR_NUM_SAMPLES );
  273 + mMotionBlurImageView4.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
282 274
283 /////////////////////////////////////////////////////// 275 ///////////////////////////////////////////////////////
284 // 276 //
285 // Motion blurred actor 5 277 // Motion blurred actor 5
286 // 278 //
287 279
288 - mMotionBlurImageActor5 = ImageActor::New(image);  
289 - mMotionBlurImageActor5.SetParentOrigin( ParentOrigin::CENTER );  
290 - mMotionBlurImageActor5.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);  
291 - mMotionBlurImageActor5.SetPosition(0.0f, -mMotionBlurActorSize.y * 1.1f);  
292 - mMotionBlurImageActor.Add( mMotionBlurImageActor5 );  
293 -  
294 - // Create shader used for doing motion blur  
295 - mMotionBlurEffect5 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES); 280 + mMotionBlurImageView5 = ImageView::New(image);
  281 + mMotionBlurImageView5.SetParentOrigin( ParentOrigin::CENTER );
  282 + mMotionBlurImageView5.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
  283 + mMotionBlurImageView5.SetPosition(0.0f, -mMotionBlurActorSize.y * 1.1f);
  284 + mMotionBlurImageView.Add( mMotionBlurImageView5 );
296 285
297 // set actor shader to the blur one 286 // set actor shader to the blur one
298 - mMotionBlurImageActor5.SetShaderEffect( mMotionBlurEffect5 ); 287 + Toolkit::SetMotionBlurProperties( mMotionBlurImageView5, MOTION_BLUR_NUM_SAMPLES );
  288 + mMotionBlurImageView5.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionBlurEffect );
299 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS 289 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
300 } 290 }
301 291
@@ -374,9 +364,9 @@ public: @@ -374,9 +364,9 @@ public:
374 364
375 float animDuration = 0.5f; 365 float animDuration = 0.5f;
376 mActorTapMovementAnimation = Animation::New( animDuration ); 366 mActorTapMovementAnimation = Animation::New( animDuration );
377 - if ( mMotionBlurImageActor ) 367 + if ( mMotionBlurImageView )
378 { 368 {
379 - mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageActor, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) ); 369 + mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageView, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) );
380 } 370 }
381 mActorTapMovementAnimation.SetEndAction( Animation::Bake ); 371 mActorTapMovementAnimation.SetEndAction( Animation::Bake );
382 mActorTapMovementAnimation.Play(); 372 mActorTapMovementAnimation.Play();
@@ -392,7 +382,7 @@ public: @@ -392,7 +382,7 @@ public:
392 { 382 {
393 float animDuration = 1.0f; 383 float animDuration = 1.0f;
394 mActorAnimation = Animation::New(animDuration); 384 mActorAnimation = Animation::New(animDuration);
395 - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT ); 385 + mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
396 mActorAnimation.SetEndAction( Animation::Bake ); 386 mActorAnimation.SetEndAction( Animation::Bake );
397 mActorAnimation.Play(); 387 mActorAnimation.Play();
398 } 388 }
@@ -403,7 +393,7 @@ public: @@ -403,7 +393,7 @@ public:
403 { 393 {
404 float animDuration = 1.0f; 394 float animDuration = 1.0f;
405 mActorAnimation = Animation::New(animDuration); 395 mActorAnimation = Animation::New(animDuration);
406 - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); 396 + mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
407 mActorAnimation.SetEndAction( Animation::Bake ); 397 mActorAnimation.SetEndAction( Animation::Bake );
408 mActorAnimation.Play(); 398 mActorAnimation.Play();
409 } 399 }
@@ -414,8 +404,8 @@ public: @@ -414,8 +404,8 @@ public:
414 { 404 {
415 float animDuration = 1.0f; 405 float animDuration = 1.0f;
416 mActorAnimation = Animation::New(animDuration); 406 mActorAnimation = Animation::New(animDuration);
417 - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );  
418 - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); 407 + mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
  408 + mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
419 mActorAnimation.SetEndAction( Animation::Bake ); 409 mActorAnimation.SetEndAction( Animation::Bake );
420 mActorAnimation.Play(); 410 mActorAnimation.Play();
421 } 411 }
@@ -426,7 +416,7 @@ public: @@ -426,7 +416,7 @@ public:
426 { 416 {
427 float animDuration = 1.0f; 417 float animDuration = 1.0f;
428 mActorAnimation = Animation::New(animDuration); 418 mActorAnimation = Animation::New(animDuration);
429 - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) ); 419 + mActorAnimation.AnimateBy( Property( mMotionBlurImageView, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) );
430 mActorAnimation.SetEndAction( Animation::Bake ); 420 mActorAnimation.SetEndAction( Animation::Bake );
431 mActorAnimation.Play(); 421 mActorAnimation.Play();
432 } 422 }
@@ -508,7 +498,14 @@ public: @@ -508,7 +498,14 @@ public:
508 } 498 }
509 499
510 Image blurImage = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage], mMotionBlurActorSize.x, mMotionBlurActorSize.y ); 500 Image blurImage = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage], mMotionBlurActorSize.x, mMotionBlurActorSize.y );
511 - mMotionBlurImageActor.SetImage(blurImage); 501 +
  502 + mMotionBlurImageView.SetImage(blurImage);
  503 +#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
  504 + mMotionBlurImageView2.SetImage(blurImage);
  505 + mMotionBlurImageView3.SetImage(blurImage);
  506 + mMotionBlurImageView4.SetImage(blurImage);
  507 + mMotionBlurImageView5.SetImage(blurImage);
  508 +#endif
512 } 509 }
513 510
514 511
@@ -522,20 +519,15 @@ private: @@ -522,20 +519,15 @@ private:
522 PushButton mActorEffectsButton; ///< The actor effects toggling Button. 519 PushButton mActorEffectsButton; ///< The actor effects toggling Button.
523 520
524 // Motion blur 521 // Motion blur
525 - ShaderEffect mMotionBlurEffect;  
526 - ImageActor mMotionBlurImageActor; 522 + Property::Map mMotionBlurEffect;
  523 + ImageView mMotionBlurImageView;
527 Size mMotionBlurActorSize; 524 Size mMotionBlurActorSize;
528 525
529 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS 526 #ifdef MULTIPLE_MOTION_BLURRED_ACTORS
530 - ShaderEffect mMotionBlurEffect2;  
531 - ShaderEffect mMotionBlurEffect3;  
532 - ShaderEffect mMotionBlurEffect4;  
533 - ShaderEffect mMotionBlurEffect5;  
534 -  
535 - ImageActor mMotionBlurImageActor2;  
536 - ImageActor mMotionBlurImageActor3;  
537 - ImageActor mMotionBlurImageActor4;  
538 - ImageActor mMotionBlurImageActor5; 527 + ImageView mMotionBlurImageView2;
  528 + ImageView mMotionBlurImageView3;
  529 + ImageView mMotionBlurImageView4;
  530 + ImageView mMotionBlurImageView5;
539 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS 531 #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
540 532
541 // animate actor to position where user taps screen 533 // animate actor to position where user taps screen
examples/motion-stretch/motion-stretch-example.cpp
@@ -177,21 +177,17 @@ public: @@ -177,21 +177,17 @@ public:
177 // Motion stretched actor 177 // Motion stretched actor
178 // 178 //
179 179
180 - Image image = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGE1 );  
181 - mMotionStretchImageActor = ImageActor::New(image);  
182 - mMotionStretchImageActor.SetParentOrigin( ParentOrigin::CENTER );  
183 - mMotionStretchImageActor.SetAnchorPoint( AnchorPoint::CENTER );  
184 - mMotionStretchImageActor.SetSize(MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT); 180 + mMotionStretchImageView = ImageView::New( MOTION_STRETCH_ACTOR_IMAGE1 );
  181 + mMotionStretchImageView.SetParentOrigin( ParentOrigin::CENTER );
  182 + mMotionStretchImageView.SetAnchorPoint( AnchorPoint::CENTER );
  183 + mMotionStretchImageView.SetSize( MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT );
185 184
186 - mContentLayer.Add( mMotionStretchImageActor ); 185 + mContentLayer.Add( mMotionStretchImageView );
187 186
188 // Create shader used for doing motion stretch 187 // Create shader used for doing motion stretch
189 mMotionStretchEffect = Toolkit::CreateMotionStretchEffect(); 188 mMotionStretchEffect = Toolkit::CreateMotionStretchEffect();
190 - Dali::Property::Index uModelProperty = mMotionStretchEffect.GetPropertyIndex( "uModelLastFrame" );  
191 - Constraint constraint = Constraint::New<Matrix>( mMotionStretchEffect, uModelProperty, EqualToConstraint() );  
192 - constraint.AddSource( Source( mMotionStretchImageActor , Actor::Property::WORLD_MATRIX ) );  
193 - constraint.Apply();  
194 - mMotionStretchImageActor.SetShaderEffect( mMotionStretchEffect ); 189 + Toolkit::SetMotionStretchProperties( mMotionStretchImageView );
  190 + mMotionStretchImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionStretchEffect );
195 } 191 }
196 192
197 ////////////////////////////////////////////////////////////// 193 //////////////////////////////////////////////////////////////
@@ -268,9 +264,9 @@ public: @@ -268,9 +264,9 @@ public:
268 264
269 float animDuration = 0.5f; 265 float animDuration = 0.5f;
270 mActorTapMovementAnimation = Animation::New( animDuration ); 266 mActorTapMovementAnimation = Animation::New( animDuration );
271 - if ( mMotionStretchImageActor ) 267 + if ( mMotionStretchImageView )
272 { 268 {
273 - mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageActor, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) ); 269 + mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageView, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) );
274 } 270 }
275 mActorTapMovementAnimation.SetEndAction( Animation::Bake ); 271 mActorTapMovementAnimation.SetEndAction( Animation::Bake );
276 mActorTapMovementAnimation.Play(); 272 mActorTapMovementAnimation.Play();
@@ -286,7 +282,7 @@ public: @@ -286,7 +282,7 @@ public:
286 { 282 {
287 float animDuration = 1.0f; 283 float animDuration = 1.0f;
288 mActorAnimation = Animation::New(animDuration); 284 mActorAnimation = Animation::New(animDuration);
289 - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT ); 285 + mActorAnimation.AnimateBy( Property( mMotionStretchImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
290 mActorAnimation.SetEndAction( Animation::Bake ); 286 mActorAnimation.SetEndAction( Animation::Bake );
291 mActorAnimation.Play(); 287 mActorAnimation.Play();
292 } 288 }
@@ -297,7 +293,7 @@ public: @@ -297,7 +293,7 @@ public:
297 { 293 {
298 float animDuration = 1.0f; 294 float animDuration = 1.0f;
299 mActorAnimation = Animation::New(animDuration); 295 mActorAnimation = Animation::New(animDuration);
300 - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); 296 + mActorAnimation.AnimateBy( Property( mMotionStretchImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
301 mActorAnimation.SetEndAction( Animation::Bake ); 297 mActorAnimation.SetEndAction( Animation::Bake );
302 mActorAnimation.Play(); 298 mActorAnimation.Play();
303 } 299 }
@@ -308,8 +304,8 @@ public: @@ -308,8 +304,8 @@ public:
308 { 304 {
309 float animDuration = 1.0f; 305 float animDuration = 1.0f;
310 mActorAnimation = Animation::New(animDuration); 306 mActorAnimation = Animation::New(animDuration);
311 - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );  
312 - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); 307 + mActorAnimation.AnimateBy( Property( mMotionStretchImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT );
  308 + mActorAnimation.AnimateBy( Property( mMotionStretchImageView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT );
313 mActorAnimation.SetEndAction( Animation::Bake ); 309 mActorAnimation.SetEndAction( Animation::Bake );
314 mActorAnimation.Play(); 310 mActorAnimation.Play();
315 } 311 }
@@ -320,7 +316,7 @@ public: @@ -320,7 +316,7 @@ public:
320 { 316 {
321 float animDuration = 1.0f; 317 float animDuration = 1.0f;
322 mActorAnimation = Animation::New(animDuration); 318 mActorAnimation = Animation::New(animDuration);
323 - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) ); 319 + mActorAnimation.AnimateBy( Property( mMotionStretchImageView, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::BOUNCE, TimePeriod( 0.0f, 1.0f ) );
324 mActorAnimation.SetEndAction( Animation::Bake ); 320 mActorAnimation.SetEndAction( Animation::Bake );
325 mActorAnimation.Play(); 321 mActorAnimation.Play();
326 } 322 }
@@ -402,7 +398,7 @@ public: @@ -402,7 +398,7 @@ public:
402 } 398 }
403 399
404 Image stretchImage = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] ); 400 Image stretchImage = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] );
405 - mMotionStretchImageActor.SetImage(stretchImage); 401 + mMotionStretchImageView.SetImage(stretchImage);
406 } 402 }
407 403
408 404
@@ -415,8 +411,8 @@ private: @@ -415,8 +411,8 @@ private:
415 PushButton mActorEffectsButton; ///< The actor effects toggling Button. 411 PushButton mActorEffectsButton; ///< The actor effects toggling Button.
416 412
417 // Motion stretch 413 // Motion stretch
418 - ShaderEffect mMotionStretchEffect;  
419 - ImageActor mMotionStretchImageActor; 414 + Property::Map mMotionStretchEffect;
  415 + ImageView mMotionStretchImageView;
420 416
421 // animate actor to position where user taps screen 417 // animate actor to position where user taps screen
422 Animation mActorTapMovementAnimation; 418 Animation mActorTapMovementAnimation;
examples/new-window/new-window-example.cpp
@@ -119,16 +119,16 @@ public: @@ -119,16 +119,16 @@ public:
119 void Create( Application& app ); 119 void Create( Application& app );
120 void Destroy( Application& app ); 120 void Destroy( Application& app );
121 121
122 - void AddBubbles(const Vector2& stageSize);  
123 - void AddMeshActor();  
124 - void AddBlendingImageActor();  
125 - void AddTextLabel(); 122 + void AddBubbles( Actor& parentActor, const Vector2& stageSize);
  123 + void AddMeshActor( Actor& parentActor );
  124 + void AddBlendingImageActor( Actor& parentActor );
  125 + void AddTextLabel( Actor& parentActor );
126 126
127 ImageView CreateBlurredMirrorImage(const char* imageName); 127 ImageView CreateBlurredMirrorImage(const char* imageName);
128 - FrameBufferImage CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect); 128 + FrameBufferImage CreateFrameBufferForImage( const char* imageName, Property::Map& shaderEffect, const Vector3& rgbDelta );
129 void SetUpBubbleEmission( const Vector2& emitPosition, const Vector2& direction ); 129 void SetUpBubbleEmission( const Vector2& emitPosition, const Vector2& direction );
130 Geometry CreateMeshGeometry(); 130 Geometry CreateMeshGeometry();
131 - ShaderEffect CreateColorModifierer( const Vector3& rgbDelta ); 131 + Dali::Property::Map CreateColorModifierer();
132 132
133 static void NewWindow(void); 133 static void NewWindow(void);
134 134
@@ -185,9 +185,8 @@ void NewWindowController::Create( Application&amp; app ) @@ -185,9 +185,8 @@ void NewWindowController::Create( Application&amp; app )
185 185
186 Size stageSize = stage.GetSize(); 186 Size stageSize = stage.GetSize();
187 Image backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, Dali::ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR ); 187 Image backgroundImage = ResourceImage::New( BACKGROUND_IMAGE, Dali::ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
188 - ImageActor backgroundActor = ImageActor::New( backgroundImage ); 188 + ImageView backgroundActor = ImageView::New( backgroundImage );
189 backgroundActor.SetParentOrigin( ParentOrigin::CENTER ); 189 backgroundActor.SetParentOrigin( ParentOrigin::CENTER );
190 - backgroundActor.SetZ(-2.f);  
191 mContentLayer.Add(backgroundActor); 190 mContentLayer.Add(backgroundActor);
192 191
193 // Point the default render task at the view 192 // Point the default render task at the view
@@ -208,7 +207,7 @@ void NewWindowController::Create( Application&amp; app ) @@ -208,7 +207,7 @@ void NewWindowController::Create( Application&amp; app )
208 logoLayoutActor.SetParentOrigin(ParentOrigin::CENTER); 207 logoLayoutActor.SetParentOrigin(ParentOrigin::CENTER);
209 logoLayoutActor.SetPosition(0.0f, -200.0f, 0.0f); 208 logoLayoutActor.SetPosition(0.0f, -200.0f, 0.0f);
210 logoLayoutActor.SetScale(0.5f); 209 logoLayoutActor.SetScale(0.5f);
211 - mContentLayer.Add(logoLayoutActor); 210 + backgroundActor.Add(logoLayoutActor);
212 211
213 Image image = ResourceImage::New(LOGO_IMAGE); 212 Image image = ResourceImage::New(LOGO_IMAGE);
214 ImageView imageView = ImageView::New(image); 213 ImageView imageView = ImageView::New(image);
@@ -222,10 +221,10 @@ void NewWindowController::Create( Application&amp; app ) @@ -222,10 +221,10 @@ void NewWindowController::Create( Application&amp; app )
222 mirrorImageView.SetAnchorPoint(AnchorPoint::TOP_CENTER); 221 mirrorImageView.SetAnchorPoint(AnchorPoint::TOP_CENTER);
223 logoLayoutActor.Add(mirrorImageView); 222 logoLayoutActor.Add(mirrorImageView);
224 223
225 - AddBubbles(stage.GetSize());  
226 - AddMeshActor();  
227 - AddBlendingImageActor();  
228 - AddTextLabel(); 224 + AddBubbles( backgroundActor, stage.GetSize());
  225 + AddMeshActor( backgroundActor );
  226 + AddBlendingImageActor( backgroundActor );
  227 + AddTextLabel( backgroundActor );
229 228
230 stage.ContextLostSignal().Connect(this, &NewWindowController::OnContextLost); 229 stage.ContextLostSignal().Connect(this, &NewWindowController::OnContextLost);
231 stage.ContextRegainedSignal().Connect(this, &NewWindowController::OnContextRegained); 230 stage.ContextRegainedSignal().Connect(this, &NewWindowController::OnContextRegained);
@@ -236,7 +235,7 @@ void NewWindowController::Destroy( Application&amp; app ) @@ -236,7 +235,7 @@ void NewWindowController::Destroy( Application&amp; app )
236 UnparentAndReset(mTextActor); 235 UnparentAndReset(mTextActor);
237 } 236 }
238 237
239 -void NewWindowController::AddBubbles(const Vector2& stageSize) 238 +void NewWindowController::AddBubbles( Actor& parentActor, const Vector2& stageSize)
240 { 239 {
241 mEmitter = Toolkit::BubbleEmitter::New( stageSize, 240 mEmitter = Toolkit::BubbleEmitter::New( stageSize,
242 ResourceImage::New( DALI_IMAGE_DIR "bubble-ball.png" ), 241 ResourceImage::New( DALI_IMAGE_DIR "bubble-ball.png" ),
@@ -246,7 +245,7 @@ void NewWindowController::AddBubbles(const Vector2&amp; stageSize) @@ -246,7 +245,7 @@ void NewWindowController::AddBubbles(const Vector2&amp; stageSize)
246 mEmitter.SetBackground( background, Vector3(0.5f, 0.f,0.5f) ); 245 mEmitter.SetBackground( background, Vector3(0.5f, 0.f,0.5f) );
247 mEmitter.SetBubbleDensity( 9.f ); 246 mEmitter.SetBubbleDensity( 9.f );
248 Actor bubbleRoot = mEmitter.GetRootActor(); 247 Actor bubbleRoot = mEmitter.GetRootActor();
249 - mContentLayer.Add( bubbleRoot ); 248 + parentActor.Add( bubbleRoot );
250 bubbleRoot.SetParentOrigin(ParentOrigin::CENTER); 249 bubbleRoot.SetParentOrigin(ParentOrigin::CENTER);
251 bubbleRoot.SetZ(0.1f); 250 bubbleRoot.SetZ(0.1f);
252 251
@@ -255,7 +254,7 @@ void NewWindowController::AddBubbles(const Vector2&amp; stageSize) @@ -255,7 +254,7 @@ void NewWindowController::AddBubbles(const Vector2&amp; stageSize)
255 mEmitTrackTimer.Start(); 254 mEmitTrackTimer.Start();
256 } 255 }
257 256
258 -void NewWindowController::AddMeshActor() 257 +void NewWindowController::AddMeshActor( Actor& parentActor )
259 { 258 {
260 Geometry meshGeometry = CreateMeshGeometry(); 259 Geometry meshGeometry = CreateMeshGeometry();
261 260
@@ -272,15 +271,13 @@ void NewWindowController::AddMeshActor() @@ -272,15 +271,13 @@ void NewWindowController::AddMeshActor()
272 colorMeshActor.SetPosition(Vector3(0.0f, 50.0f, 0.0f)); 271 colorMeshActor.SetPosition(Vector3(0.0f, 50.0f, 0.0f));
273 colorMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS ); 272 colorMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS );
274 colorMeshActor.SetName("ColorMeshActor"); 273 colorMeshActor.SetName("ColorMeshActor");
275 - mContentLayer.Add( colorMeshActor ); 274 + parentActor.Add( colorMeshActor );
276 275
277 // Create a textured mesh 276 // Create a textured mesh
278 Image effectImage = ResourceImage::New(EFFECT_IMAGE); 277 Image effectImage = ResourceImage::New(EFFECT_IMAGE);
279 - Sampler sampler = Sampler::New(effectImage, "sTexture");  
280 -  
281 Shader shaderTextureMesh = Shader::New( VERTEX_TEXTURE_MESH, FRAGMENT_TEXTURE_MESH ); 278 Shader shaderTextureMesh = Shader::New( VERTEX_TEXTURE_MESH, FRAGMENT_TEXTURE_MESH );
282 Material textureMeshMaterial = Material::New( shaderTextureMesh ); 279 Material textureMeshMaterial = Material::New( shaderTextureMesh );
283 - textureMeshMaterial.AddSampler( sampler ); 280 + textureMeshMaterial.AddTexture(effectImage, "sTexture");
284 Renderer textureMeshRenderer = Renderer::New( meshGeometry, textureMeshMaterial ); 281 Renderer textureMeshRenderer = Renderer::New( meshGeometry, textureMeshMaterial );
285 282
286 Actor textureMeshActor = Actor::New(); 283 Actor textureMeshActor = Actor::New();
@@ -291,17 +288,17 @@ void NewWindowController::AddMeshActor() @@ -291,17 +288,17 @@ void NewWindowController::AddMeshActor()
291 textureMeshActor.SetPosition(Vector3(0.0f, 200.0f, 0.0f)); 288 textureMeshActor.SetPosition(Vector3(0.0f, 200.0f, 0.0f));
292 textureMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS ); 289 textureMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS );
293 textureMeshActor.SetName("TextureMeshActor"); 290 textureMeshActor.SetName("TextureMeshActor");
294 - mContentLayer.Add( textureMeshActor ); 291 + parentActor.Add( textureMeshActor );
295 } 292 }
296 293
297 -void NewWindowController::AddBlendingImageActor() 294 +void NewWindowController::AddBlendingImageActor( Actor& parentActor )
298 { 295 {
299 - ShaderEffect colorModifier = CreateColorModifierer(Vector3( 0.5f, 0.5f, 0.5f ));  
300 - Image effectImage = ResourceImage::New(EFFECT_IMAGE);  
301 - FrameBufferImage fb2 = CreateFrameBufferForImage( EFFECT_IMAGE, effectImage, colorModifier ); 296 + Property::Map colorModifier = CreateColorModifierer();
  297 +
  298 + FrameBufferImage fb2 = CreateFrameBufferForImage( EFFECT_IMAGE, colorModifier, Vector3( 0.5f, 0.5f, 0.5f ) );
302 299
303 ImageView tmpActor = ImageView::New(fb2); 300 ImageView tmpActor = ImageView::New(fb2);
304 - mContentLayer.Add(tmpActor); 301 + parentActor.Add(tmpActor);
305 tmpActor.SetParentOrigin(ParentOrigin::CENTER_RIGHT); 302 tmpActor.SetParentOrigin(ParentOrigin::CENTER_RIGHT);
306 tmpActor.SetAnchorPoint(AnchorPoint::TOP_RIGHT); 303 tmpActor.SetAnchorPoint(AnchorPoint::TOP_RIGHT);
307 tmpActor.SetPosition(Vector3(0.0f, 150.0f, 0.0f)); 304 tmpActor.SetPosition(Vector3(0.0f, 150.0f, 0.0f));
@@ -319,16 +316,16 @@ void NewWindowController::AddBlendingImageActor() @@ -319,16 +316,16 @@ void NewWindowController::AddBlendingImageActor()
319 blendActor.SetPosition(Vector3(0.0f, 100.0f, 0.0f)); 316 blendActor.SetPosition(Vector3(0.0f, 100.0f, 0.0f));
320 blendActor.SetSize(140, 140); 317 blendActor.SetSize(140, 140);
321 blendActor.SetShaderEffect( blendShader ); 318 blendActor.SetShaderEffect( blendShader );
322 - mContentLayer.Add(blendActor); 319 + parentActor.Add(blendActor);
323 } 320 }
324 321
325 -void NewWindowController::AddTextLabel() 322 +void NewWindowController::AddTextLabel( Actor& parentActor )
326 { 323 {
327 mTextActor = TextLabel::New("Some text"); 324 mTextActor = TextLabel::New("Some text");
328 mTextActor.SetParentOrigin(ParentOrigin::CENTER); 325 mTextActor.SetParentOrigin(ParentOrigin::CENTER);
329 mTextActor.SetColor(Color::RED); 326 mTextActor.SetColor(Color::RED);
330 mTextActor.SetName("PushMe text"); 327 mTextActor.SetName("PushMe text");
331 - mContentLayer.Add( mTextActor ); 328 + parentActor.Add( mTextActor );
332 } 329 }
333 330
334 ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName) 331 ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName)
@@ -352,26 +349,25 @@ ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName) @@ -352,26 +349,25 @@ ImageView NewWindowController::CreateBlurredMirrorImage(const char* imageName)
352 return blurredActor; 349 return blurredActor;
353 } 350 }
354 351
355 -FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect) 352 +FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imageName, Property::Map& shaderEffect, const Vector3& rgbDelta )
356 { 353 {
357 Stage stage = Stage::GetCurrent(); 354 Stage stage = Stage::GetCurrent();
358 - Uint16Pair intFboSize = ResourceImage::GetImageSize(imageName); 355 + Uint16Pair intFboSize = ResourceImage::GetImageSize( imageName );
359 Vector2 FBOSize = Vector2(intFboSize.GetWidth(), intFboSize.GetHeight()); 356 Vector2 FBOSize = Vector2(intFboSize.GetWidth(), intFboSize.GetHeight());
360 357
361 FrameBufferImage framebuffer = FrameBufferImage::New(FBOSize.x, FBOSize.y ); 358 FrameBufferImage framebuffer = FrameBufferImage::New(FBOSize.x, FBOSize.y );
362 359
363 RenderTask renderTask = stage.GetRenderTaskList().CreateTask(); 360 RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
364 361
365 - ImageActor imageActor = ImageActor::New(image);  
366 - imageActor.SetName("Source image actor");  
367 - if(shaderEffect)  
368 - {  
369 - imageActor.SetShaderEffect(shaderEffect);  
370 - }  
371 - imageActor.SetParentOrigin(ParentOrigin::CENTER);  
372 - imageActor.SetAnchorPoint(AnchorPoint::CENTER);  
373 - imageActor.SetScale(1.0f, -1.0f, 1.0f);  
374 - stage.Add(imageActor); // Not in default image view 362 + ImageView imageView = ImageView::New( imageName );
  363 + imageView.SetName("Source image actor");
  364 + imageView.SetProperty( ImageView::Property::IMAGE, shaderEffect );
  365 + imageView.RegisterProperty( "uRGBDelta", rgbDelta );
  366 +
  367 + imageView.SetParentOrigin(ParentOrigin::CENTER);
  368 + imageView.SetAnchorPoint(AnchorPoint::CENTER);
  369 + imageView.SetScale(1.0f, -1.0f, 1.0f);
  370 + stage.Add(imageView); // Not in default image view
375 371
376 CameraActor cameraActor = CameraActor::New(FBOSize); 372 CameraActor cameraActor = CameraActor::New(FBOSize);
377 cameraActor.SetParentOrigin(ParentOrigin::CENTER); 373 cameraActor.SetParentOrigin(ParentOrigin::CENTER);
@@ -382,7 +378,7 @@ FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imag @@ -382,7 +378,7 @@ FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imag
382 cameraActor.SetPosition(0.0f, 0.0f, ((FBOSize.height * 0.5f) / tanf(Math::PI * 0.125f))); 378 cameraActor.SetPosition(0.0f, 0.0f, ((FBOSize.height * 0.5f) / tanf(Math::PI * 0.125f)));
383 stage.Add(cameraActor); 379 stage.Add(cameraActor);
384 380
385 - renderTask.SetSourceActor(imageActor); 381 + renderTask.SetSourceActor(imageView);
386 renderTask.SetInputEnabled(false); 382 renderTask.SetInputEnabled(false);
387 renderTask.SetTargetFrameBuffer(framebuffer); 383 renderTask.SetTargetFrameBuffer(framebuffer);
388 renderTask.SetCameraActor( cameraActor ); 384 renderTask.SetCameraActor( cameraActor );
@@ -453,12 +449,16 @@ Geometry NewWindowController::CreateMeshGeometry() @@ -453,12 +449,16 @@ Geometry NewWindowController::CreateMeshGeometry()
453 return geometry; 449 return geometry;
454 } 450 }
455 451
456 -ShaderEffect NewWindowController::CreateColorModifierer( const Vector3& rgbDelta ) 452 +Dali::Property::Map NewWindowController::CreateColorModifierer()
457 { 453 {
458 - std::string fragmentShader = MAKE_SHADER( 454 + const char* fragmentShader ( DALI_COMPOSE_SHADER (
459 precision highp float;\n 455 precision highp float;\n
460 uniform vec3 uRGBDelta;\n 456 uniform vec3 uRGBDelta;\n
461 uniform float uIgnoreAlpha;\n 457 uniform float uIgnoreAlpha;\n
  458 + \n
  459 + varying mediump vec2 vTexCoord;\n
  460 + uniform sampler2D sTexture;\n
  461 + \n
462 float rand(vec2 co) \n 462 float rand(vec2 co) \n
463 {\n 463 {\n
464 return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n} 464 return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n}
@@ -473,12 +473,14 @@ ShaderEffect NewWindowController::CreateColorModifierer( const Vector3&amp; rgbDelta @@ -473,12 +473,14 @@ ShaderEffect NewWindowController::CreateColorModifierer( const Vector3&amp; rgbDelta
473 color.rgb -= min(color.rgb*2.0, 0.0);\n 473 color.rgb -= min(color.rgb*2.0, 0.0);\n
474 gl_FragColor = color; \n 474 gl_FragColor = color; \n
475 }\n 475 }\n
476 - ); 476 + ) );
477 477
478 - ShaderEffect shaderEffect = ShaderEffect::New("", fragmentShader);  
479 - shaderEffect.SetUniform( "uRGBDelta", rgbDelta ); 478 + Property::Map map;
  479 + Property::Map customShader;
  480 + customShader[ "fragment-shader" ] = fragmentShader;
  481 + map[ "shader" ] = customShader;
480 482
481 - return shaderEffect; 483 + return map;
482 } 484 }
483 485
484 void NewWindowController::NewWindow(void) 486 void NewWindowController::NewWindow(void)
examples/point-mesh/point-mesh-example.cpp
@@ -154,14 +154,12 @@ public: @@ -154,14 +154,12 @@ public:
154 154
155 mImage = ResourceImage::New( MATERIAL_SAMPLE ); 155 mImage = ResourceImage::New( MATERIAL_SAMPLE );
156 Image image = ResourceImage::New( MATERIAL_SAMPLE2 ); 156 Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
157 - mSampler1 = Sampler::New(mImage, "sTexture1");  
158 - mSampler2 = Sampler::New(image, "sTexture2");  
159 157
160 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); 158 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
161 159
162 mMaterial = Material::New( mShader ); 160 mMaterial = Material::New( mShader );
163 - mMaterial.AddSampler( mSampler1 );  
164 - mMaterial.AddSampler( mSampler2 ); 161 + mMaterial.AddTexture(mImage, "sTexture1");
  162 + mMaterial.AddTexture(image, "sTexture2");
165 163
166 mGeometry = CreateGeometry(); 164 mGeometry = CreateGeometry();
167 165
@@ -222,8 +220,6 @@ private: @@ -222,8 +220,6 @@ private:
222 Vector3 mStageSize; ///< The size of the stage 220 Vector3 mStageSize; ///< The size of the stage
223 221
224 Image mImage; 222 Image mImage;
225 - Sampler mSampler1;  
226 - Sampler mSampler2;  
227 Shader mShader; 223 Shader mShader;
228 Material mMaterial; 224 Material mMaterial;
229 Geometry mGeometry; 225 Geometry mGeometry;
examples/popup/popup-example.cpp
@@ -64,8 +64,7 @@ const char* const IMAGE1 = DALI_IMAGE_DIR &quot;gallery-medium-5.jpg&quot;; @@ -64,8 +64,7 @@ const char* const IMAGE1 = DALI_IMAGE_DIR &quot;gallery-medium-5.jpg&quot;;
64 const char* const IMAGE2 = DALI_IMAGE_DIR "background-magnifier.jpg"; 64 const char* const IMAGE2 = DALI_IMAGE_DIR "background-magnifier.jpg";
65 65
66 // Control area image. 66 // Control area image.
67 -const char* DEFAULT_CONTROL_AREA_IMAGE_PATH = DALI_IMAGE_DIR "popup_button_background.png"; ///< Control area image for the popup.  
68 -const Vector4 DEFAULT_CONTROL_AREA_9_PATCH_BORDER( 13.0f, 8.0f, 13.0f, 8.0f ); ///< Nine patch information for the control area background. 67 +const char* DEFAULT_CONTROL_AREA_IMAGE_PATH = DALI_IMAGE_DIR "popup_button_background.9.png"; ///< Control area image for the popup.
69 68
70 const ButtonItem POPUP_BUTTON_ITEMS[] = { 69 const ButtonItem POPUP_BUTTON_ITEMS[] = {
71 { POPUP_BUTTON_COMPLEX_ID, "Complex" }, 70 { POPUP_BUTTON_COMPLEX_ID, "Complex" },
@@ -352,10 +351,7 @@ public: @@ -352,10 +351,7 @@ public:
352 if( numberOfButtons > 0 ) 351 if( numberOfButtons > 0 )
353 { 352 {
354 // Start with a control area image. 353 // Start with a control area image.
355 - ImageActor footer = ImageActor::New( ResourceImage::New( DEFAULT_CONTROL_AREA_IMAGE_PATH ) );  
356 - // Nine patch information is only used for the default control area image.  
357 - footer.SetStyle( ImageActor::STYLE_NINE_PATCH );  
358 - footer.SetNinePatchBorder( DEFAULT_CONTROL_AREA_9_PATCH_BORDER ); 354 + Toolkit::ImageView footer = Toolkit::ImageView::New( DEFAULT_CONTROL_AREA_IMAGE_PATH );
359 footer.SetName( "control-area-image" ); 355 footer.SetName( "control-area-image" );
360 // Set up the container's layout. 356 // Set up the container's layout.
361 footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 357 footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
@@ -526,7 +522,7 @@ public: @@ -526,7 +522,7 @@ public:
526 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID ) 522 else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID )
527 { 523 {
528 mPopup = CreatePopup(); 524 mPopup = CreatePopup();
529 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) ); 525 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
530 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 526 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
531 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); 527 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
532 image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) ); 528 image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
@@ -615,7 +611,7 @@ public: @@ -615,7 +611,7 @@ public:
615 611
616 // Image 612 // Image
617 { 613 {
618 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) ); 614 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE1 );
619 image.SetName( "COMPLEX_IMAGE" ); 615 image.SetName( "COMPLEX_IMAGE" );
620 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 616 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
621 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); 617 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
examples/refraction-effect/refraction-effect-example.cpp
@@ -281,9 +281,8 @@ private: @@ -281,9 +281,8 @@ private:
281 mGeometry = CreateGeometry( MESH_FILES[mCurrentMeshId] ); 281 mGeometry = CreateGeometry( MESH_FILES[mCurrentMeshId] );
282 282
283 Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] ); 283 Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] );
284 - mSampler = Sampler::New( texture, "sTexture" );  
285 mMaterial = Material::New( mShaderFlat ); 284 mMaterial = Material::New( mShaderFlat );
286 - mMaterial.AddSampler( mSampler ); 285 + mMaterial.AddTexture( texture, "sTexture" );
287 286
288 mRenderer = Renderer::New( mGeometry, mMaterial ); 287 mRenderer = Renderer::New( mGeometry, mMaterial );
289 288
@@ -344,7 +343,7 @@ private: @@ -344,7 +343,7 @@ private:
344 { 343 {
345 mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES; 344 mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES;
346 Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] ); 345 Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] );
347 - mSampler.SetImage( texture ); 346 + mMaterial.SetTextureImage( 0, texture );
348 return true; 347 return true;
349 } 348 }
350 349
@@ -564,8 +563,6 @@ private: @@ -564,8 +563,6 @@ private:
564 563
565 Application& mApplication; 564 Application& mApplication;
566 Layer mContent; 565 Layer mContent;
567 -  
568 - Sampler mSampler;  
569 Material mMaterial; 566 Material mMaterial;
570 Geometry mGeometry; 567 Geometry mGeometry;
571 Renderer mRenderer; 568 Renderer mRenderer;
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
@@ -245,9 +245,9 @@ public: @@ -245,9 +245,9 @@ public:
245 mSceneActor.SetParentOrigin(ParentOrigin::CENTER); 245 mSceneActor.SetParentOrigin(ParentOrigin::CENTER);
246 246
247 // Create and add images to the scene actor: 247 // Create and add images to the scene actor:
248 - mImageActor1 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_1) );  
249 - mImageActor2 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_2) );  
250 - mImageActor3 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_3) ); 248 + mImageActor1 = ImageView::New( SCENE_IMAGE_1 );
  249 + mImageActor2 = ImageView::New( SCENE_IMAGE_2 );
  250 + mImageActor3 = ImageView::New( SCENE_IMAGE_3 );
251 251
252 mImageActor1.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 252 mImageActor1.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
253 mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 253 mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
@@ -458,9 +458,9 @@ private: @@ -458,9 +458,9 @@ private:
458 ImageActor mShadowPlane; 458 ImageActor mShadowPlane;
459 Actor mCastingLight; 459 Actor mCastingLight;
460 Actor mLightAnchor; 460 Actor mLightAnchor;
461 - ImageActor mImageActor1;  
462 - ImageActor mImageActor2;  
463 - ImageActor mImageActor3; 461 + ImageView mImageActor1;
  462 + ImageView mImageActor2;
  463 + ImageView mImageActor3;
464 PanGestureDetector mPanGestureDetector; 464 PanGestureDetector mPanGestureDetector;
465 PinchGestureDetector mPinchGestureDetector; 465 PinchGestureDetector mPinchGestureDetector;
466 TapGestureDetector mTapGestureDetector; 466 TapGestureDetector mTapGestureDetector;
examples/size-negotiation/size-negotiation-example.cpp
@@ -709,7 +709,7 @@ public: @@ -709,7 +709,7 @@ public:
709 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 709 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
710 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 710 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
711 711
712 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); 712 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
713 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 713 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
714 714
715 mPopup.Add( image ); 715 mPopup.Add( image );
@@ -722,7 +722,7 @@ public: @@ -722,7 +722,7 @@ public:
722 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 722 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
723 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 723 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
724 724
725 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); 725 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
726 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 726 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
727 image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO ); 727 image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
728 728
@@ -736,7 +736,7 @@ public: @@ -736,7 +736,7 @@ public:
736 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 736 mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
737 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) ); 737 mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
738 738
739 - ImageActor image = ImageActor::New( ResourceImage::New( IMAGE ) ); 739 + Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
740 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 740 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
741 image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO ); 741 image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
742 742
examples/text-message-field/text-message-field-example.cpp
@@ -86,7 +86,14 @@ public: @@ -86,7 +86,14 @@ public:
86 rootActor.Add( desktop ); // Add desktop (content) to offscreen actor 86 rootActor.Add( desktop ); // Add desktop (content) to offscreen actor
87 87
88 // Create Photo Box A 88 // Create Photo Box A
89 - ImageActor photoBoxA = CreateSolidColorActor( Vector4(0,0,0,0), true, Color::WHITE, 1 ); 89 + Control photoBoxA = Control::New();
  90 +
  91 + Dali::Property::Map border;
  92 + border.Insert( "renderer-type", "border-renderer" );
  93 + border.Insert( "border-color", Color::WHITE );
  94 + border.Insert( "border-size", 1.f );
  95 + photoBoxA.SetProperty( Control::Property::BACKGROUND, border );
  96 +
90 photoBoxA.SetName("photoBoxA"); 97 photoBoxA.SetName("photoBoxA");
91 photoBoxA.SetAnchorPoint( AnchorPoint::CENTER ); 98 photoBoxA.SetAnchorPoint( AnchorPoint::CENTER );
92 photoBoxA.SetParentOrigin( ParentOrigin::CENTER ); 99 photoBoxA.SetParentOrigin( ParentOrigin::CENTER );
@@ -101,7 +108,6 @@ public: @@ -101,7 +108,6 @@ public:
101 field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 108 field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
102 field.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) ); 109 field.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) );
103 field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 110 field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
104 - field.SetZ( 1.0f );  
105 field.SetProperty( TextField::Property::TEXT, "Enter Title name" ); 111 field.SetProperty( TextField::Property::TEXT, "Enter Title name" );
106 field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( SCREEN_BORDER, SCREEN_BORDER, mStageSize.width - SCREEN_BORDER*2, mStageSize.height - SCREEN_BORDER*2 ) ); 112 field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( SCREEN_BORDER, SCREEN_BORDER, mStageSize.width - SCREEN_BORDER*2, mStageSize.height - SCREEN_BORDER*2 ) );
107 photoBoxA.Add( field ); 113 photoBoxA.Add( field );
examples/textured-mesh/textured-mesh-example.cpp
@@ -144,18 +144,15 @@ public: @@ -144,18 +144,15 @@ public:
144 // Hide the indicator bar 144 // Hide the indicator bar
145 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); 145 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
146 146
147 - mImage = ResourceImage::New( MATERIAL_SAMPLE, ResourceImage::ON_DEMAND, Image::NEVER );  
148 - mSampler1 = Sampler::New(mImage, "sTexture");  
149 - 147 + mImage = ResourceImage::New( MATERIAL_SAMPLE );
150 Image image = ResourceImage::New( MATERIAL_SAMPLE2 ); 148 Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
151 - mSampler2 = Sampler::New(image, "sTexture");  
152 149
153 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); 150 mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
154 mMaterial1 = Material::New( mShader ); 151 mMaterial1 = Material::New( mShader );
155 - mMaterial1.AddSampler( mSampler1 ); 152 + mMaterial1.AddTexture(mImage, "sTexture");
156 153
157 mMaterial2 = Material::New( mShader ); 154 mMaterial2 = Material::New( mShader );
158 - mMaterial2.AddSampler( mSampler2 ); 155 + mMaterial2.AddTexture(image, "sTexture");
159 156
160 mGeometry = CreateGeometry(); 157 mGeometry = CreateGeometry();
161 158
@@ -264,8 +261,6 @@ private: @@ -264,8 +261,6 @@ private:
264 Vector3 mStageSize; ///< The size of the stage 261 Vector3 mStageSize; ///< The size of the stage
265 262
266 Image mImage; 263 Image mImage;
267 - Sampler mSampler1;  
268 - Sampler mSampler2;  
269 Shader mShader; 264 Shader mShader;
270 Material mMaterial1; 265 Material mMaterial1;
271 Material mMaterial2; 266 Material mMaterial2;
packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 Name: com.samsung.dali-demo 3 Name: com.samsung.dali-demo
4 Summary: The OpenGLES Canvas Core Demo 4 Summary: The OpenGLES Canvas Core Demo
5 -Version: 1.1.6 5 +Version: 1.1.7
6 Release: 1 6 Release: 1
7 Group: System/Libraries 7 Group: System/Libraries
8 License: Apache-2.0 8 License: Apache-2.0
resources/images/item-background-alpha.9.png 0 → 100644

385 Bytes

resources/images/item-background-alpha.png deleted

1.08 KB

resources/images/item-background.9.png 0 → 100644

489 Bytes

resources/images/item-background.png deleted

1.15 KB

resources/images/popup_button_background.png renamed to resources/images/popup_button_background.9.png

2.94 KB