[dali_1.9.14] Merge branch 'devel/master' 96/234896/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 May 2020 11:18:30 +0000 (12:18 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 May 2020 11:18:30 +0000 (12:18 +0100)
Change-Id: I9941cb4e05a184a3cf31daed5685d0c97680168a

39 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
build/tizen/docs-internal/dali-internal.doxy.in
dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
docs/content/programming-guide/popup.md
docs/content/programming-guide/size-negotiation-controls.h
docs/content/programming-guide/size-negotiation.h
packaging/dali-toolkit.spec

index 21f6f7c..f2b032d 100644 (file)
 #include <stdlib.h>
 
 #include <dali-toolkit-test-suite-utils.h>
+#include <toolkit-timer.h>
+#include <toolkit-event-thread-callback.h>
 #include <dali-toolkit/internal/visuals/texture-manager-impl.h>
 #include <dali-toolkit/internal/visuals/texture-upload-observer.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
 using namespace Dali::Toolkit::Internal;
 
@@ -37,11 +40,27 @@ void utc_dali_toolkit_texture_manager_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+namespace
+{
+
+const char* TEST_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+
+}
+
 class TestObserver : public Dali::Toolkit::TextureUploadObserver
 {
 public:
+  enum class CompleteType
+  {
+    NOT_COMPLETED = 0,
+    UPLOAD_COMPLETE,
+    LOAD_COMPLETE
+  };
+
+public:
   TestObserver()
-  : mLoaded(false),
+  : mCompleteType( CompleteType::NOT_COMPLETED ),
+    mLoaded(false),
     mObserverCalled(false)
   {
   }
@@ -49,16 +68,19 @@ public:
   virtual void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet,
                                bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override
   {
+    mCompleteType = CompleteType::UPLOAD_COMPLETE;
     mLoaded = loadSuccess;
     mObserverCalled = true;
   }
 
   virtual void LoadComplete( bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied ) override
   {
+    mCompleteType = CompleteType::LOAD_COMPLETE;
     mLoaded = loadSuccess;
     mObserverCalled = true;
   }
 
+  CompleteType mCompleteType;
   bool mLoaded;
   bool mObserverCalled;
 };
@@ -117,3 +139,68 @@ int UtcTextureManagerGenerateHash(void)
 
   END_TEST;
 }
+
+int UtcTextureManagerCachingForDifferentLoadingType(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcTextureManagerCachingForDifferentLoadingType" );
+
+  TextureManager textureManager; // Create new texture manager
+
+  TestObserver observer1;
+  std::string filename( TEST_IMAGE_FILE_NAME );
+  auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+  textureManager.RequestLoad(
+    filename,
+    ImageDimensions(),
+    FittingMode::SCALE_TO_FILL,
+    SamplingMode::BOX_THEN_LINEAR,
+    TextureManager::NO_ATLAS,
+    &observer1,
+    true,
+    TextureManager::ReloadPolicy::CACHED,
+    preMultiply);
+
+  DALI_TEST_EQUALS( observer1.mLoaded, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer1.mObserverCalled, false, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( observer1.mLoaded, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer1.mObserverCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer1.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
+
+  TestObserver observer2;
+  Devel::PixelBuffer pixelBuffer = textureManager.LoadPixelBuffer(
+    filename,
+    ImageDimensions(),
+    FittingMode::SCALE_TO_FILL,
+    SamplingMode::BOX_THEN_LINEAR,
+    false,
+    &observer2,
+    true,
+    preMultiply);
+
+  DALI_TEST_EQUALS( observer2.mLoaded, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer2.mObserverCalled, false, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( observer2.mLoaded, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer2.mObserverCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( observer2.mCompleteType, TestObserver::CompleteType::LOAD_COMPLETE, TEST_LOCATION );
+
+  END_TEST;
+}
index 7a5fa3e..01b9096 100644 (file)
@@ -1635,7 +1635,7 @@ int UtcDaliBuilderTypeCasts(void)
   DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( createdActor.GetProperty< bool >( Actor::Property::SENSITIVE ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
 
   END_TEST;
 }
index 0a483a0..afc6aee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -190,6 +190,46 @@ int UtcDaliGaussianBlurActivateDeactivate(void)
 }
 
 // Positive test case for a method
+int UtcDaliGaussianBlurActivateDeactivateRepeat(void)
+{
+  ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+  tet_infoline("UtcDaliGaussianBlurActivateDeactivateRepeat");
+
+  Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
+  DALI_TEST_CHECK( view );
+
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  view.SetSize(Stage::GetCurrent().GetSize());
+  view.Add(Actor::New());
+  Stage::GetCurrent().Add(view);
+  view.Activate();
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_CHECK( gl.GetLastGenTextureId() == 3 );
+
+  view.Deactivate();
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_CHECK( gl.GetLastGenTextureId() == 3 );
+
+  view.Activate();
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_CHECK( gl.GetLastGenTextureId() == 6 );
+
+  END_TEST;
+}
+
+// Positive test case for a method
 int UtcDaliGaussianBlurViewSetGetBackgroundColor(void)
 {
   ToolkitTestApplication application;
@@ -229,10 +269,10 @@ int UtcDaliGaussianBlurViewSetGetRenderTarget(void)
   END_TEST;
 }
 
-int UtcDaliGaussianBlurViewActivateOnce(void)
+int UtcDaliGaussianBlurViewActivateOnce1(void)
 {
   ToolkitTestApplication application;
-  tet_infoline("UtcDaliGaussianBlurActivateOnce");
+  tet_infoline("UtcDaliGaussianBlurActivateOnce1");
 
   Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
   DALI_TEST_CHECK( view );
@@ -253,6 +293,39 @@ int UtcDaliGaussianBlurViewActivateOnce(void)
   END_TEST;
 }
 
+// Positive test case for a method
+int UtcDaliGaussianBlurActivateOnce2(void)
+{
+  ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+  tet_infoline("UtcDaliGaussianBlurActivateOnce2");
+
+  Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
+  DALI_TEST_CHECK( view );
+
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  view.SetSize(Stage::GetCurrent().GetSize());
+  view.Add(Actor::New());
+  Stage::GetCurrent().Add(view);
+  view.ActivateOnce();
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_CHECK( gl.GetLastGenTextureId() == 3 );
+
+  view.ActivateOnce();
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_CHECK( gl.GetLastGenTextureId() == 6 );
+
+  END_TEST;
+}
+
 int UtcDaliGaussianBlurViewFinishedSignalN(void)
 {
   ToolkitTestApplication application;
index d733a8c..9e811c8 100644 (file)
@@ -94,6 +94,8 @@ static const char* gImage_600_RGB = TEST_RESOURCE_DIR "/test-image-600.jpg";
 // resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame
 const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
 
+const char* TEST_VECTOR_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR  "/insta_camera.json";
+
 void TestImage( ImageView imageView, BufferImage image )
 {
   Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
@@ -2120,7 +2122,6 @@ int UtcDaliImageViewFillMode(void)
   ToolkitTestApplication application;
 
   tet_infoline( "Create an ImageVisual without padding and set the fill-mode to fill" );
-  tet_infoline( "  There should be no need to change the transform, our size-policy should be relative and size should be [1,1]");
 
   ImageView imageView = ImageView::New();
   Property::Map imageMap;
@@ -2145,18 +2146,718 @@ int UtcDaliImageViewFillMode(void)
   Property::Map* map = value->GetMap();
   DALI_TEST_CHECK( map );
 
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModeFitKeepAspectRatio(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using FitKeepAspectRatio ( image: [600,600], view: [600,700] )" );
+  tet_infoline( "  There should be need to change the transform, offset is adjusted to fit inside");
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO );
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
   // If there's
   value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
   DALI_TEST_CHECK( value );
-  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION ); // Relative size so will take up 100%
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 50 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesFill(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using Fill ( image: [600,600], view: [600,700] )" );
+  tet_infoline( "  There should be no need to change the transform, only size is changed to fit view");
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::FILL );
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION ); // Change the internal size according to the image view size
 
   value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
 
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesOverfitKeepAspectRatio(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using OverFitKeepAspectRatio ( image: [600,600], view: [600,500] )" );
+  tet_infoline( "  offset or size is the same as view, but adjust internally using pixelArea ");
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO );
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,500);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  // If there's
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 500 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesCenter01(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using Center ( image: [600,600], view: [700,700] )" );
+  tet_infoline( "  There should be need to change the transform, offset is adjusted to fit inside");
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(700,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 50 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesCenter02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using Center ( image: [600,600], view: [500,500] )" );
+  tet_infoline( "  There should be need to change the transform, offset is adjusted to fit inside");
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(700,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 50 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesFitHeight01(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using FitHeight ( image: [600,600], view: [600,700] )" );
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesFitHeight02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using FitHeight ( image: [600,600], view: [700,600] )" );
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 249x169 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(700,600);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+
   END_TEST;
 }
 
+int UtcDaliImageViewFittingModesFitWidth01(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using FitWidth ( image: [600,600], view: [600,700] )" );
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 50 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesFitWidth02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using FitWidth ( image: [600,600], view:[700,600] )" );
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 249x169 image
+  imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(700,600);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesChangeFittingMode01(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]" );
+
+  ImageView imageView = ImageView::New();
+
+  // 1. Render using FittingMode::SHRINK_TO_FIT
+  Property::Map imageMap;
+  imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] =  Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+
+  // 2. Render again using DevelVisaul::CENTER
+  Property::Map imageMap2;
+  imageMap2[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap2[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap2[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::CENTER;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  returnedMap.Clear();
+  visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+
+  visual.CreatePropertyMap( returnedMap );
+
+  value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 100, 50 ), TEST_LOCATION );
+
+  // 3. Render again using before fittingMode
+  Property::Map imageMap3;
+  imageMap3[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap3[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap3[ DevelVisual::Property::VISUAL_FITTING_MODE ] =  Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  returnedMap.Clear();
+  visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  visual.CreatePropertyMap( returnedMap );
+
+  value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesChangeFittingMode02(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]" );
+
+  ImageView imageView = ImageView::New();
+
+  // 1. Render using FittingMode::OVER_FIT_KEEP_ASPECT_RATIO
+  Property::Map imageMap;
+  imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] =  Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 800, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+
+  // 2. Render again using DevelVisaul::CENTER
+  Property::Map imageMap2;
+  imageMap2[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap2[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap2[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::CENTER;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  returnedMap.Clear();
+  visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+
+  visual.CreatePropertyMap( returnedMap );
+
+  value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 100, 50 ), TEST_LOCATION );
+
+  // 3. Render again using before fittingMode
+  Property::Map imageMap3;
+  imageMap3[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
+  imageMap3[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
+  imageMap3[ DevelVisual::Property::VISUAL_FITTING_MODE ] =  Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
+  imageView.SetSize(800,700);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  returnedMap.Clear();
+  visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  visual.CreatePropertyMap( returnedMap );
+
+  value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 800, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliImageViewFittingModesWithAnimatedVectorImageVisual(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline( "Create an ImageVisual using ScaleToFill and animated vector image ( image: [600,600], view:[600,600] )" );
+
+  ImageView imageView = ImageView::New();
+  Property::Map imageMap;
+  imageMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE );
+  imageMap.Add( Toolkit::ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME ); // 249x169 image
+
+  imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+  imageView.SetSize(600,600);
+
+  Stage::GetCurrent().Add( imageView );
+
+  // Trigger a potential relayout
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+  Property::Map returnedMap;
+  visual.CreatePropertyMap( returnedMap );
+
+  Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
+  DALI_TEST_CHECK( value );
+  Property::Map* map = value->GetMap();
+  DALI_TEST_CHECK( map );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION ); // Relative size so will take up 100%
+
+  value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
+
+  value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+
+  END_TEST;
+}
+
+
 int UtcDaliImageViewCustomShader(void)
 {
   ToolkitTestApplication application;
index 31faabb..08f601e 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -467,6 +467,44 @@ int UtcDaliPopupSetControlFooterMultiple(void)
   END_TEST;
 }
 
+int UtcDaliPopupSetTitleAndFooter(void)
+{
+  ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
+  tet_infoline( " UtcDaliPopupSetTitleAndFooter" );
+
+  // Create the Popup actor
+  Popup popup = Popup::New();
+
+  // Put in show state so it's layer is connected to popup (for ancestor check).
+  popup.SetDisplayState( Popup::SHOWN );
+
+  // Add the title
+  TextLabel titleActor = TextLabel::New();
+  titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, "title" );
+
+  DALI_TEST_CHECK( !popup.GetTitle() );
+  popup.SetTitle( titleActor );
+  TextLabel textActor = TextLabel::DownCast( popup.GetTitle() );
+  DALI_TEST_CHECK( textActor == titleActor );
+
+  std::string resultText;
+  DALI_TEST_CHECK( textActor.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) );
+  DALI_TEST_CHECK( ( popup.GetTitle() ) && ( resultText == "title" ) );
+  // verify titleActor is actually inside popup, and not elsewhere on stage, or off even.
+  DALI_TEST_CHECK( HasAncestor( titleActor, popup ) );
+
+  // Add the footer
+  PushButton button = PushButton::New();
+  DALI_TEST_CHECK( !HasAncestor(button, popup) );
+  popup.SetFooter( button );
+  // Hide and then re-show popup to cause button to be rearranged and added to popup.
+  popup.SetDisplayState( Popup::HIDDEN );
+  popup.SetDisplayState( Popup::SHOWN );
+  DALI_TEST_CHECK( HasAncestor( button, popup ) );
+
+  END_TEST;
+}
+
 int UtcDaliPopupSetStateP(void)
 {
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
index 5735515..d420979 100755 (executable)
@@ -1105,6 +1105,51 @@ int UtcDaliToolkitTextlabelScrollingN(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextlabelScrollingWithEllipsis(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelScrollingWithEllipsis");
+
+  TextLabel label = TextLabel::New("Some text to scroll");
+  DALI_TEST_CHECK( label );
+
+  Stage::GetCurrent().Add( label );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+  // Turn on all the effects.
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+
+  try
+  {
+    // Enable the auto scrolling effect.
+    label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
+
+    // Disable the ellipsis
+    label.SetProperty( TextLabel::Property::ELLIPSIS, false );
+
+    // Render the text.
+    application.SendNotification();
+    application.Render();
+
+    // Stop auto scrolling
+    label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+
+    // Check the ellipsis property
+    DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliToolkitTextlabelEllipsis(void)
 {
   ToolkitTestApplication application;
index 98dc9dd..b049d26 100644 (file)
@@ -859,7 +859,7 @@ int UtcDaliVisualGetPropertyMap5(void)
 
   value = resultMap.Find( ImageVisual::Property::FITTING_MODE,   Property::INTEGER );
   DALI_TEST_CHECK( value );
-  DALI_TEST_CHECK( value->Get<int>() == FittingMode::SHRINK_TO_FIT );
+  DALI_TEST_CHECK( value->Get<int>() == FittingMode::DEFAULT );
 
   value = resultMap.Find( ImageVisual::Property::SAMPLING_MODE,   Property::INTEGER );
   DALI_TEST_CHECK( value );
index 3fcaf37..738d9b9 100644 (file)
@@ -355,6 +355,7 @@ ALIASES += SINCE_1_1="@since 1.1"
 ALIASES += SINCE_1_2="@since 1.2"
 ALIASES += SINCE_1_3="@since 1.3"
 ALIASES += SINCE_1_4="@since 1.4"
+ALIASES += SINCE_1_9="@since 1.9"
 
 # Extra tags for Tizen 3.0
 ALIASES += SINCE_1_2_2="@since 1.2.2"
@@ -400,6 +401,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += SINCE_1_2="\par Since:\n 4.0, DALi version 1.2"
 #ALIASES += SINCE_1_3="\par Since:\n 5.0, DALi version 1.3"
 #ALIASES += SINCE_1_4="\par Since:\n 5.5, DALi version 1.4"
+#ALIASES += SINCE_1_9="\par Since:\n 6.0, DALi version 1.9"
 
 ## Extra tags for Tizen 3.0
 #ALIASES += SINCE_1_2_2="\par Since:\n 3.0, DALi version 1.2.2"
index 9b7824c..49b0205 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_GAUSSIAN_BLUR_EFFECT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -226,7 +226,6 @@ public:
    * @brief Render the GaussianBlurView once.
    *
    * Must be called after you Add() it to the stage.
-   * Only works with a gaussian blur view created with blurUserImage = true.
    * Listen to the Finished signal to determine when the rendering has completed.
    * @SINCE_1_0.0
    */
index fd83765..e30f241 100644 (file)
@@ -90,8 +90,12 @@ enum Type
  */
 enum FittingMode
 {
-  FIT_KEEP_ASPECT_RATIO,  ///< The visual should be scaled to fit, preserving aspect ratio
-  FILL,                   ///< The visual should be stretched to fill, not preserving aspect ratio
+  FIT_KEEP_ASPECT_RATIO,     ///< The visual should be scaled to fit, preserving aspect ratio
+  FILL,                      ///< The visual should be stretched to fill, not preserving aspect ratio
+  OVER_FIT_KEEP_ASPECT_RATIO,///< The visual should be scaled to fit, preserving aspect ratio. The visual will be filled without empty area, and outside is cropped away.
+  CENTER,                    ///< The visual should keep original size of image. It is not scaled and not strecthed.
+  FIT_HEIGHT,                ///< The visual should be scaled to fit, preserving aspect ratio. Height is scaled proportionately to maintain aspect ratio. It will be deprecated.
+  FIT_WIDTH                  ///< The visual should be scaled to fit, preserving aspect ratio. Width is scaled proportionately to maintain aspect ratio. It will be deprecated.
 };
 
 /**
index 62aca10..c4d744e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -386,72 +386,68 @@ void GaussianBlurView::OnChildRemove( Actor& child )
 
 void GaussianBlurView::AllocateResources()
 {
-  // size of render targets etc is based on the size of this actor, ignoring z
-  if(mTargetSize != mLastSize)
-  {
-    mLastSize = mTargetSize;
+  mLastSize = mTargetSize;
+
+  // get size of downsampled render targets
+  mDownsampledWidth = mTargetSize.width * mDownsampleWidthScale;
+  mDownsampledHeight = mTargetSize.height * mDownsampleHeightScale;
+
+  // Create and place a camera for the renders corresponding to the (potentially downsampled) render targets' size
+  mRenderDownsampledCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
+  // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
+  mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
+  mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
+  mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
 
-    // get size of downsampled render targets
-    mDownsampledWidth = mTargetSize.width * mDownsampleWidthScale;
-    mDownsampledHeight = mTargetSize.height * mDownsampleHeightScale;
+  mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 
-    // Create and place a camera for the renders corresponding to the (potentially downsampled) render targets' size
-    mRenderDownsampledCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
+  // setup for normal operation
+  if(!mBlurUserImage)
+  {
+    // Create and place a camera for the children render, corresponding to its render target size
+    mRenderFullSizeCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
     // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
-    mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
-    mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
-    mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
+    mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
+    mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
+    mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
 
-    mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
+    float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
+    mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
 
-    // setup for normal operation
-    if(!mBlurUserImage)
-    {
-      // Create and place a camera for the children render, corresponding to its render target size
-      mRenderFullSizeCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
-      // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
-      mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
-      mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
-      mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-
-      float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
-      mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
-
-      // create offscreen buffer of new size to render our child actors to
-      mRenderTargetForRenderingChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
-      Texture texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
-      mRenderTargetForRenderingChildren.AttachColorTexture( texture );
-
-      // Set actor for performing a horizontal blur
-      SetRendererTexture( mHorizBlurActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
-
-      // Create offscreen buffer for vert blur pass
-      mRenderTarget1 = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
-      texture = Texture::New(TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight));
-      mRenderTarget1.AttachColorTexture( texture );
-
-      // use the completed blur in the first buffer and composite with the original child actors render
-      SetRendererTexture( mCompositingActor.GetRendererAt(0), mRenderTarget1 );
-
-      // set up target actor for rendering result, i.e. the blurred image
-      SetRendererTexture( mTargetActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
-    }
+    // create offscreen buffer of new size to render our child actors to
+    mRenderTargetForRenderingChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+    Texture texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+    mRenderTargetForRenderingChildren.AttachColorTexture( texture );
 
-    // Create offscreen buffer for horiz blur pass
-    mRenderTarget2 = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
-    Texture texture = Texture::New(TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight));
-    mRenderTarget2.AttachColorTexture( texture );
+    // Set actor for performing a horizontal blur
+    SetRendererTexture( mHorizBlurActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
 
-    // size needs to match render target
-    mHorizBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight);
+    // Create offscreen buffer for vert blur pass
+    mRenderTarget1 = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
+    texture = Texture::New(TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight));
+    mRenderTarget1.AttachColorTexture( texture );
 
-    // size needs to match render target
-    mVertBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight);
-    SetRendererTexture( mVertBlurActor.GetRendererAt(0), mRenderTarget2 );
+    // use the completed blur in the first buffer and composite with the original child actors render
+    SetRendererTexture( mCompositingActor.GetRendererAt(0), mRenderTarget1 );
 
-    // set gaussian blur up for new sized render targets
-    SetShaderConstants();
+    // set up target actor for rendering result, i.e. the blurred image
+    SetRendererTexture( mTargetActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
   }
+
+  // Create offscreen buffer for horiz blur pass
+  mRenderTarget2 = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
+  Texture texture = Texture::New(TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight));
+  mRenderTarget2.AttachColorTexture( texture );
+
+  // size needs to match render target
+  mHorizBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight);
+
+  // size needs to match render target
+  mVertBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight);
+  SetRendererTexture( mVertBlurActor.GetRendererAt(0), mRenderTarget2 );
+
+  // set gaussian blur up for new sized render targets
+  SetShaderConstants();
 }
 
 void GaussianBlurView::CreateRenderTasks()
@@ -470,6 +466,11 @@ void GaussianBlurView::CreateRenderTasks()
 
     mRenderChildrenTask.SetCameraActor(mRenderFullSizeCamera);
     mRenderChildrenTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
+
+    if( mRenderOnce )
+    {
+      mRenderChildrenTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
+    }
   }
 
   // perform a horizontal blur targeting the second buffer
@@ -481,7 +482,7 @@ void GaussianBlurView::CreateRenderTasks()
   mHorizBlurTask.SetClearColor( mBackgroundColor );
   mHorizBlurTask.SetCameraActor(mRenderDownsampledCamera);
   mHorizBlurTask.SetFrameBuffer( mRenderTarget2 );
-  if( mRenderOnce && mBlurUserImage )
+  if( mRenderOnce || ( mRenderOnce && mBlurUserImage ) )
   {
     mHorizBlurTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
   }
@@ -502,7 +503,7 @@ void GaussianBlurView::CreateRenderTasks()
   {
     mVertBlurTask.SetFrameBuffer( mRenderTarget1 );
   }
-  if( mRenderOnce && mBlurUserImage )
+  if( mRenderOnce || ( mRenderOnce && mBlurUserImage ) )
   {
     mVertBlurTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
     mVertBlurTask.FinishedSignal().Connect( this, &GaussianBlurView::OnRenderTaskFinished );
@@ -518,6 +519,11 @@ void GaussianBlurView::CreateRenderTasks()
 
     mCompositeTask.SetCameraActor(mRenderFullSizeCamera);
     mCompositeTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
+
+    if( mRenderOnce )
+    {
+      mCompositeTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
+    }
   }
 }
 
@@ -533,31 +539,37 @@ void GaussianBlurView::RemoveRenderTasks()
 
 void GaussianBlurView::Activate()
 {
-  // make sure resources are allocated and start the render tasks processing
-  Self().Add( mInternalRoot );
-  AllocateResources();
-  CreateRenderTasks();
-  mActivated = true;
+  if( !mActivated )
+  {
+    // make sure resources are allocated and start the render tasks processing
+    Self().Add( mInternalRoot );
+    AllocateResources();
+    CreateRenderTasks();
+    mActivated = true;
+  }
 }
 
 void GaussianBlurView::ActivateOnce()
 {
-  DALI_ASSERT_ALWAYS(mBlurUserImage); // Only works with blurring image mode.
+  Deactivate();
   mRenderOnce = true;
   Activate();
 }
 
 void GaussianBlurView::Deactivate()
 {
-  // stop render tasks processing
-  // Note: render target resources are automatically freed since we set the Image::Unused flag
-  mInternalRoot.Unparent();
-  RemoveRenderTasks();
-  mRenderTargetForRenderingChildren.Reset();
-  mRenderTarget1.Reset();
-  mRenderTarget2.Reset();
-  mRenderOnce = false;
-  mActivated = false;
+  if( mActivated )
+  {
+    // stop render tasks processing
+    // Note: render target resources are automatically freed since we set the Image::Unused flag
+    mInternalRoot.Unparent();
+    mRenderTargetForRenderingChildren.Reset();
+    mRenderTarget1.Reset();
+    mRenderTarget2.Reset();
+    RemoveRenderTasks();
+    mRenderOnce = false;
+    mActivated = false;
+  }
 }
 
 void GaussianBlurView::SetBlurBellCurveWidth(float blurBellCurveWidth)
index 035d1d8..28cbfff 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,6 +45,8 @@ namespace Internal
 namespace
 {
 
+const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
+
 BaseHandle Create()
 {
   return Toolkit::ImageView::New();
@@ -66,7 +68,8 @@ using namespace Dali;
 ImageView::ImageView()
 : Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mImageSize(),
-  mImageVisualPaddingSetByTransform( false )
+  mImageVisualPaddingSetByTransform( false ),
+  mImageViewPixelAreaSetByFittingMode( false )
 {
 }
 
@@ -286,57 +289,161 @@ float ImageView::GetWidthForHeight( float height )
 void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   Control::OnRelayout( size, container );
-
   if( mVisual )
   {
     Property::Map transformMap = Property::Map();
 
     Extents padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
-    const Visual::FittingMode fittingMode = Toolkit::GetImplementation(mVisual).GetFittingMode();
 
     bool zeroPadding = ( padding == Extents() );
-    if( ( !zeroPadding ) || // If padding is not zero
-        ( fittingMode == Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ) )
+
+    Vector2 naturalSize;
+    mVisual.GetNaturalSize( naturalSize );
+
+    Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(
+          Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+    if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
     {
-      Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(
-            Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+      std::swap( padding.start, padding.end );
+    }
 
-      if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
-      {
-        std::swap( padding.start, padding.end );
-      }
+    // remove padding from the size to know how much is left for the visual
+    Vector2 finalSize = size - Vector2( padding.start + padding.end, padding.top + padding.bottom );
+    Vector2 finalOffset = Vector2( padding.start, padding.top );
 
-      auto finalOffset = Vector2( padding.start, padding.top );
-      mImageVisualPaddingSetByTransform = true;
+    ApplyFittingMode( finalSize, naturalSize, finalOffset, zeroPadding , transformMap );
 
-      // remove padding from the size to know how much is left for the visual
-      auto finalSize = size - Vector2( padding.start + padding.end, padding.top + padding.bottom );
+    mVisual.SetTransformAndSize( transformMap, size );
 
-      // Should provide a transform that handles aspect ratio according to image size
-      if( fittingMode == Visual::FittingMode::FIT_KEEP_ASPECT_RATIO )
-      {
-        auto availableVisualSize = finalSize;
+    // mVisual is not updated util the resource is ready in the case of visual replacement.
+    // So apply the transform and size to the new visual.
+    Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+    if( visual && visual != mVisual )
+    {
+      visual.SetTransformAndSize( transformMap, size );
+    }
+  }
+}
+
+void ImageView::OnResourceReady( Toolkit::Control control )
+{
+  // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual.
+  mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+  // Signal that a Relayout may be needed
+}
 
-        Vector2 naturalSize;
-        mVisual.GetNaturalSize( naturalSize );
+void ImageView::SetTransformMapForFittingMode( Vector2 finalSize, Vector2 naturalSize, Vector2 finalOffset, Visual::FittingMode fittingMode, Property::Map& transformMap )
+{
+  switch(fittingMode)
+  {
+    case Visual::FittingMode::FIT_KEEP_ASPECT_RATIO:
+    {
+      auto availableVisualSize = finalSize;
 
-        // scale to fit the padded area
-        finalSize = naturalSize * std::min( ( naturalSize.width  ? ( availableVisualSize.width  / naturalSize.width  ) : 0 ),
+      // scale to fit the padded area
+      finalSize = naturalSize * std::min( ( naturalSize.width  ? ( availableVisualSize.width  / naturalSize.width  ) : 0 ),
                                             ( naturalSize.height ? ( availableVisualSize.height / naturalSize.height ) : 0 ) );
 
-        // calculate final offset within the padded area
-        finalOffset += ( availableVisualSize - finalSize ) * .5f;
+      // calculate final offset within the padded area
+      finalOffset += ( availableVisualSize - finalSize ) * .5f;
+
+      // populate the transform map
+      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, finalOffset )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE, finalSize );
+      break;
+    }
+    case Visual::FittingMode::OVER_FIT_KEEP_ASPECT_RATIO:
+    {
+      mImageViewPixelAreaSetByFittingMode = true;
+      auto availableVisualSize = finalSize;
+      finalSize = naturalSize * std::max( ( naturalSize.width  ? ( availableVisualSize.width  / naturalSize.width  ) : 0 ),
+                                          ( naturalSize.height ? ( availableVisualSize.height / naturalSize.height ) : 0 ) );
+
+      auto originalOffset = finalOffset;
+      finalOffset += ( availableVisualSize - finalSize ) * .5f;
+
+      float x = abs( (availableVisualSize.width - finalSize.width ) / finalSize.width )* .5f;
+      float y = abs( (availableVisualSize.height - finalSize.height ) / finalSize.height ) * .5f;
+      float widthRatio = 1.f - abs( (availableVisualSize.width - finalSize.width ) / finalSize.width );
+      float heightRatio = 1.f - abs( (availableVisualSize.height - finalSize.height ) / finalSize.height );
+      Vector4 pixelArea = Vector4( x, y, widthRatio, heightRatio);
+      Self().SetProperty( Toolkit::ImageView::Property::PIXEL_AREA, pixelArea );
+
+      // populate the transform map
+      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, originalOffset )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE, availableVisualSize );
+      break;
+    }
+    case Visual::FittingMode::CENTER:
+    {
+      auto availableVisualSize = finalSize;
+      if( availableVisualSize.width > naturalSize.width && availableVisualSize.height > naturalSize.height )
+      {
+        finalSize = naturalSize;
+      }
+      else
+      {
+        finalSize = naturalSize * std::min( ( naturalSize.width  ? ( availableVisualSize.width  / naturalSize.width  ) : 0 ),
+                                          ( naturalSize.height ? ( availableVisualSize.height / naturalSize.height ) : 0 ) );
       }
 
+      finalOffset += ( availableVisualSize - finalSize ) * .5f;
+
       // populate the transform map
       transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, finalOffset )
-                  .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY,
-                      Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE, finalSize );
+      break;
+    }
+    case Visual::FittingMode::FILL:
+    {
+      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, finalOffset )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE, finalSize );
+      break;
+    }
+    case Visual::FittingMode::FIT_WIDTH:
+    case Visual::FittingMode::FIT_HEIGHT:
+    {
+      // This FittingMode already converted
+      break;
+    }
+  }
+}
+
+void ImageView::ApplyFittingMode( Vector2 finalSize, Vector2 naturalSize, Vector2 finalOffset, bool zeroPadding , Property::Map& transformMap )
+{
+    Visual::FittingMode fittingMode = Toolkit::GetImplementation(mVisual).GetFittingMode();
+
+    // Reset PIXEL_AREA after using OVER_FIT_KEEP_ASPECT_RATIO
+    if( mImageViewPixelAreaSetByFittingMode )
+    {
+      Self().SetProperty( Toolkit::ImageView::Property::PIXEL_AREA, FULL_TEXTURE_RECT );
+      mImageViewPixelAreaSetByFittingMode = false;
+    }
+
+    if( ( !zeroPadding ) || // If padding is not zero
+        ( fittingMode != Visual::FittingMode::FILL ) )
+    {
+      mImageVisualPaddingSetByTransform = true;
+
+      // If FittingMode use FIT_WIDTH or FIT_HEIGTH, it need to change proper fittingMode
+      if( fittingMode == Visual::FittingMode::FIT_WIDTH )
+      {
+        fittingMode = ( finalSize.height  / naturalSize.height ) < ( finalSize.width / naturalSize.width ) ? Visual::FittingMode::OVER_FIT_KEEP_ASPECT_RATIO : Visual::FittingMode::FIT_KEEP_ASPECT_RATIO;
+      }
+      else if( fittingMode == Visual::FittingMode::FIT_HEIGHT )
+      {
+        fittingMode = ( finalSize.height  / naturalSize.height ) < ( finalSize.width / naturalSize.width ) ? Visual::FittingMode::FIT_KEEP_ASPECT_RATIO : Visual::FittingMode::OVER_FIT_KEEP_ASPECT_RATIO;
+      }
+
+      SetTransformMapForFittingMode( finalSize, naturalSize, finalOffset, fittingMode, transformMap );
+
+      // Set extra value for applying transformMap
+      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY,
+                        Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
                   .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
                   .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN )
-                  .Add( Toolkit::Visual::Transform::Property::SIZE, finalSize )
                   .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY,
-                      Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) );
+                        Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) );
     }
     else if ( mImageVisualPaddingSetByTransform && zeroPadding )  // Reset offset to zero only if padding applied previously
     {
@@ -344,27 +451,11 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
       // Reset the transform map
       transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2::ZERO )
                   .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY,
+                        Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE, Vector2::ONE )
+                  .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY,
                         Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) );
     }
-
-
-    mVisual.SetTransformAndSize( transformMap, size );
-
-    // mVisual is not updated util the resource is ready in the case of visual replacement.
-    // So apply the transform and size to the new visual.
-    Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
-    if( visual && visual != mVisual )
-    {
-      visual.SetTransformAndSize( transformMap, size );
-    }
-  }
-}
-
-void ImageView::OnResourceReady( Toolkit::Control control )
-{
-  // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual.
-  mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
-  // Signal that a Relayout may be needed
 }
 
 ///////////////////////////////////////////////////////////
index fe1bac1..382feb8 100644 (file)
@@ -155,6 +155,26 @@ private:
    */
   void OnResourceReady( Toolkit::Control control );
 
+  /**
+   * @brief Set TransformMap for fittingMode
+   * param[in] finalSize The size for fittingMode
+   * param[in] textureSize The size of texture
+   * param[in] offset The offset for fittingMode
+   * param[in] fittingMode The mode for fitting image
+   * param[in] transformMap  The map for fitting image
+   */
+  void SetTransformMapForFittingMode ( Vector2 finalSize, Vector2 textureSize, Vector2 offset, Visual::FittingMode fittingMode, Property::Map& transformMap );
+
+  /**
+   * @brief Apply fittingMode
+   * param[in] finalSize The size for fittingMode
+   * param[in] textureSize The size of texture
+   * param[in] offset The offset for fittingMode
+   * param[in] zeroPadding whether padding is zero
+   * param[in] transformMap  The map for fitting image
+   */
+  void ApplyFittingMode( Vector2 finalSize, Vector2 textureSize, Vector2 offset, bool zeroPadding , Property::Map& transformMap);
+
 private:
   // Undefined
   ImageView( const ImageView& );
@@ -170,6 +190,7 @@ private:
   ImageDimensions  mImageSize;    ///< the image size
 
   bool mImageVisualPaddingSetByTransform :1; //< Flag to indicate Padding was set using a transform.
+  bool mImageViewPixelAreaSetByFittingMode:1; //< Flag to indicate pixel area was set by fitting Mode
 };
 
 } // namespace Internal
index c0629c3..04fa8da 100644 (file)
@@ -263,7 +263,7 @@ void Magnifier::SetFrameVisibility(bool visible)
     mFrame.SetProperty( Actor::Property::INHERIT_SCALE, true );
     mFrame.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
     Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
-    mFrame.SetSizeModeFactor( sizeOffset );
+    mFrame.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeOffset );
 
     Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
 
index 6cb28d6..9204fa4 100644 (file)
@@ -589,7 +589,7 @@ void PageTurnView::AddPage( int pageIndex )
     }
 
     float degree = isLeftSide ? 180.f :0.f;
-    mPages[index].actor.SetOrientation( Degree( degree ), Vector3::YAXIS );
+    mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( degree ), Vector3::YAXIS ) );
     mPages[index].actor.SetProperty( Actor::Property::VISIBLE, false );
     mPages[index].UseEffect( mSpineEffectShader, mGeometry );
     mPages[index].SetTexture( newPage );
@@ -904,7 +904,7 @@ void PageTurnView::TurnedOver( Animation& animation )
   mAnimationPageIdPair.erase( animation );
 
   float degree = mPages[index].isTurnBack ? 180.f : 0.f;
-  mPages[index].actor.SetOrientation( Degree(degree), Vector3::YAXIS );
+  mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree(degree), Vector3::YAXIS ) );
   mPages[index].UseEffect( mSpineEffectShader );
 
   int id = pageId + (mPages[index].isTurnBack ? -1 : 1);
@@ -969,7 +969,7 @@ void PageTurnView::StopTurning()
     mPages[ index ].actor.RemoveConstraints();
     mPages[ index ].UseEffect( mSpineEffectShader );
     float degree = mTurningPageIndex==mCurrentPageIndex ? 0.f :180.f;
-    mPages[index].actor.SetOrientation( Degree(degree), Vector3::YAXIS );
+    mPages[index].actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree(degree), Vector3::YAXIS ) );
     mPageUpdated = true;
   }
 
index 8672c4a..4d0e156 100644 (file)
@@ -82,7 +82,7 @@ BaseHandle CreateToast()
   Toolkit::Popup popup = Toolkit::Popup::New();
 
   // Setup for Toast Popup type.
-  popup.SetSizeModeFactor( DEFAULT_TOAST_WIDTH_OF_STAGE_RATIO );
+  popup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_TOAST_WIDTH_OF_STAGE_RATIO );
   popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
   popup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
   popup.SetProperty( Toolkit::Popup::Property::CONTEXTUAL_MODE, Toolkit::Popup::NON_CONTEXTUAL );
@@ -282,7 +282,7 @@ void Popup::OnInitialize()
   self.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   self.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
 
-  self.SetSizeModeFactor( DEFAULT_POPUP_PARENT_RELATIVE_SIZE );
+  self.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_POPUP_PARENT_RELATIVE_SIZE );
   self.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
   self.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
 
@@ -636,7 +636,7 @@ void Popup::SetTitle( Actor titleActor )
   {
     // Set up padding to give sensible default behaviour
     // (an application developer can later override this if they wish).
-    mTitle.SetPadding( DEFAULT_TITLE_PADDING );
+    mTitle.SetProperty( Actor::Property::PADDING, DEFAULT_TITLE_PADDING );
 
     mPopupLayout.AddChild( mTitle, Toolkit::TableView::CellPosition( 0, 0 ) );
   }
@@ -823,11 +823,11 @@ void Popup::LayoutPopup()
   {
     if( !mContent && !mFooter )
     {
-      mTitle.SetPadding( DEFAULT_TITLE_ONLY_PADDING );
+      mTitle.SetProperty( Actor::Property::PADDING, DEFAULT_TITLE_ONLY_PADDING );
     }
     else
     {
-      mTitle.SetPadding( DEFAULT_TITLE_PADDING );
+      mTitle.SetProperty( Actor::Property::PADDING, DEFAULT_TITLE_PADDING );
     }
   }
 
@@ -1029,7 +1029,7 @@ void Popup::UpdateBackgroundPositionAndSize()
   if( mPopupBackgroundImage )
   {
     mPopupBackgroundImage.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
-    mPopupBackgroundImage.SetSizeModeFactor( Vector3( mBackgroundBorder.left + mBackgroundBorder.right, mBackgroundBorder.top + mBackgroundBorder.bottom, 0.0f ) );
+    mPopupBackgroundImage.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( mBackgroundBorder.left + mBackgroundBorder.right, mBackgroundBorder.top + mBackgroundBorder.bottom, 0.0f ) );
 
     // Adjust the position of the background so the transparent areas are set appropriately
     mPopupBackgroundImage.SetPosition( ( mBackgroundBorder.right - mBackgroundBorder.left ) * 0.5f, ( mBackgroundBorder.bottom - mBackgroundBorder.top ) * 0.5f );
index 2227242..74b5b62 100755 (executable)
@@ -215,7 +215,7 @@ ScrollBar::~ScrollBar()
 void ScrollBar::OnInitialize()
 {
   CreateDefaultIndicatorActor();
-  Self().SetDrawMode(DrawMode::OVERLAY_2D);
+  Self().SetProperty( Actor::Property::DRAW_MODE,DrawMode::OVERLAY_2D);
 }
 
 void ScrollBar::SetScrollPropertySource( Handle handle, Property::Index propertyScrollPosition, Property::Index propertyMinScrollPosition, Property::Index propertyMaxScrollPosition, Property::Index propertyScrollContentSize )
@@ -247,7 +247,7 @@ void ScrollBar::CreateDefaultIndicatorActor()
   indicator.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
   indicator.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   indicator.SetStyleName( "ScrollBarIndicator" );
-  indicator.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+  indicator.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
   SetScrollIndicator(indicator);
 }
 
index 43aa9a3..575f3aa 100755 (executable)
@@ -1508,7 +1508,7 @@ Vector2 ItemView::GetCurrentScrollPosition() const
 
 void ItemView::AddOverlay(Actor actor)
 {
-  actor.SetDrawMode( DrawMode::OVERLAY_2D );
+  actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
   Self().Add(actor);
 }
 
@@ -1575,7 +1575,7 @@ void ItemView::EnableScrollOvershoot( bool enable )
       mOvershootOverlay.SetProperty( Actor::Property::COLOR,mOvershootEffectColor);
       mOvershootOverlay.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT );
       mOvershootOverlay.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-      mOvershootOverlay.SetDrawMode( DrawMode::OVERLAY_2D );
+      mOvershootOverlay.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
       self.Add(mOvershootOverlay);
 
       ApplyOvershootSizeConstraint( mOvershootOverlay, mOvershootSize.height );
index ee80f49..6bd7c3b 100644 (file)
@@ -243,12 +243,12 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       const Vector3 parentSize = self.GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
       if(IsVertical())
       {
-        mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) );
+        mOvershootOverlay.SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) ) );
         mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
       }
       else
       {
-        mOvershootOverlay.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
+        mOvershootOverlay.SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) ) );
         mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
       }
@@ -262,13 +262,13 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       const Vector3 parentSize = self.GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
       if(IsVertical())
       {
-        mOvershootOverlay.SetOrientation( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) );
+        mOvershootOverlay.SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) ) );
         mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
       }
       else
       {
-        mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) );
+        mOvershootOverlay.SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) ) );
         mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
         relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
       }
index 0053778..c9ed830 100755 (executable)
@@ -1777,7 +1777,7 @@ void ScrollView::EnableScrollOvershoot(bool enable)
 
 void ScrollView::AddOverlay(Actor actor)
 {
-  actor.SetDrawMode( DrawMode::OVERLAY_2D );
+  actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
   mInternalActor.Add( actor );
 }
 
index 2830165..90ff3f4 100644 (file)
@@ -243,7 +243,7 @@ void ShadowView::OnInitialize()
   // Target is constrained to point at the shadow plane origin
   mCameraActor.SetNearClippingPlane( 1.0f );
   mCameraActor.SetType( Dali::Camera::FREE_LOOK ); // Camera orientation constrained to point at shadow plane world position
-  mCameraActor.SetOrientation(Radian(Degree(180)), Vector3::YAXIS);
+  mCameraActor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Radian(Degree(180)), Vector3::YAXIS) );
   mCameraActor.SetPosition(DEFAULT_LIGHT_POSITION);
 
   // Create render targets needed for rendering from light's point of view
@@ -275,7 +275,7 @@ void ShadowView::OnInitialize()
   mBlurRootActor.SetProperty( Actor::Property::INHERIT_POSITION, false );
   mBlurRootActor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false );
   mBlurRootActor.SetProperty( Actor::Property::INHERIT_SCALE, false );
-  mBlurRootActor.SetColorMode( USE_OWN_COLOR );
+  mBlurRootActor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR );
 
   Self().Add( mBlurRootActor );
 
index 4fa4bf6..94530e9 100755 (executable)
@@ -605,7 +605,7 @@ Toolkit::TextLabel Slider::CreatePopupText()
   textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
-  textLabel.SetPadding( Padding( POPUP_TEXT_PADDING, POPUP_TEXT_PADDING, 0.0f, 0.0f ) );
+  textLabel.SetProperty( Actor::Property::PADDING, Padding( POPUP_TEXT_PADDING, POPUP_TEXT_PADDING, 0.0f, 0.0f ) );
   return textLabel;
 }
 
index 9a85dce..3044818 100755 (executable)
@@ -835,8 +835,7 @@ void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
         }
         actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
 
-        Padding padding;
-        actor.GetPadding( padding );
+        Padding padding = actor.GetProperty<Vector4>( Actor::Property::PADDING );
 
         float left = (column > 0) ? mColumnData[column - 1].position : 0.f;
         float right;
index 2fddac3..e542d9c 100755 (executable)
@@ -1076,6 +1076,7 @@ void TextLabel::SetUpAutoScrolling()
   const int maxTextureSize = Dali::GetMaxTextureSize();
 
   //if the texture size width exceed maxTextureSize, modify the visual model size and enabled the ellipsis
+  bool actualellipsis = mController->IsTextElideEnabled();
   if( verifiedSize.width > maxTextureSize )
   {
     verifiedSize.width = maxTextureSize;
@@ -1108,6 +1109,7 @@ void TextLabel::SetUpAutoScrolling()
   // Set parameters for scrolling
   Renderer renderer = static_cast<Internal::Visual::Base&>( GetImplementation( mVisual ) ).GetRenderer();
   mTextScroller->SetParameters( Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment() );
+  mController->SetTextElideEnabled( actualellipsis );
 }
 
 void TextLabel::ScrollingFinished()
@@ -1115,7 +1117,6 @@ void TextLabel::ScrollingFinished()
   // Pure Virtual from TextScroller Interface
   DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::ScrollingFinished\n");
   mController->SetAutoScrollEnabled( false );
-  mController->SetTextElideEnabled( true );
   RequestTextRelayout();
 }
 
index 3a0ccfd..022ea1e 100644 (file)
@@ -267,7 +267,7 @@ void TextSelectionToolbar::SetUpScrollBar( bool enable )
       mScrollBar.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
       mScrollBar.SetPosition( mScrollBarPadding.x, -mScrollBarPadding.y );
       mScrollBar.SetResizePolicy( Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH );
-      mScrollBar.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
+      mScrollBar.SetProperty( Actor::Property::ORIENTATION, Quaternion( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) ) );
       mScrollBar.SetScrollIndicator( indicator );
       mScrollBar.GetPanGestureDetector().DetachAll();
       mScrollView.Add( mScrollBar );
index 1c95686..aea6c50 100644 (file)
@@ -104,7 +104,7 @@ void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
 
   // Create an alignment container where to place the control.
   Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( alignment );
-  alignmentContainer.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+  alignmentContainer.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
   alignmentContainer.SetPadding( padding );
   alignmentContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   alignmentContainer.Add( control );
index b9b62d3..42a79fb 100644 (file)
@@ -823,7 +823,7 @@ struct Decorator::Impl : public ConnectionTracker
         grabHandle.grabArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
         grabHandle.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
         grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-        grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
+        grabHandle.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
         grabHandle.actor.Add( grabHandle.grabArea );
         grabHandle.actor.SetProperty( Actor::Property::COLOR, mHandleColor );
 
@@ -893,7 +893,7 @@ struct Decorator::Impl : public ConnectionTracker
         primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
         primary.grabArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
         primary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
-        primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+        primary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
         primary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
 
@@ -937,7 +937,7 @@ struct Decorator::Impl : public ConnectionTracker
         secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
         secondary.grabArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
         secondary.grabArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
-        secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
+        secondary.grabArea.SetProperty( Actor::Property::SIZE_MODE_FACTOR, DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
 
         secondary.grabArea.TouchSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
 
@@ -1138,7 +1138,7 @@ struct Decorator::Impl : public ConnectionTracker
     // Whether to flip the handle vertically.
     if( handle.actor )
     {
-      handle.actor.SetOrientation( handle.verticallyFlipped ? ANGLE_180 : ANGLE_0, Vector3::XAXIS );
+      handle.actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( handle.verticallyFlipped ? ANGLE_180 : ANGLE_0, Vector3::XAXIS ) );
     }
   }
 
@@ -1152,7 +1152,7 @@ struct Decorator::Impl : public ConnectionTracker
       mHighlightActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
       mHighlightActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
       mHighlightActor.SetProperty( Actor::Property::COLOR, mHighlightColor );
-      mHighlightActor.SetColorMode( USE_OWN_COLOR );
+      mHighlightActor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR );
     }
 
     // Add the highlight box telling the controller it needs clipping.
index 0b1f2e2..2fe54b0 100755 (executable)
@@ -372,7 +372,7 @@ struct AtlasRenderer::Impl
       mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
       mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
       mActor.SetSize( textSize );
-      mActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+      mActor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
     }
 
     for( std::vector< MeshRecord >::const_iterator it = meshContainer.begin(),
@@ -744,7 +744,7 @@ struct AtlasRenderer::Impl
     actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
     actor.SetSize( actorSize );
     actor.RegisterProperty("uOffset", Vector2::ZERO );
-    actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+    actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
 
     return actor;
   }
index 9e270f4..5470d8d 100755 (executable)
@@ -3406,7 +3406,7 @@ Actor Controller::Impl::CreateBackgroundActor()
       actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
       actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
       actor.SetSize( textSize );
-      actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+      actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
       actor.AddRenderer( renderer );
     }
   }
index d151290..cd21afe 100644 (file)
@@ -114,7 +114,7 @@ void CubeTransitionEffect::SetTargetRight( unsigned int idx )
   mBoxes[ idx ].SetProperty(Actor::Property::PARENT_ORIGIN_Z, 1.0f - mTileSize.x * 0.5f );
 
   mTargetTiles[ idx ].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 1.f, 0.5f, 0.5f) );
-  mTargetTiles[ idx ].SetOrientation( Degree( 90.f ), Vector3::YAXIS );
+  mTargetTiles[ idx ].SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.f ), Vector3::YAXIS ) );
 }
 
 void CubeTransitionEffect::SetTargetLeft( unsigned int idx )
@@ -124,7 +124,7 @@ void CubeTransitionEffect::SetTargetLeft( unsigned int idx )
   mBoxes[ idx ].SetProperty(Actor::Property::PARENT_ORIGIN_Z, 1.0f - mTileSize.x * 0.5f );
 
   mTargetTiles[ idx ].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.f, 0.5f, 0.5f) );
-  mTargetTiles[ idx ].SetOrientation( Degree( -90.f ), Vector3::YAXIS );
+  mTargetTiles[ idx ].SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( -90.f ), Vector3::YAXIS ) );
 }
 
 void CubeTransitionEffect::SetTargetBottom( unsigned int idx )
@@ -134,7 +134,7 @@ void CubeTransitionEffect::SetTargetBottom( unsigned int idx )
   mBoxes[ idx ].SetProperty(Actor::Property::PARENT_ORIGIN_Z, 1.0f - mTileSize.y * 0.5f );
 
   mTargetTiles[ idx ].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.f, 0.5f) );
-  mTargetTiles[ idx ].SetOrientation( Degree( 90.f ), Vector3::XAXIS );
+  mTargetTiles[ idx ].SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.f ), Vector3::XAXIS ) );
 }
 
 void CubeTransitionEffect::SetTargetTop( unsigned int idx )
@@ -144,7 +144,7 @@ void CubeTransitionEffect::SetTargetTop( unsigned int idx )
   mBoxes[ idx ].SetProperty(Actor::Property::PARENT_ORIGIN_Z, 1.0f - mTileSize.y * 0.5f );
 
   mTargetTiles[ idx ].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.f, 0.5f) );
-  mTargetTiles[ idx ].SetOrientation( Degree( -90.f ), Vector3::XAXIS );
+  mTargetTiles[ idx ].SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( -90.f ), Vector3::XAXIS ) );
 }
 
 void CubeTransitionEffect::OnRelayout( const Vector2& size, RelayoutContainer& container )
index c553ced..ea4aaa2 100644 (file)
@@ -122,6 +122,7 @@ Geometry CreateGeometry( VisualFactoryCache& factoryCache, ImageDimensions gridS
 
 } // unnamed namespace
 
+
 ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache,
                                  ImageVisualShaderFactory& shaderFactory,
                                  const VisualUrl& imageUrl,
@@ -182,7 +183,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
 }
 
 ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
   mImage( image ),
   mPixelArea( FULL_TEXTURE_RECT ),
   mPlacementActor(),
@@ -544,7 +545,6 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize )
       return;
     }
   }
-
   naturalSize = Vector2::ZERO;
 }
 
index 71385e2..612433d 100644 (file)
@@ -163,8 +163,8 @@ Devel::PixelBuffer TextureManager::LoadPixelBuffer(
   else
   {
     RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS,
-                         false, KEEP_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED,
-                         preMultiplyOnLoad, true );
+                         false, RETURN_PIXEL_BUFFER, textureObserver, orientationCorrection, TextureManager::ReloadPolicy::FORCED,
+                         preMultiplyOnLoad );
   }
 
   return pixelBuffer;
@@ -337,7 +337,7 @@ TextureManager::TextureId TextureManager::RequestLoad(
 {
   return RequestLoadInternal( url, INVALID_TEXTURE_ID, 1.0f, desiredSize, fittingMode, samplingMode, useAtlas,
                               false, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
-                              preMultiplyOnLoad, false );
+                              preMultiplyOnLoad );
 }
 
 TextureManager::TextureId TextureManager::RequestLoad(
@@ -356,7 +356,7 @@ TextureManager::TextureId TextureManager::RequestLoad(
 {
   return RequestLoadInternal( url, maskTextureId, contentScale, desiredSize, fittingMode, samplingMode, useAtlas,
                               cropToMask, UPLOAD_TO_TEXTURE, observer, orientationCorrection, reloadPolicy,
-                              preMultiplyOnLoad, false );
+                              preMultiplyOnLoad );
 }
 
 TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& maskUrl )
@@ -365,7 +365,7 @@ TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& mask
   auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
   return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, 1.0f, ImageDimensions(), FittingMode::SCALE_TO_FILL,
                               SamplingMode::NO_FILTER, NO_ATLAS, false, KEEP_PIXEL_BUFFER, NULL, true,
-                              TextureManager::ReloadPolicy::CACHED, preMultiply, false );
+                              TextureManager::ReloadPolicy::CACHED, preMultiply );
 }
 
 TextureManager::TextureId TextureManager::RequestLoadInternal(
@@ -381,18 +381,16 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
   TextureUploadObserver*          observer,
   bool                            orientationCorrection,
   TextureManager::ReloadPolicy    reloadPolicy,
-  TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
-  bool                            loadPixelBuffer )
+  TextureManager::MultiplyOnLoad& preMultiplyOnLoad )
 {
   // First check if the requested Texture is cached.
   const TextureHash textureHash = GenerateHash( url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas,
                                                 maskTextureId );
 
   TextureManager::TextureId textureId = INVALID_TEXTURE_ID;
-
   // Look up the texture by hash. Note: The extra parameters are used in case of a hash collision.
   int cacheIndex = FindCachedTexture( textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas,
-                                      maskTextureId, preMultiplyOnLoad );
+                                      maskTextureId, preMultiplyOnLoad, storageType );
 
   // Check if the requested Texture exists in the cache.
   if( cacheIndex != INVALID_CACHE_INDEX )
@@ -420,7 +418,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
     mTextureInfoContainer.push_back( TextureInfo( textureId, maskTextureId, url.GetUrl(),
                                                   desiredSize, contentScale, fittingMode, samplingMode,
                                                   false, cropToMask, useAtlas, textureHash, orientationCorrection,
-                                                  preMultiply, loadPixelBuffer ) );
+                                                  preMultiply ) );
     cacheIndex = mTextureInfoContainer.size() - 1u;
 
     DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n",
@@ -448,6 +446,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
   {
     DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Verbose, "TextureManager::RequestLoad( url=%s observer=%p ) ForcedReload cacheIndex:%d, textureId=%d\n",
                    url.GetUrl().c_str(), observer, cacheIndex, textureId );
+
     textureInfo.loadState = TextureManager::NOT_STARTED;
   }
 
@@ -486,12 +485,14 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
       break;
     }
     case TextureManager::LOAD_FINISHED:
+    {
       // Loading has already completed.
-      if( observer && textureInfo.loadPixelBuffer )
+      if( observer && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
       {
         LoadOrQueueTexture( textureInfo, observer );
       }
       break;
+    }
   }
 
   // Return the TextureId for which this Texture can now be referenced by externally.
@@ -786,7 +787,7 @@ void TextureManager::ProcessQueuedTextures()
                                            textureInfo.useAtlas, textureInfo.atlasRect,
                                            textureInfo.preMultiplied );
       }
-      else if ( textureInfo.loadState == LOAD_FINISHED && textureInfo.loadPixelBuffer )
+      else if ( textureInfo.loadState == LOAD_FINISHED && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
       {
         element.mObserver->LoadComplete( true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied );
       }
@@ -896,13 +897,16 @@ void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pix
       textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data
       textureInfo.loadState = LOAD_FINISHED;
 
-      if( textureInfo.loadPixelBuffer )
+      if( textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER )
       {
         NotifyObservers( textureInfo, true );
       }
-      // Check if there was another texture waiting for this load to complete
-      // (e.g. if this was an image mask, and its load is on a different thread)
-      CheckForWaitingTexture( textureInfo );
+      else
+      {
+        // Check if there was another texture waiting for this load to complete
+        // (e.g. if this was an image mask, and its load is on a different thread)
+        CheckForWaitingTexture( textureInfo );
+      }
     }
   }
   else
@@ -1022,7 +1026,7 @@ void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success )
 
     info->observerList.Erase( info->observerList.begin() );
 
-    if( info->loadPixelBuffer )
+    if( info->storageType == StorageType::RETURN_PIXEL_BUFFER )
     {
       observer->LoadComplete( success, info->pixelBuffer, info->url, info->preMultiplied );
     }
@@ -1044,7 +1048,7 @@ void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success )
   mQueueLoadFlag = false;
   ProcessQueuedTextures();
 
-  if( info->loadPixelBuffer && info->observerList.Count() == 0 )
+  if( info->storageType == StorageType::RETURN_PIXEL_BUFFER && info->observerList.Count() == 0 )
   {
     Remove( info->textureId, nullptr );
   }
@@ -1147,7 +1151,8 @@ int TextureManager::FindCachedTexture(
   const Dali::SamplingMode::Type    samplingMode,
   const bool                        useAtlas,
   TextureId                         maskTextureId,
-  TextureManager::MultiplyOnLoad    preMultiplyOnLoad )
+  TextureManager::MultiplyOnLoad    preMultiplyOnLoad,
+  StorageType                       storageType )
 {
   // Default to an invalid ID, in case we do not find a match.
   int cacheIndex = INVALID_CACHE_INDEX;
@@ -1167,7 +1172,8 @@ int TextureManager::FindCachedTexture(
           ( size == textureInfo.desiredSize ) &&
           ( ( size.GetWidth() == 0 && size.GetHeight() == 0 ) ||
             ( fittingMode == textureInfo.fittingMode &&
-              samplingMode == textureInfo.samplingMode ) ) )
+              samplingMode == textureInfo.samplingMode ) ) &&
+          ( storageType == textureInfo.storageType ) )
       {
         // 1. If preMultiplyOnLoad is MULTIPLY_ON_LOAD, then textureInfo.preMultiplyOnLoad should be true. The premultiplication result can be different.
         // 2. If preMultiplyOnLoad is LOAD_WITHOUT_MULTIPLY, then textureInfo.preMultiplied should be false.
index 5146991..cc5c0e4 100755 (executable)
@@ -73,11 +73,12 @@ public:
   };
 
   /**
-   * Whether the pixel data should be kept in TextureManager, or uploaded for rendering
+   * Whether the pixel data should be kept in TextureManager, returned with pixelBuffer or uploaded for rendering
    */
   enum StorageType
   {
     KEEP_PIXEL_BUFFER,
+    RETURN_PIXEL_BUFFER,
     UPLOAD_TO_TEXTURE
   };
 
@@ -445,8 +446,7 @@ private:
     TextureUploadObserver*              observer,
     bool                                orientationCorrection,
     TextureManager::ReloadPolicy        reloadPolicy,
-    MultiplyOnLoad&                     preMultiplyOnLoad,
-    bool                                loadPixelBuffer );
+    MultiplyOnLoad&                     preMultiplyOnLoad );
 
   /**
    * @brief Get the current state of a texture
@@ -477,8 +477,7 @@ private:
                  UseAtlas useAtlas,
                  TextureManager::TextureHash hash,
                  bool orientationCorrection,
-                 bool preMultiplyOnLoad,
-                 bool loadPixelBuffer )
+                 bool preMultiplyOnLoad )
     : url( url ),
       desiredSize( desiredSize ),
       useSize( desiredSize ),
@@ -497,8 +496,7 @@ private:
       cropToMask( cropToMask ),
       orientationCorrection( true ),
       preMultiplyOnLoad( preMultiplyOnLoad ),
-      preMultiplied( false ),
-      loadPixelBuffer( loadPixelBuffer )
+      preMultiplied( false )
     {
     }
 
@@ -521,7 +519,7 @@ private:
     float scaleFactor;             ///< The scale factor to apply to the Texture when masking
     int16_t referenceCount;        ///< The reference count of clients using this Texture
     LoadState loadState:4;         ///< The load state showing the load progress of the Texture
-    FittingMode::Type fittingMode:2; ///< The requested FittingMode
+    FittingMode::Type fittingMode:3; ///< The requested FittingMode
     Dali::SamplingMode::Type samplingMode:3; ///< The requested SamplingMode
     StorageType storageType:2;     ///< CPU storage / GPU upload;
     bool loadSynchronously:1;      ///< True if synchronous loading was requested
@@ -531,7 +529,6 @@ private:
     bool orientationCorrection:1;  ///< true if the image should be rotated to match exif orientation data
     bool preMultiplyOnLoad:1;      ///< true if the image's color should be multiplied by it's alpha
     bool preMultiplied:1;          ///< true if the image's color was multiplied by it's alpha
-    bool loadPixelBuffer:1;        ///< true if the image is needed to be returned as PixelBuffer
   };
 
   /**
@@ -704,13 +701,15 @@ private:
   /**
    * @brief Looks up a cached texture by its hash.
    * If found, the given parameters are used to check there is no hash-collision.
-   * @param[in] hash          The hash to look up
-   * @param[in] url           The URL of the image to load
-   * @param[in] size          The image size
-   * @param[in] fittingMode   The FittingMode to use
-   * @param[in] samplingMode  The SamplingMode to use
-   * @param[in] useAtlas      True if atlased
-   * @param[in] maskTextureId Optional texture ID to use to mask this image
+   * @param[in] hash              The hash to look up
+   * @param[in] url               The URL of the image to load
+   * @param[in] size              The image size
+   * @param[in] fittingMode       The FittingMode to use
+   * @param[in] samplingMode      The SamplingMode to use
+   * @param[in] useAtlas          True if atlased
+   * @param[in] maskTextureId     Optional texture ID to use to mask this image
+   * @param[in] preMultiplyOnLoad if the image's color should be multiplied by it's alpha. Set to OFF if there is no alpha.
+   * @param[in] storageType       Whether the pixel data is stored in the cache, returned with PixelBuffer or uploaded to the GPU
    * @return A TextureId of a cached Texture if found. Or INVALID_TEXTURE_ID if not found.
    */
   TextureManager::TextureId FindCachedTexture(
@@ -721,7 +720,8 @@ private:
     const Dali::SamplingMode::Type samplingMode,
     const bool useAtlas,
     TextureId maskTextureId,
-    MultiplyOnLoad preMultiplyOnLoad);
+    MultiplyOnLoad preMultiplyOnLoad,
+    StorageType storageType );
 
 private:
 
index b03a5ef..2cbca7d 100755 (executable)
@@ -59,6 +59,10 @@ namespace
 DALI_ENUM_TO_STRING_TABLE_BEGIN( VISUAL_FITTING_MODE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_KEEP_ASPECT_RATIO  )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FILL  )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, OVER_FIT_KEEP_ASPECT_RATIO )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, CENTER )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_WIDTH )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_HEIGHT )
 DALI_ENUM_TO_STRING_TABLE_END( VISUAL_FITTING_MODE )
 
 } // namespace
index 3c84e6a..067310e 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 13;
+const unsigned int TOOLKIT_MICRO_VERSION = 14;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 901d0d6..28b9854 100644 (file)
@@ -249,7 +249,7 @@ okButton.SetLabelText( "OK" );
 okButton.SetParentOrigin( ParentOrigin::CENTER );
 okButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
 okButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
-okButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
+okButton.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( -20.0f, -20.0f, 0.0 ) );
 okButton.ClickedSignal().Connect( this, &MyExample::OnOKButtonClicked );
 
 Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
@@ -257,7 +257,7 @@ cancelButton.SetLabelText( "Cancel" );
 cancelButton.SetParentOrigin( ParentOrigin::CENTER );
 cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
 cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
-cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
+cancelButton.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( -20.0f, -20.0f, 0.0 ) );
 cancelButton.ClickedSignal().Connect( this, &MyExample::OnCancelButtonClicked );
 
 // Set up the footer's layout.
index 2f3ac40..c706da4 100644 (file)
@@ -67,7 +67,7 @@ The popup control is added to the layer and a background image is specified to f
 @code
 mBackgroundImage.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
 Vector3 border( mPopupStyle->backgroundOuterBorder.x, mPopupStyle->backgroundOuterBorder.z, 0.0f );
-mBackgroundImage.SetSizeModeFactor( border );
+mBackgroundImage.SetProperty( Actor::Property::SIZE_MODE_FACTOR, border );
 @endcode
 A table view is added to the popup to specify layout. It will fill to the width of the popup and expand/contract around its children cell heights.
 @code
index 0687233..ab8c06a 100644 (file)
@@ -109,13 +109,13 @@ When an actor is required to maintain the aspect ratio of its natural size the f
 to ensure they maintain their aspect ratio while still fitting within the bounds they have been allocated. This can be one of SizeScalePolicy::USE_SIZE_SET, SizeScalePolicy::FIT_WITH_ASPECT_RATIO
 or SizeScalePolicy::FILL_WITH_ASPECT_RATIO. The first is the default. The second will fit the actor within the bounds it has been allocated while maintaining aspect ratio. The
 third will fill all available space, potentially overflowing its bounds, while maintaining apsect ratio.
-@code void SetSizeScalePolicy( SizeScalePolicy::Type policy ) @endcode
+@code actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy ); @endcode
 
 <h3>Using Actors in Containers</h3>
 
 When laying out actors in containers such as TableView it is useful to be able to specify padding that surrounds the actor. E.g. You may
 want some white space around an image actor placed in a table cell. The padding specifies the left, right, bottom and top padding values.
-@code void SetPadding( const Padding& padding ) @endcode
+@code actor.SetProperty( Actor::Property::PADDING, padding ); @endcode
 
 <h2 class="pg">An Example</h2>
 
@@ -131,7 +131,7 @@ content.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
 content.SetFitHeight( 0 );
 content.SetFitHeight( 1 );
-content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
+content.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
 
 // Text
 Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" );
@@ -144,7 +144,7 @@ content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
 Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE_PATH );
 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
+image.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
 content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
 
 // Checkbox and text
@@ -153,7 +153,7 @@ root.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 root.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
 root.SetFitHeight( 0 );
 root.SetFitWidth( 0 );
-root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
+root.SetProperty( Actor::Property::PADDING, Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
 
 Dali::Image unchecked = Dali::ResourceImage::New( CHECKBOX_UNCHECKED_IMAGE );
 Dali::Image checked = Dali::ResourceImage::New( CHECKBOX_CHECKED_IMAGE );
@@ -165,7 +165,7 @@ checkBox.SetSize( Vector2( 48, 48 ) );
 root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
 
 Toolkit::TextLabel text2 = Toolkit::TextLabel::New( "Don't show again" );
-text2.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
+text2.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
 
 root.AddChild( text2, Toolkit::TableView::CellPosition( 0, 1 ) );
 
@@ -187,7 +187,7 @@ content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
 @endcode
 To add a little space around the left, right and bottom of the table view, some padding is added.
 @code
-content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
+content.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
 @endcode
 The first text view has its width set to ResizePolicy::FILL_TO_PARENT and its height has a dimension dependency on its width. This
 will result in a text view that fills up its width to available space in the table cell and then then calculates its
@@ -201,7 +201,7 @@ width. Some padding is added to the left of it as well to center it more.
 @code
 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
+image.SetProperty( Actor::Property::PADDING, Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
 @endcode
 The sub table view is similar as well in that it expands its width to the size of its cell. When it is added to the table view it
 will span two columns. Its height is set to natural size so that it will grow or shrink based on its children cells. Note that for
index d6653cc..3e8676c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.9.13
+Version:    1.9.14
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT