Merge branch 'devel/tizen' into tizen
authorSeungho, Baek <sbsh.baek@samsung.com>
Wed, 1 Apr 2020 06:10:18 +0000 (15:10 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Wed, 1 Apr 2020 06:10:18 +0000 (15:10 +0900)
41 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-styling/CMakeLists.txt
automated-tests/src/dali-toolkit-third-party/CMakeLists.txt
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h [deleted file]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h
automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h
dali-toolkit/devel-api/visuals/color-visual-properties-devel.h
dali-toolkit/devel-api/visuals/image-visual-properties-devel.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/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h
dali-toolkit/internal/visuals/animated-image/image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 650bbee..22c9a90 100755 (executable)
@@ -66,7 +66,6 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
    dali-toolkit-test-utils/toolkit-text-utils.cpp
index b4414fe..32b7233 100644 (file)
@@ -48,7 +48,6 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
 )
index dfbe07f..3a9f9b2 100644 (file)
@@ -23,7 +23,6 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
 )
index 76492c3..2db3264 100755 (executable)
@@ -110,7 +110,6 @@ LIST(APPEND TC_SOURCES
   dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
   dali-toolkit-test-utils/test-platform-abstraction.cpp
   dali-toolkit-test-utils/test-render-controller.cpp
-  dali-toolkit-test-utils/test-render-surface.cpp
   dali-toolkit-test-utils/test-trace-call-stack.cpp
   dali-toolkit-test-utils/test-native-image.cpp
 )
index f5d670d..f85f14d 100644 (file)
@@ -27,8 +27,7 @@ TestApplication::TestApplication( uint32_t surfaceWidth,
                                   uint32_t  horizontalDpi,
                                   uint32_t  verticalDpi,
                                   bool initialize )
-: mRenderSurface( NULL ),
-  mCore( NULL ),
+: mCore( NULL ),
   mSurfaceWidth( surfaceWidth ),
   mSurfaceHeight( surfaceHeight ),
   mFrame( 0u ),
@@ -75,8 +74,7 @@ void TestApplication::CreateCore()
 
 void TestApplication::CreateScene()
 {
-  mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) );
-  mScene = Dali::Integration::Scene::New( *mRenderSurface );
+  mScene = Dali::Integration::Scene::New( Size( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
   mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
 }
 
@@ -89,7 +87,6 @@ void TestApplication::InitializeCore()
 TestApplication::~TestApplication()
 {
   Dali::Integration::Log::UninstallLogFunction();
-  delete mRenderSurface;
   delete mCore;
 }
 
@@ -190,7 +187,11 @@ void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* locat
 bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
 {
   DoUpdate( intervalMilliseconds, location );
-  mCore->Render( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+
+  mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+  mCore->RenderScene( mScene, true /*render the off-screen buffers*/);
+  mCore->RenderScene( mScene, false /*render the surface*/);
+  mCore->PostRender( false /*do not skip rendering*/ );
 
   mFrame++;
 
@@ -216,7 +217,10 @@ bool TestApplication::GetRenderNeedsUpdate()
 bool TestApplication::RenderOnly( )
 {
   // Update Time values
-  mCore->Render( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+  mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+  mCore->RenderScene( mScene, true /*render the off-screen buffers*/);
+  mCore->RenderScene( mScene, false /*render the surface*/);
+  mCore->PostRender( false /*do not skip rendering*/ );
 
   mFrame++;
 
index 2606a56..a922e23 100644 (file)
@@ -24,7 +24,6 @@
 #include "test-gl-abstraction.h"
 #include "test-gl-context-helper-abstraction.h"
 #include "test-render-controller.h"
-#include "test-render-surface.h"
 #include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/resource-policies.h>
 #include <dali/integration-api/trace.h>
@@ -95,7 +94,6 @@ protected:
   TestGlAbstraction         mGlAbstraction;
   TestGlSyncAbstraction     mGlSyncAbstraction;
   TestGlContextHelperAbstraction mGlContextHelperAbstraction;
-  TestRenderSurface*        mRenderSurface;
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;
index 0442f0d..ce150d1 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_CONTEXT_HELPER_ABSTRACTION_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.
@@ -46,12 +46,6 @@ public:
   virtual void MakeSurfacelessContextCurrent() {};
 
   /**
-   * @brief Switch to the GL context of the specific render surface
-   * @param[in] surface The render surface
-   */
-  virtual void MakeContextCurrent( Integration::RenderSurface* surface ) {};
-
-  /**
    * @brief Clear the GL context
    */
   virtual void MakeContextNull() {};
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp
deleted file mode 100644 (file)
index 332d77e..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test-render-surface.h"
-
-namespace Dali
-{
-
-TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize )
-: mPositionSize( positionSize ),
-  mBackgroundColor()
-{
-}
-
-TestRenderSurface::~TestRenderSurface()
-{
-}
-
-Dali::PositionSize TestRenderSurface::GetPositionSize() const
-{
-  return mPositionSize;
-};
-
-void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
-{
-  dpiHorizontal = dpiVertical = 96;
-};
-
-void TestRenderSurface::InitializeGraphics()
-{
-}
-
-void TestRenderSurface::CreateSurface()
-{
-}
-
-void TestRenderSurface::DestroySurface()
-{
-}
-
-bool TestRenderSurface::ReplaceGraphicsSurface()
-{
-  return false;
-}
-
-void TestRenderSurface::MoveResize( Dali::PositionSize positionSize )
-{
-  mPositionSize = positionSize;
-}
-
-void TestRenderSurface::StartRender()
-{
-}
-
-bool TestRenderSurface::PreRender( bool resizingSurface )
-{
-  return true;
-}
-
-void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
-{
-}
-
-void TestRenderSurface::StopRender()
-{
-}
-
-void TestRenderSurface::ReleaseLock()
-{
-}
-
-Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType()
-{
-  return WINDOW_RENDER_SURFACE;
-}
-
-void TestRenderSurface::MakeContextCurrent()
-{
-}
-
-Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired()
-{
-  return Integration::DepthBufferAvailable::TRUE;
-}
-
-Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired()
-{
-  return Integration::StencilBufferAvailable::TRUE;
-}
-
-void TestRenderSurface::SetBackgroundColor( Vector4 color )
-{
-  mBackgroundColor = color;
-}
-
-Vector4 TestRenderSurface::GetBackgroundColor()
-{
-  return mBackgroundColor;
-}
-
-} // Namespace dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h
deleted file mode 100644 (file)
index fba89c2..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef TEST_REENDER_SURFACE_H
-#define TEST_REENDER_SURFACE_H
-
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/integration-api/render-surface.h>
-
-namespace Dali
-{
-
-/**
- * Concrete implementation of the RenderSurface class.
- */
-class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface
-{
-public:
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::RenderSurface
-   */
-  TestRenderSurface( Dali::PositionSize positionSize );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::~RenderSurface
-   */
-  virtual ~TestRenderSurface();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetPositionSize
-   */
-  virtual Dali::PositionSize GetPositionSize() const;
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetDpi
-   */
-  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics
-   */
-  virtual void InitializeGraphics();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::CreateSurface
-   */
-  virtual void CreateSurface();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::DestroySurface
-   */
-  virtual void DestroySurface();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface
-   */
-  virtual bool ReplaceGraphicsSurface();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::MoveResize
-   */
-  virtual void MoveResize( Dali::PositionSize positionSize );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::StartRender
-   */
-  virtual void StartRender();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::PreRender
-   */
-  virtual bool PreRender( bool resizingSurface );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::PostRender
-   */
-  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::StopRender
-   */
-  virtual void StopRender();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::ReleaseLock
-   */
-  virtual void ReleaseLock();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType
-   */
-  virtual Dali::Integration::RenderSurface::Type GetSurfaceType();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent
-   */
-  virtual void MakeContextCurrent();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired
-   */
-  virtual Integration::DepthBufferAvailable GetDepthBufferRequired();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired
-   */
-  virtual Integration::StencilBufferAvailable GetStencilBufferRequired();
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor
-   */
-  virtual void SetBackgroundColor( Vector4 color );
-
-  /**
-   * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor
-   */
-  virtual Vector4 GetBackgroundColor();
-
-private:
-
-  /**
-   * @brief Undefined copy constructor. RenderSurface cannot be copied
-   */
-  TestRenderSurface( const TestRenderSurface& rhs );
-
-  /**
-   * @brief Undefined assignment operator. RenderSurface cannot be copied
-   */
-  TestRenderSurface& operator=( const TestRenderSurface& rhs );
-
-private:
-
-  Dali::PositionSize mPositionSize;
-  Vector4 mBackgroundColor;                                     ///< The background color of the surface
-};
-
-} // Dali
-
-#endif
index 5890d58..7c50cc7 100644 (file)
@@ -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.
@@ -29,7 +29,6 @@
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/scene.h>
 #include <test-application.h>
-#include <test-render-surface.h>
 
 namespace Dali
 {
index a937262..b466cfc 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SCENE_HOLDER_IMPL_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.
@@ -18,7 +18,7 @@
  *
  */
 
-#include <test-render-surface.h>
+#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 #include <dali/integration-api/scene.h>
 #include <dali/public-api/actors/layer.h>
 namespace Dali
 {
 
+class TestRenderSurface : public Dali::RenderSurfaceInterface
+{
+public:
+
+  TestRenderSurface( PositionSize positionSize ) {};
+
+  virtual PositionSize GetPositionSize() const { PositionSize size; return size; };
+
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
+
+  virtual void InitializeGraphics() {};
+
+  virtual void CreateSurface() {};
+
+  virtual void DestroySurface() {};
+
+  virtual bool ReplaceGraphicsSurface() { return false; };
+
+  virtual void MoveResize( Dali::PositionSize positionSize ) {};
+
+  virtual void StartRender() {};
+
+  virtual bool PreRender( bool resizingSurface ) { return false; };
+
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {};
+
+  virtual void StopRender() {};
+
+  virtual void ReleaseLock() {};
+
+  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {};
+
+  virtual RenderSurfaceInterface::Type GetSurfaceType() { return RenderSurfaceInterface::WINDOW_RENDER_SURFACE; };
+
+  virtual void MakeContextCurrent() {};
+
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired() { return Integration::DepthBufferAvailable::FALSE; };
+
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired() { return Integration::StencilBufferAvailable::FALSE; };
+
+  virtual void SetBackgroundColor( Vector4 color ) {};
+
+  virtual Vector4 GetBackgroundColor() { return Color::WHITE; };
+};
+
 namespace Internal
 {
 
@@ -67,7 +112,7 @@ public:
 
   Integration::Scene GetScene();
 
-  Integration::RenderSurface& GetRenderSurface();
+  Dali::RenderSurfaceInterface& GetRenderSurface();
 
 private:
 
index 1075778..320c859 100644 (file)
@@ -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.
@@ -47,7 +47,7 @@ namespace Adaptor
 
 SceneHolder::SceneHolder( const Dali::Rect<int>& positionSize )
 : mRenderSurface( positionSize ),
-  mScene( Dali::Integration::Scene::New( mRenderSurface ) )
+  mScene( Dali::Integration::Scene::New( Dali::Size( static_cast<float>( positionSize.width ), static_cast<float>( positionSize.height ) ) ) )
 {
 }
 
@@ -121,7 +121,7 @@ Integration::Scene SceneHolder::GetScene()
   return mScene;
 }
 
-Integration::RenderSurface& SceneHolder::GetRenderSurface()
+Dali::RenderSurfaceInterface& SceneHolder::GetRenderSurface()
 {
   return mRenderSurface;
 }
index 07c6ad8..d3bdd42 100644 (file)
@@ -42,7 +42,6 @@ ToolkitTestApplication::ToolkitTestApplication( size_t surfaceWidth, size_t surf
   // The window will create a Scene & surface and set up the scene's surface appropriately.
   *mMainWindow = Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" );
   mScene = AdaptorImpl::GetScene( *mMainWindow );
-  mRenderSurface = dynamic_cast< TestRenderSurface* >( mScene.GetSurface() );
   mScene.SetDpi( Vector2( horizontalDpi, verticalDpi ) );
 
   // Core needs to be initialized next before we start the adaptor
@@ -67,9 +66,6 @@ ToolkitTestApplication::~ToolkitTestApplication()
   // Need to delete core before we delete the adaptor.
   delete mCore;
   mCore = NULL;
-
-  // Set mRenderSurface to null, it will be deleted by the window that owns it
-  mRenderSurface = nullptr;
 }
 
 void ToolkitTestApplication::RunIdles()
index e1ad7f2..d7878e3 100644 (file)
@@ -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.
@@ -28,9 +28,6 @@
 #include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <toolkit-adaptor-impl.h>
 
-// INTERNAL INCLUDES
-#include "test-render-surface.h"
-
 using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
 
 namespace Dali
@@ -122,7 +119,7 @@ Integration::Scene Window::GetScene()
   return GetImplementation( *this ).GetScene();
 }
 
-Integration::RenderSurface& Window::GetRenderSurface()
+Dali::RenderSurfaceInterface& Window::GetRenderSurface()
 {
   return GetImplementation( *this ).GetRenderSurface();
 }
index 271f885..68ed472 100644 (file)
@@ -2,7 +2,7 @@
 #define TOOLKIT_WINDOW_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.
@@ -30,6 +30,7 @@ namespace Dali
 
 class Actor;
 class Layer;
+class RenderSurfaceInterface;
 struct KeyEvent;
 class TouchData;
 struct WheelEvent;
@@ -60,7 +61,7 @@ public:
   Window& operator=(const Window& rhs);
 
   Integration::Scene GetScene();
-  Integration::RenderSurface& GetRenderSurface();
+  Dali::RenderSurfaceInterface& GetRenderSurface();
   void Add( Dali::Actor actor );
   void Remove( Dali::Actor actor );
   Dali::Layer GetRootLayer() const;
index 0e06386..bb591dd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2018 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.
@@ -159,6 +159,191 @@ int UtcDaliAnimatedImageVisualGetPropertyMap02(void)
 }
 
 
+int UtcDaliAnimatedImageVisualJumpToAction(void)
+{
+  ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+
+  Property::Array urls;
+  CopyUrlsIntoArray( urls );
+
+  {
+    Property::Map propertyMap;
+    propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
+    propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
+    propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
+    propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 12);
+    propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+
+    VisualFactory factory = VisualFactory::Get();
+    Visual::Base visual = factory.CreateVisual( propertyMap );
+
+    DummyControl dummyControl = DummyControl::New(true);
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+    dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+    dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    Stage::GetCurrent().Add( dummyControl );
+    application.SendNotification();
+    application.Render(20);
+
+    tet_infoline( "Ready the visual after the visual is on stage" );
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+
+    tet_infoline( "Test that a timer has been started" );
+    DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
+    application.SendNotification();
+    application.Render(20);
+
+    DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map() );
+
+    DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 20 );
+
+    DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6 );
+
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 6 ), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+
+    dummyControl.Unparent();
+  }
+  tet_infoline("Test that removing the visual from stage deletes all textures");
+  application.SendNotification();
+  application.Render(16);
+  DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliAnimatedImageVisualStopBehavior(void)
+{
+  ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+
+  Property::Array urls;
+  CopyUrlsIntoArray( urls );
+
+  {
+    Property::Map propertyMap;
+    propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
+    propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
+    propertyMap.Insert( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
+    propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
+    propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 8);
+    propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+
+    VisualFactory factory = VisualFactory::Get();
+    Visual::Base visual = factory.CreateVisual( propertyMap );
+
+    // Expect that a batch of 4 textures has been requested. These will be serially loaded
+    // below.
+
+    DummyControl dummyControl = DummyControl::New(true);
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+    dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+    dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    Stage::GetCurrent().Add( dummyControl );
+    application.SendNotification();
+    application.Render(20);
+
+    tet_infoline( "Ready the visual after the visual is on stage" );
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+
+    tet_infoline( "Test that a timer has been started" );
+    DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
+    application.SendNotification();
+    application.Render(20);
+
+    DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map() );
+
+    DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 1 );
+
+    // Expect the second batch has been requested
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+
+    DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+
+    dummyControl.Unparent();
+  }
+  tet_infoline("Test that removing the visual from stage deletes all textures");
+  application.SendNotification();
+  application.Render(16);
+  DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliAnimatedImageVisualGif01(void)
+{
+  ToolkitTestApplication application;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+
+  {
+    Property::Map propertyMap;
+    propertyMap.Insert(Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
+    propertyMap.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME );
+    propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
+    propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 4);
+    propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+
+    VisualFactory factory = VisualFactory::Get();
+    Visual::Base visual = factory.CreateVisual( propertyMap );
+
+    // Expect that a batch of 4 textures has been requested. These will be serially loaded
+    // below.
+
+    DummyControl dummyControl = DummyControl::New(true);
+    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+    dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+    dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    Stage::GetCurrent().Add( dummyControl );
+    application.SendNotification();
+    application.Render(20);
+
+    DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 2, TEST_LOCATION );
+
+    tet_infoline( "Test that a timer has been started" );
+
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
+    Test::EmitGlobalTimerSignal();
+
+    application.SendNotification();
+    application.Render(20);
+
+    DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+
+    dummyControl.Unparent();
+  }
+  tet_infoline("Test that removing the visual from stage deletes all textures");
+  application.SendNotification();
+  application.Render(20);
+  DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+
+  END_TEST;
+}
 
 
 int UtcDaliAnimatedImageVisualMultiImage01(void)
@@ -570,10 +755,14 @@ void TestLoopCount( ToolkitTestApplication &application, DummyControl &dummyCont
   tet_infoline( "Test that a timer has been created" );
   DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_INNER_LOCATION( location ) );
 
-  for ( uint16_t i = 0; i <= loopCount; i++ )
+  for ( uint16_t i = 0; i < loopCount; i++ )
   {
     for ( uint16_t j = 0; j < frameCount; j++ )
     {
+      if( i == 0 && j == 0 )
+      {
+        continue; // Because first frame is already showed and we call 2nd frame at the first time of timer animation.
+      }
       tet_printf( "Test that after %u ticks, and we have %u frame \n", j + 1u, j + 1u );
       Test::EmitGlobalTimerSignal();
       application.SendNotification();
index 4a19b78..531b94c 100644 (file)
@@ -178,11 +178,14 @@ int UtcDaliGaussianBlurActivateDeactivate(void)
 
   RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
   DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
+  DALI_TEST_CHECK( 2u == view.GetChildCount() );
 
   view.Deactivate();
 
   RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
   DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
+  DALI_TEST_CHECK( 1u == view.GetChildCount() );
+
   END_TEST;
 }
 
index d26b857..b6505e2 100644 (file)
@@ -509,6 +509,7 @@ int UtcDaliVisualGetPropertyMap1(void)
   propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
   propertyMap.Insert(Visual::Property::MIX_COLOR,  Color::BLUE);
   propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS, 10.0f );
+  propertyMap.Insert( DevelColorVisual::Property::BLUR_RADIUS, 20.0f );
   Visual::Base colorVisual = factory.CreateVisual( propertyMap );
 
   Property::Map resultMap;
@@ -522,9 +523,13 @@ int UtcDaliVisualGetPropertyMap1(void)
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::BLUE );
 
-  Property::Value* radiusValue = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
-  DALI_TEST_CHECK( radiusValue );
-  DALI_TEST_CHECK( radiusValue->Get< float >() == 10.0f );
+  Property::Value* cornerRadiusValue = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::FLOAT );
+  DALI_TEST_CHECK( cornerRadiusValue );
+  DALI_TEST_CHECK( cornerRadiusValue->Get< float >() == 10.0f );
+
+  Property::Value* blurRadiusValue = resultMap.Find( DevelColorVisual::Property::BLUR_RADIUS, Property::FLOAT );
+  DALI_TEST_CHECK( blurRadiusValue );
+  DALI_TEST_CHECK( blurRadiusValue->Get< float >() == 20.0f );
 
   // change the blend color
   propertyMap[ColorVisual::Property::MIX_COLOR] = Color::CYAN;
@@ -535,6 +540,16 @@ int UtcDaliVisualGetPropertyMap1(void)
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::CYAN );
 
+  // Test wrong values
+  propertyMap[DevelColorVisual::Property::BLUR_RADIUS] = "3.0f";
+
+  colorVisual = factory.CreateVisual( propertyMap  );
+  colorVisual.CreatePropertyMap( resultMap );
+
+  blurRadiusValue = resultMap.Find( DevelColorVisual::Property::BLUR_RADIUS, Property::FLOAT );
+  DALI_TEST_CHECK( blurRadiusValue );
+  DALI_TEST_CHECK( blurRadiusValue->Get< float >() == 0.0f );
+
   END_TEST;
 }
 
@@ -3652,3 +3667,38 @@ int UtcDaliVisualRoundedCorner(void)
 
   END_TEST;
 }
+
+int UtcDaliColorVisualBlurRadius(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliColorVisualBlurRadius" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map properties;
+  float blurRadius = 20.0f;
+
+  properties[Visual::Property::TYPE] = Visual::COLOR;
+  properties[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
+  properties["blurRadius"] = blurRadius;
+
+  Visual::Base visual = factory.CreateVisual( properties );
+
+  // trigger creation through setting on stage
+  DummyControl dummy = DummyControl::New( true );
+  Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  dummy.SetSize( 200.f, 200.f );
+  dummy.SetParentOrigin( ParentOrigin::CENTER );
+  Stage::GetCurrent().Add( dummy );
+
+  application.SendNotification();
+  application.Render();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue< float >( "blurRadius", blurRadius ), true, TEST_LOCATION );
+
+  END_TEST;
+}
index df2d7be..c7f4282 100644 (file)
@@ -746,7 +746,7 @@ int UtcDaliVisualFactoryGetNPatchVisual2(void)
 int UtcDaliVisualFactoryGetNPatchVisual3(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual2: Request n-patch visual with a Property::Map" );
+  tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual3: Request n-patch visual with a Property::Map" );
 
   VisualFactory factory = VisualFactory::Get();
   DALI_TEST_CHECK( factory );
@@ -943,6 +943,58 @@ int UtcDaliVisualFactoryGetNPatchVisual6(void)
   END_TEST;
 }
 
+int UtcDaliVisualFactoryGetNPatchVisual7(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual7: Add 9-patch visual on stage and instantly remove it." );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  // Get actual size of test image
+  ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+
+  Property::Map propertyMap;
+  propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
+  propertyMap.Insert( ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME );
+  propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, false );
+  {
+    Visual::Base visual = factory.CreateVisual( propertyMap );
+    DALI_TEST_CHECK( visual );
+
+    Vector2 naturalSize( 0.0f, 0.0f );
+    visual.GetNaturalSize( naturalSize );
+    DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+
+    TestGlAbstraction& gl = application.GetGlAbstraction();
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
+    DummyControl actor = DummyControl::New(true);
+
+    DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+    dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+    actor.SetSize( 200.f, 200.f );
+    DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+
+    Stage::GetCurrent().Add( actor );
+    actor.Unparent();
+
+    application.SendNotification();
+    application.Render();
+
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger(1 ), true, TEST_LOCATION );
+
+    application.SendNotification();
+    application.Render();
+
+    DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
 int UtcDaliNPatchVisualAuxiliaryImage(void)
 {
   ToolkitTestApplication application;
index b654a69..4218045 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_IMAGE_VISUAL_ACTIONS_DEVEL_H
 
 /*
- * Copyright (c) 2018 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.
@@ -39,7 +39,8 @@ enum Type
 {
   PLAY,        ///< Play the animated GIF. This is also Default playback mode.
   PAUSE,       ///< Pause the animated GIF.
-  STOP         ///< Stop the animated GIF.
+  STOP,        ///< Stop the animated GIF.
+  JUMP_TO      ///< Jump to the specified frame. Property::INTEGER value should be passed.
 };
 
 } // namespace Action
index 4eb8b3a..654b290 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_COLOR_VISUAL_PROPERTIES_DEVEL_H
 
 /*
- * 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.
@@ -51,6 +51,16 @@ enum
    * @note By default it's false, i.e. ColorVisual will not render if the MIX_COLOR is transparent.
    */
   RENDER_IF_TRANSPARENT = MIX_COLOR + 1,
+
+  /**
+   * @brief The blur radius of the visual.
+   * @details Name "blurRadius", type Property::FLOAT.
+   *          If the value is 0, the edge is sharp. Otherwise, the larger the value, the more the edge is blurred.
+   * @note Optional.
+   * @note The default is 0.
+   * @note The visual size increases by the blur radius.
+   */
+  BLUR_RADIUS = MIX_COLOR + 2,
 };
 
 } // namespace Property
index 5419799..e6e5303 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_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.
@@ -122,7 +122,7 @@ enum Type
   TOTAL_FRAME_NUMBER = ORIENTATION_CORRECTION + 7,
 
   /**
-   * @brief  The stop behavior the AnimatedVectorImageVisual will use.
+   * @brief  The stop behavior the AnimatedImageVisual and AnimatedVectorImageVisual will use.
    * @details Name "stopBehavior", Type StopBehavior::Type (Property::INTEGER)
    * @note Default value is StopBehavior::CURRENT_FRAME.
    */
index 5958037..8dfb3cc 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
 
 /*
- * Copyright (c) 2018 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.
@@ -75,7 +75,7 @@ enum Type
 
   /**
    * @brief The radius for the rounded corners of the visual
-   * @details Name "cornerRadius", type Property::FLOAT or Property::VECTOR4.
+   * @details Name "cornerRadius", type Property::FLOAT.
    * @note Optional.
    */
   CORNER_RADIUS = OPACITY + 2,
index d83ed24..233a79c 100644 (file)
@@ -330,7 +330,6 @@ void GaussianBlurView::OnInitialize()
   //////////////////////////////////////////////////////
   // Connect to actor tree
   Self().Add( mChildrenRoot );
-  Self().Add( mInternalRoot );
   mInternalRoot.Add( mHorizBlurActor );
   mInternalRoot.Add( mVertBlurActor );
   mInternalRoot.Add( mRenderDownsampledCamera );
@@ -534,6 +533,7 @@ void GaussianBlurView::RemoveRenderTasks()
 void GaussianBlurView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
+  Self().Add( mInternalRoot );
   AllocateResources();
   CreateRenderTasks();
   mActivated = true;
@@ -550,6 +550,7 @@ 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();
index f2160ef..a0ebe45 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 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.
@@ -49,6 +49,13 @@ namespace Internal
 
 namespace
 {
+// stop behavior
+DALI_ENUM_TO_STRING_TABLE_BEGIN( STOP_BEHAVIOR )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::DevelImageVisual::StopBehavior, CURRENT_FRAME )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::DevelImageVisual::StopBehavior, FIRST_FRAME )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::Toolkit::DevelImageVisual::StopBehavior, LAST_FRAME )
+DALI_ENUM_TO_STRING_TABLE_END( STOP_BEHAVIOR )
+
 // wrap modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN( WRAP_MODE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Dali::WrapMode, DEFAULT )
@@ -182,7 +189,9 @@ AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache, Imag
   mWrapModeU( WrapMode::DEFAULT ),
   mWrapModeV( WrapMode::DEFAULT ),
   mActionStatus( DevelAnimatedImageVisual::Action::PLAY ),
-  mStartFirstFrame(false)
+  mStopBehavior( DevelImageVisual::StopBehavior::CURRENT_FRAME ),
+  mStartFirstFrame(false),
+  mIsJumpTo( false )
 {}
 
 AnimatedImageVisual::~AnimatedImageVisual()
@@ -238,6 +247,8 @@ void AnimatedImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::CACHE_SIZE, static_cast<int>(mCacheSize) );
   map.Insert( Toolkit::ImageVisual::Property::FRAME_DELAY, static_cast<int>(mFrameDelay) );
   map.Insert( Toolkit::DevelImageVisual::Property::LOOP_COUNT, static_cast<int>(mLoopCount) );
+
+  map.Insert( Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, mStopBehavior );
 }
 
 void AnimatedImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
@@ -270,8 +281,32 @@ void AnimatedImageVisual::OnDoAction( const Dali::Property::Index actionId, cons
     {
       // STOP reset functionality will actually be done in a future change
       // Stop will be executed on next timer tick
-      mCurrentFrameIndex = 0;
       mActionStatus = DevelAnimatedImageVisual::Action::STOP;
+      if( IsOnStage() )
+      {
+        DisplayNextFrame();
+      }
+      break;
+    }
+    case DevelAnimatedImageVisual::Action::JUMP_TO:
+    {
+      int32_t frameNumber;
+      if( attributes.Get( frameNumber ) )
+      {
+        if( frameNumber < 0 || frameNumber >= static_cast<int32_t>( mFrameCount ) )
+        {
+          DALI_LOG_ERROR( "Invalid frame index used.\n" );
+        }
+        else
+        {
+          mIsJumpTo = true;
+          mCurrentFrameIndex = frameNumber;
+          if( IsOnStage() )
+          {
+            DisplayNextFrame();
+          }
+        }
+      }
       break;
     }
   }
@@ -318,6 +353,10 @@ void AnimatedImageVisual::DoSetProperties( const Property::Map& propertyMap )
       {
         DoSetProperty( Toolkit::DevelImageVisual::Property::LOOP_COUNT, keyValue.second );
       }
+      else if( keyValue.first == STOP_BEHAVIOR_NAME )
+      {
+         DoSetProperty( Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, keyValue.second );
+      }
     }
   }
 }
@@ -398,6 +437,16 @@ void AnimatedImageVisual::DoSetProperty( Property::Index index,
       }
       break;
     }
+
+    case Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR:
+    {
+      int32_t stopBehavior = mStopBehavior;
+      if( Scripting::GetEnumerationProperty( value, STOP_BEHAVIOR_TABLE, STOP_BEHAVIOR_TABLE_COUNT, stopBehavior ) )
+      {
+        mStopBehavior = DevelImageVisual::StopBehavior::Type( stopBehavior );
+      }
+      break;
+    }
   }
 }
 
@@ -518,7 +567,7 @@ void AnimatedImageVisual::LoadFirstBatch()
 
   if (!mImageCache)
   {
-    DALI_LOG_ERROR("mImageCache is null");
+    DALI_LOG_ERROR("mImageCache is null\n");
   }
 }
 
@@ -606,45 +655,75 @@ void AnimatedImageVisual::FrameReady( TextureSet textureSet )
 
 bool AnimatedImageVisual::DisplayNextFrame()
 {
-  if( mActionStatus == DevelAnimatedImageVisual::Action::STOP || mActionStatus == DevelAnimatedImageVisual::Action::PAUSE )
+  if( mIsJumpTo )
+  {
+    mIsJumpTo = false;
+  }
+  else if( mActionStatus == DevelAnimatedImageVisual::Action::PAUSE )
   {
     return false;
   }
-  if( mFrameCount > 1 )
+  else if( mActionStatus == DevelAnimatedImageVisual::Action::STOP )
   {
-    // Wrap the frame index
-    ++mCurrentFrameIndex;
-
-    if( mLoopCount < 0 || mCurrentLoopIndex <= mLoopCount)
+    mCurrentLoopIndex = 0;
+    if( mStopBehavior == DevelImageVisual::StopBehavior::FIRST_FRAME )
     {
-      mCurrentFrameIndex %= mFrameCount;
-      if( mCurrentFrameIndex == 0 )
-      {
-        ++mCurrentLoopIndex;
-      }
+      mCurrentFrameIndex = 0;
+    }
+    else if( mStopBehavior == DevelImageVisual::StopBehavior::LAST_FRAME )
+    {
+      mCurrentFrameIndex = mFrameCount - 1;
     }
     else
     {
-      // This will stop timer
-      return false;
+      return false; // Do not draw already rendered scene twice.
     }
   }
-  DALI_LOG_INFO( gAnimImgLogFilter,Debug::Concise,"AnimatedImageVisual::DisplayNextFrame(this:%p) FrameCount:%d\n", this, mCurrentFrameIndex);
-
-  if( mFrameDelayContainer.Count() > 0 )
+  else
   {
-    unsigned int delay = mFrameDelayContainer[mCurrentFrameIndex];
+    if( mFrameCount > 1 )
+    {
+      // Wrap the frame index
+      bool finished = false;
+      ++mCurrentFrameIndex;
+      if( mCurrentFrameIndex >= mFrameCount )
+      {
+        ++mCurrentLoopIndex;
+        finished = true;
+      }
 
-    if( mFrameDelayTimer.GetInterval() != delay )
+      if( mLoopCount < 0 || mCurrentLoopIndex < mLoopCount)
+      {
+        if( finished )
+        {
+          mCurrentFrameIndex = 0; // Back to the first frame
+        }
+      }
+      else
+      {
+        // This will stop timer
+        mActionStatus = DevelAnimatedImageVisual::Action::STOP;
+        return DisplayNextFrame();
+      }
+    }
+
+    if( mFrameDelayContainer.Count() > 0 )
     {
-      mFrameDelayTimer.SetInterval( delay );
+      unsigned int delay = mFrameDelayContainer[mCurrentFrameIndex];
+
+      if( mFrameDelayTimer.GetInterval() != delay )
+      {
+        mFrameDelayTimer.SetInterval( delay );
+      }
     }
   }
 
+  DALI_LOG_INFO( gAnimImgLogFilter,Debug::Concise,"AnimatedImageVisual::DisplayNextFrame(this:%p) CurrentFrameIndex:%d\n", this, mCurrentFrameIndex);
+
   TextureSet textureSet;
   if( mImageCache )
   {
-    textureSet = mImageCache->NextFrame();
+    textureSet = mImageCache->Frame( mCurrentFrameIndex );
     if( textureSet )
     {
       SetImageSize( textureSet );
@@ -652,8 +731,7 @@ bool AnimatedImageVisual::DisplayNextFrame()
     }
   }
 
-  // Keep timer ticking
-  return true;
+  return ( mActionStatus == DevelAnimatedImageVisual::Action::PLAY ) ? true : false;
 }
 
 
index 791783d..0d21f97 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_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.
@@ -265,7 +265,9 @@ private:
   Dali::WrapMode::Type mWrapModeU:3;
   Dali::WrapMode::Type mWrapModeV:3;
   DevelAnimatedImageVisual::Action::Type mActionStatus:3;
+  DevelImageVisual::StopBehavior::Type   mStopBehavior:2;
   bool mStartFirstFrame:1;
+  bool mIsJumpTo:1;
 };
 
 } // namespace Internal
index 9acf1af..d71ee94 100644 (file)
@@ -54,6 +54,27 @@ FixedImageCache::~FixedImageCache()
   }
 }
 
+TextureSet FixedImageCache::Frame( uint32_t frameIndex )
+{
+  while( frameIndex > mFront )
+  {
+    NextFrame();
+  }
+  mFront = frameIndex;
+
+  TextureSet textureSet;
+  if( IsFrontReady() == true )
+  {
+    textureSet = GetFrontTextureSet();
+  }
+  else
+  {
+    mWaitingForReadyFrame = true;
+  }
+
+  return textureSet;
+}
+
 TextureSet FixedImageCache::FirstFrame()
 {
   TextureSet textureSet = GetFrontTextureSet();
@@ -80,7 +101,6 @@ TextureSet FixedImageCache::NextFrame()
   {
     mWaitingForReadyFrame = true;
   }
-
   LoadBatch();
 
   return textureSet;
@@ -96,7 +116,7 @@ void FixedImageCache::LoadBatch()
   // Try and load up to mBatchSize images, until the cache is filled.
   // Once the cache is filled, mUrlIndex exceeds mImageUrls size and
   // no more images are loaded.
-  bool frontFrameReady = IsFrontReady();;
+  bool frontFrameReady = IsFrontReady();
 
   for( unsigned int i=0; i< mBatchSize && mUrlIndex < mImageUrls.size(); ++i )
   {
index 72484a4..d884e28 100644 (file)
@@ -49,6 +49,12 @@ public:
   virtual ~FixedImageCache();
 
   /**
+   * Get the Nth frame. If it's not ready, this will trigger the
+   * sending of FrameReady() when the image becomes ready.
+   */
+  TextureSet Frame( uint32_t frameIndex ) override;
+
+  /**
    * Get the first frame. If it's not ready, this will trigger the
    * sending of FrameReady() when the image becomes ready.
    */
index ef1efed..7354992 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_IMAGE_CACHE_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.
@@ -46,7 +46,7 @@ public:
 
   struct UrlStore
   {
-    TextureManager::TextureId mTextureId;
+    TextureManager::TextureId mTextureId = TextureManager::INVALID_TEXTURE_ID;
     std::string mUrl;
   };
 
@@ -85,6 +85,12 @@ public:
    */
   virtual TextureSet NextFrame() = 0;
 
+  /**
+   * Get the Nth frame. If it's not ready, this will trigger the
+   * sending of FrameReady() when the image becomes ready.
+   */
+  virtual TextureSet Frame( uint32_t frameIndex ) = 0;
+
 private:
 
   /**
index 4854076..04f0f1d 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.
@@ -84,16 +84,49 @@ RollingGifImageCache::~RollingGifImageCache()
   }
 }
 
+TextureSet RollingGifImageCache::Frame( uint32_t frameIndex )
+{
+  // If a frame of frameIndex is not loaded, clear the queue and remove all loaded textures.
+  if( mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID )
+  {
+    mFrameIndex = frameIndex;
+    while( !mQueue.IsEmpty() )
+    {
+      ImageFrame imageFrame = mQueue.PopFront();
+      Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
+      mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
+    }
+    LoadBatch();
+  }
+  // If the frame is already loaded, remove previous frames of the frame in the queue
+  // and load new frames amount of removed frames.
+  else
+  {
+    bool popExist = false;
+    while( !mQueue.IsEmpty() && mQueue.Front().mFrameNumber != frameIndex )
+    {
+      ImageFrame imageFrame = mQueue.PopFront();
+      Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
+      mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
+      popExist = true;
+    }
+    if( popExist )
+    {
+      mFrameIndex = ( mQueue.Back().mFrameNumber + 1 ) % mFrameCount;
+      LoadBatch();
+    }
+  }
+
+  return GetFrontTextureSet();
+}
 
 TextureSet RollingGifImageCache::FirstFrame()
 {
-  return GetFrontTextureSet();
+  return Frame( 0u );
 }
 
 TextureSet RollingGifImageCache::NextFrame()
 {
-  TextureSet textureSet;
-
   ImageFrame imageFrame = mQueue.PopFront();
   Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
   mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
@@ -120,7 +153,7 @@ void RollingGifImageCache::LoadBatch()
   int batchSize = std::min( std::size_t(mBatchSize), mCacheSize - mQueue.Count() );
   DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingGifImageCache::LoadBatch() mFrameIndex:%d  batchSize:%d\n", mFrameIndex, batchSize );
 
-  if( mGifLoading.LoadNextNFrames(  mFrameIndex, batchSize, pixelDataList) )
+  if( mGifLoading.LoadNextNFrames( mFrameIndex, batchSize, pixelDataList) )
   {
     unsigned int pixelDataListCount = pixelDataList.size();
 
index 981274c..91a1210 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ROLLING_GIF_IMAGE_CACHE_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.
@@ -65,6 +65,12 @@ public:
   virtual ~RollingGifImageCache();
 
   /**
+   * Get the Nth frame. If it's not ready, this will trigger the
+   * sending of FrameReady() when the image becomes ready.
+   */
+  TextureSet Frame( uint32_t frameIndex ) override;
+
+  /**
    * Get the first frame. If it's not ready, this will trigger the
    * sending of FrameReady() when the image becomes ready.
    */
index b7b45ff..21f81b7 100644 (file)
@@ -80,11 +80,45 @@ RollingImageCache::~RollingImageCache()
   }
 }
 
-TextureSet RollingImageCache::FirstFrame()
+TextureSet RollingImageCache::Frame( uint32_t frameIndex )
 {
-  TextureSet textureSet = GetFrontTextureSet();
+  // If a frame of frameIndex is not loaded, clear the queue and remove all loaded textures.
+  if( mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID )
+  {
+    mUrlIndex = frameIndex;
+    while( !mQueue.IsEmpty() )
+    {
+      ImageFrame imageFrame = mQueue.PopFront();
+      mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId, this );
+      mImageUrls[ imageFrame.mUrlIndex ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
+    }
+    LoadBatch();
+  }
+  // If the frame is already loaded, remove previous frames of the frame in the queue
+  // and load new frames amount of removed frames.
+  else
+  {
+    bool popExist = false;
+    while( !mQueue.IsEmpty() && mQueue.Front().mUrlIndex != frameIndex )
+    {
+      ImageFrame imageFrame = mQueue.PopFront();
+      mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId, this );
+      mImageUrls[ imageFrame.mUrlIndex ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
+      popExist = true;
+    }
+    if( popExist )
+    {
+      mUrlIndex = ( mQueue.Back().mUrlIndex + 1 ) % mImageUrls.size();
+      LoadBatch();
+    }
+  }
 
-  if( ! textureSet )
+  TextureSet textureSet;
+  if( IsFrontReady() == true )
+  {
+    textureSet = GetFrontTextureSet();
+  }
+  else
   {
     mWaitingForReadyFrame = true;
   }
@@ -92,6 +126,11 @@ TextureSet RollingImageCache::FirstFrame()
   return textureSet;
 }
 
+TextureSet RollingImageCache::FirstFrame()
+{
+  return Frame( 0u );
+}
+
 TextureSet RollingImageCache::NextFrame()
 {
   TextureSet textureSet;
@@ -100,6 +139,8 @@ TextureSet RollingImageCache::NextFrame()
   mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId, this );
   mImageUrls[ imageFrame.mUrlIndex ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
 
+  LoadBatch();
+
   if( IsFrontReady() == true )
   {
     textureSet = GetFrontTextureSet();
@@ -109,8 +150,6 @@ TextureSet RollingImageCache::NextFrame()
     mWaitingForReadyFrame = true;
   }
 
-  LoadBatch();
-
   return textureSet;
 }
 
@@ -124,7 +163,7 @@ void RollingImageCache::LoadBatch()
   // Try and load up to mBatchSize images, until the cache is filled.
   // Once the cache is filled, as frames progress, the old frame is
   // cleared, but not erased, and another image is loaded
-  bool frontFrameReady = IsFrontReady();;
+  bool frontFrameReady = IsFrontReady();
 
   for( unsigned int i=0; i< mBatchSize && !mQueue.IsFull(); ++i )
   {
index a0d734d..47a5155 100644 (file)
@@ -60,6 +60,12 @@ public:
   virtual ~RollingImageCache();
 
   /**
+   * Get the Nth frame. If it's not ready, this will trigger the
+   * sending of FrameReady() when the image becomes ready.
+   */
+  TextureSet Frame( uint32_t frameIndex ) override;
+
+  /**
    * Get the first frame. If it's not ready, this will trigger the
    * sending of FrameReady() when the image becomes ready.
    */
index 25ea34b..804b612 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 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.
@@ -121,7 +121,52 @@ const char* FRAGMENT_SHADER_ROUNDED_CORNER = DALI_COMPOSE_SHADER(
   {\n
       mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - cornerRadius;\n
       gl_FragColor = uColor * vec4( mixColor, 1.0 );\n
-      gl_FragColor.a *= smoothstep( 1.0, -1.0, dist );\n
+      gl_FragColor.a *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+  }\n
+);
+
+const char* VERTEX_SHADER_BLUR_EDGE = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  uniform highp   mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  varying mediump vec2 vPosition;\n
+  varying mediump vec2 vRectSize;\n
+  \n
+  //Visual size and offset
+  uniform mediump vec2 offset;\n
+  uniform mediump vec2 size;\n
+  uniform mediump vec4 offsetSizeMode;\n
+  uniform mediump vec2 origin;\n
+  uniform mediump vec2 anchorPoint;\n
+  uniform mediump float blurRadius;\n
+  \n
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + blurRadius * 2.0;\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    vRectSize = visualSize / 2.0;\n
+    vPosition = aPosition* visualSize;\n
+    return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+  \n
+  void main()\n
+  {\n
+    gl_Position = uMvpMatrix * ComputeVertexPosition();\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER_BLUR_EDGE = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vPosition;\n
+  varying mediump vec2 vRectSize;\n
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform mediump float blurRadius;\n
+  \n
+  void main()\n
+  {\n
+      mediump vec2 blur = 1.0 - smoothstep( vRectSize - blurRadius * 2.0, vRectSize, abs( vPosition ) );\n
+      gl_FragColor = uColor * vec4( mixColor, 1.0 );\n
+      gl_FragColor.a *= blur.x * blur.y;\n
   }\n
 );
 
@@ -136,6 +181,7 @@ ColorVisualPtr ColorVisual::New( VisualFactoryCache& factoryCache, const Propert
 
 ColorVisual::ColorVisual( VisualFactoryCache& factoryCache )
 : Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+  mBlurRadius( 0.0f ),
   mRenderIfTransparent( false )
 {
 }
@@ -179,6 +225,15 @@ void ColorVisual::DoSetProperties( const Property::Map& propertyMap )
       DALI_LOG_ERROR( "ColorVisual: renderIfTransparent property has incorrect type: %d\n", renderIfTransparentValue->GetType() );
     }
   }
+
+  Property::Value* blurRadiusValue = propertyMap.Find( Toolkit::DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME );
+  if( blurRadiusValue )
+  {
+    if( !blurRadiusValue->Get( mBlurRadius ) )
+    {
+      DALI_LOG_ERROR( "ColorVisual:DoSetProperties:: BLUR_RADIUS property has incorrect type: %d\n", blurRadiusValue->GetType() );
+    }
+  }
 }
 
 void ColorVisual::DoSetOnStage( Actor& actor )
@@ -202,6 +257,7 @@ void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR );
   map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor );
   map.Insert( Toolkit::DevelColorVisual::Property::RENDER_IF_TRANSPARENT, mRenderIfTransparent );
+  map.Insert( Toolkit::DevelColorVisual::Property::BLUR_RADIUS, mBlurRadius );
 }
 
 void ColorVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
@@ -223,7 +279,16 @@ void ColorVisual::InitializeRenderer()
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
 
   Shader shader;
-  if( !IsRoundedCornerRequired() )
+  if( !EqualsZero( mBlurRadius ) )
+  {
+    shader = mFactoryCache.GetShader( VisualFactoryCache::COLOR_SHADER_BLUR_EDGE );
+    if( !shader )
+    {
+      shader = Shader::New( VERTEX_SHADER_BLUR_EDGE, FRAGMENT_SHADER_BLUR_EDGE );
+      mFactoryCache.SaveShader( VisualFactoryCache::COLOR_SHADER_BLUR_EDGE, shader );
+    }
+  }
+  else if( !IsRoundedCornerRequired() )
   {
     shader = mFactoryCache.GetShader( VisualFactoryCache::COLOR_SHADER );
     if( !shader )
@@ -249,7 +314,9 @@ void ColorVisual::InitializeRenderer()
   // String keys will get to this property.
   mImpl->mMixColorIndex = DevelHandle::RegisterProperty( mImpl->mRenderer, Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor) );
 
-  if( mImpl->mMixColor.a < 1.f )
+  mImpl->mRenderer.RegisterProperty( BLUR_RADIUS_NAME, mBlurRadius );
+
+  if( mImpl->mMixColor.a < 1.f || !EqualsZero( mBlurRadius ) )
   {
     mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
index 64ff0b2..05c8ba9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_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.
@@ -115,6 +115,7 @@ private:
 
 private:
 
+  float mBlurRadius;         ///< The blur radius
   bool mRenderIfTransparent; ///< Whether we should render even if the mix-color is transparent.
 };
 
index 4780153..c8b601a 100755 (executable)
@@ -815,7 +815,7 @@ Geometry NPatchVisual::CreateBorderGeometry( Uint16Pair gridSize )
 void NPatchVisual::SetResource()
 {
   const NPatchLoader::Data* data;
-  if( mLoader.GetNPatchData( mId, data ) )
+  if( mImpl->mRenderer && mLoader.GetNPatchData( mId, data ) )
   {
     Geometry geometry = CreateGeometry();
     Shader shader = CreateShader();
index f01260f..44b61f5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VISUAL_FACTORY_CACHE_H
 
 /*
- * 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.
@@ -59,6 +59,7 @@ public:
   {
     COLOR_SHADER,
     COLOR_SHADER_ROUNDED_CORNER,
+    COLOR_SHADER_BLUR_EDGE,
     BORDER_SHADER,
     BORDER_SHADER_ANTI_ALIASING,
     GRADIENT_SHADER_LINEAR_USER_SPACE,
index 79f6163..ff07979 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2018 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.
@@ -81,6 +81,7 @@ const char * const CORNER_RADIUS( "cornerRadius" );
 
 // Color visual
 const char * const RENDER_IF_TRANSPARENT_NAME( "renderIfTransparent" );
+const char * const BLUR_RADIUS_NAME( "blurRadius" );
 
 // Image visual
 const char * const IMAGE_URL_NAME( "url" );
index 8415819..6959905 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_STRING_CONSTANTS_H
 
 /*
- * Copyright (c) 2018 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.
@@ -66,6 +66,7 @@ extern const char * const CORNER_RADIUS;
 
 // Color visual
 extern const char * const RENDER_IF_TRANSPARENT_NAME;
+extern const char * const BLUR_RADIUS_NAME;
 
 // Image visual
 extern const char * const IMAGE_URL_NAME;
index f3cefd6..3342b48 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 5;
-const unsigned int TOOLKIT_MICRO_VERSION = 4;
+const unsigned int TOOLKIT_MICRO_VERSION = 5;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index a62019d..9be9329 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.5.4
+Version:    1.5.5
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT