[dali_1.9.6] Merge branch 'devel/master' 68/229768/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 3 Apr 2020 07:39:02 +0000 (08:39 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 3 Apr 2020 07:39:03 +0000 (08:39 +0100)
Change-Id: I98c515fe5baff5d83bff8e4d8ea325962c5d7142

62 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-FeedbackStyle.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp
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-feedback-player.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-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/CMakeLists.txt
dali-toolkit/devel-api/asset-manager/asset-manager.cpp [new file with mode: 0644]
dali-toolkit/devel-api/asset-manager/asset-manager.h [new file with mode: 0644]
dali-toolkit/devel-api/builder/tree-node.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h
dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/visuals/image-visual-properties-devel.h
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/feedback/feedback-style.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
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/arc/arc-visual.cpp [new file with mode: 0644]
dali-toolkit/internal/visuals/arc/arc-visual.h [new file with mode: 0644]
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/visual-factory-cache.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
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..98172fb 100755 (executable)
@@ -11,6 +11,7 @@ SET(TC_SOURCES
  utc-Dali-ColorConversion.cpp
  utc-Dali-Control-internal.cpp
  utc-Dali-DebugRendering.cpp
+ utc-Dali-FeedbackStyle.cpp
  utc-Dali-ItemView-internal.cpp
  utc-Dali-LogicalModel.cpp
  utc-Dali-PropertyHelper.cpp
@@ -41,6 +42,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-lifecycle-controller.cpp
@@ -66,7 +68,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
diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-FeedbackStyle.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-FeedbackStyle.cpp
new file mode 100644 (file)
index 0000000..202c87f
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ * 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 <iostream>
+#include <stdlib.h>
+
+#include <dali-toolkit/internal/feedback/feedback-style.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/adaptor-framework/feedback-player.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * @brief Sets the return value of the FeedbackPlayer::LoadFile() method of the stub implementation.
+ *
+ * Used to improve the line coverage.
+ *
+ * @param[in] feedbackPlayer The FeedbackPlayer singleton.
+ * @param[in] returnValue The desired return value for the FeedbackPlayer::LoadFile() method. Either true or false.
+ */
+void SetLoadFileReturnValue( Dali::FeedbackPlayer feedbackPlayer, bool returnValue );
+
+}
+
+}
+
+}
+
+int UtcDaliFeedbackStyle(void)
+{
+  // Not too much to test. Just to improve coverage.
+
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliFeedbackStyle");
+
+  try
+  {
+    Toolkit::Internal::FeedbackStyle feedbackStyle;
+
+    Dali::FeedbackPlayer feedbackPlayer = Dali::FeedbackPlayer::Get();
+    Dali::Internal::Adaptor::SetLoadFileReturnValue(feedbackPlayer, false);
+
+    Toolkit::Internal::FeedbackStyle feedbackStyle2;
+
+    Dali::Internal::Adaptor::SetLoadFileReturnValue(feedbackPlayer, true);
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+
+  tet_result(TET_PASS);
+  END_TEST;
+}
index 87345ea..d20cbcf 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/internal/visuals/npatch-loader.h>
 #include <dummy-visual.h>
 #include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -369,3 +370,26 @@ int UtcDaliAnimatedVectorImageVisualSetProperties(void)
 
   END_TEST;
 }
+
+int UtcDaliArcVisualCreateInstancePropertyMap(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliArcVisualCreateInstancePropertyMap" );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
+             .Add( DevelArcVisual::Property::THICKNESS, 20.0f );
+
+  // request ArcVisual with a property map
+  VisualFactory factory = VisualFactory::Get();
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( visual );
+
+  Property::Map resultMap;
+  visualImpl.CreateInstancePropertyMap( resultMap );
+
+  // check the property values from the returned map from a visual
+  DALI_TEST_CHECK( resultMap.Empty() );   // Now the map is empty
+
+  END_TEST;
+}
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..de0513d 100755 (executable)
@@ -10,6 +10,7 @@ SET(TC_SOURCES
   utc-Dali-Alignment.cpp
   utc-Dali-AnimatedImageVisual.cpp
   utc-Dali-AnimatedVectorImageVisual.cpp
+  utc-Dali-ArcVisual.cpp
   utc-Dali-BloomView.cpp
   utc-Dali-BubbleEmitter.cpp
   utc-Dali-Builder.cpp
@@ -110,7 +111,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 9111d8d..946880e 100644 (file)
@@ -85,11 +85,17 @@ public:
 
   bool LoadFile(const std::string& filename, std::string& data)
   {
-    return true;
+    return mLoadFileReturn;
+  }
+
+  void SetLoadFileReturnValue(bool value)
+  {
+    mLoadFileReturn = value;
   }
 
 private:
   FeedbackPlayer()
+  : mLoadFileReturn{true}
   {
   }
 
@@ -105,6 +111,8 @@ private:
   {
     return *this;
   }
+
+  bool mLoadFileReturn;
 };
 
 } // Adaptor
@@ -177,4 +185,17 @@ FeedbackPlayer::FeedbackPlayer( Internal::Adaptor::FeedbackPlayer* player )
 {
 }
 
+namespace Internal
+{
+namespace Adaptor
+{
+
+void SetLoadFileReturnValue(Dali::FeedbackPlayer feedbackPlayer, bool returnValue)
+{
+  GetImplementation(feedbackPlayer).SetLoadFileReturnValue( returnValue );
+}
+
+} // Adaptor
+} // Internal
+
 } // 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 ee6f133..dbbbd84 100644 (file)
@@ -550,6 +550,7 @@ int UtcDaliAccessibilityManagerMoveFocusForward(void)
   Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
   Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
   accAdaptor.HandleActionEnableEvent();
+  accAdaptor.HandleActionNextEvent(true);
 
   Actor first = Actor::New();
   Stage::GetCurrent().Add(first);
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();
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp
new file mode 100644 (file)
index 0000000..be12290
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * 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.
+ * 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 <iostream>
+#include <stdlib.h>
+//#include <chrono>
+//#include <thread>
+#include <dali-toolkit-test-suite-utils.h>
+//#include <toolkit-timer.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
+#include "dummy-control.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+void dali_arc_visual_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_arc_visual_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliVisualFactoryGetArcVisual01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualFactoryGetArcVisual01: Request arc visual with a Property::Map" );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
+             .Add( Visual::Property::MIX_COLOR, Color::RED )
+             .Add( DevelArcVisual::Property::THICKNESS, 20.0f );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  actor.SetSize( 200.0f, 200.0f );
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  // renderer is added to actor
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+  Renderer renderer = actor.GetRendererAt( 0u );
+  DALI_TEST_CHECK( renderer );
+
+  actor.Unparent( );
+  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+
+  END_TEST;
+}
+
+int UtcDaliVisualFactoryGetArcVisual02(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualFactoryGetArcVisual02: Request arc visual with a Property::Map" );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
+             .Add( Visual::Property::MIX_COLOR, Color::RED )
+             .Add( DevelArcVisual::Property::THICKNESS, 20.0f )
+             .Add( DevelArcVisual::Property::START_ANGLE, 0.0f )
+             .Add( DevelArcVisual::Property::SWEEP_ANGLE, 90.0f )
+             .Add( DevelArcVisual::Property::CAP, DevelArcVisual::Cap::ROUND );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  actor.SetSize( 200.0f, 200.0f );
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  // renderer is added to actor
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+  Renderer renderer = actor.GetRendererAt( 0u );
+  DALI_TEST_CHECK( renderer );
+
+  actor.Unparent( );
+  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+
+  END_TEST;
+}
+
+int UtcDaliArcVisualGetPropertyMap01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliArcVisualGetPropertyMap01" );
+
+  float thickness = 20.0f;
+  float startAngle = 0.0f, sweepAngle = 90.0f;
+
+  Property::Map propertyMap;
+  propertyMap.Add( "visualType", DevelVisual::ARC )
+             .Add( "mixColor", Color::RED )
+             .Add( "thickness", thickness )
+             .Add( "startAngle", startAngle )
+             .Add( "sweepAngle", sweepAngle )
+             .Add( "cap", DevelArcVisual::Cap::ROUND );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  actor.SetSize( 200.0f, 200.0f );
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  // renderer is added to actor
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+  Renderer renderer = actor.GetRendererAt( 0u );
+  DALI_TEST_CHECK( renderer );
+
+  Property::Map resultMap;
+  visual.CreatePropertyMap( resultMap );
+
+  // check the property values from the returned map from a visual
+  Property::Value* value = resultMap.Find( Visual::Property::MIX_COLOR, Property::VECTOR4 );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::CAP, Property::INTEGER );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< int >() == DevelArcVisual::Cap::ROUND );
+
+  // Test wrong values
+  propertyMap[DevelArcVisual::Property::THICKNESS] = "3.0f";
+  propertyMap[DevelArcVisual::Property::START_ANGLE] = "0.0f";
+  propertyMap[DevelArcVisual::Property::SWEEP_ANGLE] = "90.0f";
+  propertyMap[DevelArcVisual::Property::CAP] = "1";
+
+  visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  visual.CreatePropertyMap( resultMap );
+
+  value = resultMap.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), 0.0f, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), 0.0f, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_EQUALS( value->Get< float >(), 360.0f, TEST_LOCATION );
+
+  value = resultMap.Find( DevelArcVisual::Property::CAP, Property::INTEGER );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< int >() == DevelArcVisual::Cap::BUTT );
+
+  actor.Unparent( );
+  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+
+  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 1b1d202..cbd6c98 100644 (file)
@@ -31,6 +31,7 @@ OPTION(ENABLE_PKG_CONFIGURE      "Use pkgconfig" ON)
 OPTION(ENABLE_LINK_TEST          "Enable the link test" ON)
 OPTION(INSTALL_DOXYGEN_DOC       "Install doxygen doc" ON)
 OPTION(CONFIGURE_AUTOMATED_TESTS "Configure automated tests" ON)
+OPTION(USE_DEFAULT_RESOURCE_DIR  "Whether to use the default resource folders. Otherwise set environment variables for DALI_IMAGE_DIR, DALI_SOUND_DIR, DALI_STYLE_DIR, DALI_STYLE_IMAGE_DIR and DALI_DATA_READ_ONLY_DIR" ON)
 
 IF( ENABLE_PKG_CONFIGURE )
   FIND_PACKAGE( PkgConfig REQUIRED )
@@ -101,18 +102,22 @@ ENDIF( ENABLE_I18N )
 
 IF( SET_VCPKG_INSTALL_PREFIX )
   ADD_DEFINITIONS( "-DBUILDING_DALI_TOOLKIT" )
-  ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/images/\"
-                   -DDALI_SOUND_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/sounds/\"
-                   -DDALI_STYLE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/\"
-                   -DDALI_STYLE_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/images/\"
-                   -DDALI_DATA_READ_ONLY_DIR=\"${VCPKG_INSTALLED_DIR}/share/\" )
+  IF( USE_DEFAULT_RESOURCE_DIR )
+    ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/images/\"
+                     -DDALI_SOUND_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/sounds/\"
+                     -DDALI_STYLE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/\"
+                     -DDALI_STYLE_IMAGE_DIR=\"${VCPKG_INSTALLED_DIR}/share/dali/toolkit/styles/images/\"
+                     -DDALI_DATA_READ_ONLY_DIR=\"${VCPKG_INSTALLED_DIR}/share/\" )
+  ENDIF()
 ELSE()
   ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
-  ADD_DEFINITIONS(-DDALI_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/images/\"
-                  -DDALI_SOUND_DIR=\"${dataReadOnlyDir}/toolkit/sounds/\"
-                  -DDALI_STYLE_DIR=\"${dataReadOnlyDir}/toolkit/styles/\"
-                  -DDALI_STYLE_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/styles/images/\"
-                  -DDALI_DATA_READ_ONLY_DIR=\"${dataReadOnlyDir}\" )
+  IF( USE_DEFAULT_RESOURCE_DIR )
+    ADD_DEFINITIONS( -DDALI_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/images/\"
+                     -DDALI_SOUND_DIR=\"${dataReadOnlyDir}/toolkit/sounds/\"
+                     -DDALI_STYLE_DIR=\"${dataReadOnlyDir}/toolkit/styles/\"
+                     -DDALI_STYLE_IMAGE_DIR=\"${dataReadOnlyDir}/toolkit/styles/images/\"
+                     -DDALI_DATA_READ_ONLY_DIR=\"${dataReadOnlyDir}\" )
+  ENDIF()
 
   IF("${ARCH}" STREQUAL "arm")
     ADD_DEFINITIONS("-DTARGET")
@@ -123,6 +128,14 @@ ELSE()
   ENDIF( NOT ${ENABLE_EXPORTALL} )
 ENDIF()
 
+IF( NOT USE_DEFAULT_RESOURCE_DIR )
+  ADD_DEFINITIONS( -DDALI_IMAGE_DIR=0
+                   -DDALI_SOUND_DIR=0
+                   -DDALI_STYLE_DIR=0
+                   -DDALI_STYLE_IMAGE_DIR=0
+                   -DDALI_DATA_READ_ONLY_DIR=0 )
+ENDIF()
+
 IF( ENABLE_TRACE )
   ADD_DEFINITIONS("-DTRACE_ENABLED")
 ENDIF()
diff --git a/dali-toolkit/devel-api/asset-manager/asset-manager.cpp b/dali-toolkit/devel-api/asset-manager/asset-manager.cpp
new file mode 100644 (file)
index 0000000..b5c8662
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
+
+namespace
+{
+
+#define TOKEN_STRING(x) #x
+
+} // unnamed namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+const std::string AssetManager::GetDaliImagePath()
+{
+  return (nullptr == DALI_IMAGE_DIR) ? EnvironmentVariable::GetEnvironmentVariable(TOKEN_STRING(DALI_IMAGE_DIR)) : DALI_IMAGE_DIR;
+}
+
+const std::string AssetManager::GetDaliSoundPath()
+{
+  return (nullptr == DALI_SOUND_DIR) ? EnvironmentVariable::GetEnvironmentVariable(TOKEN_STRING(DALI_SOUND_DIR)) : DALI_SOUND_DIR;
+}
+
+const std::string AssetManager::GetDaliStylePath()
+{
+  return (nullptr == DALI_STYLE_DIR) ? EnvironmentVariable::GetEnvironmentVariable(TOKEN_STRING(DALI_STYLE_DIR)) : DALI_STYLE_DIR;
+}
+
+const std::string AssetManager::GetDaliStyleImagePath()
+{
+  return (nullptr == DALI_STYLE_IMAGE_DIR) ? EnvironmentVariable::GetEnvironmentVariable(TOKEN_STRING(DALI_STYLE_IMAGE_DIR)) : DALI_STYLE_IMAGE_DIR;
+}
+
+const std::string AssetManager::GetDaliDataReadOnlyPath()
+{
+  return (nullptr == DALI_DATA_READ_ONLY_DIR) ? EnvironmentVariable::GetEnvironmentVariable(TOKEN_STRING(DALI_DATA_READ_ONLY_DIR)) : DALI_DATA_READ_ONLY_DIR;
+}
+
+} // Toolkit
+
+} // Dali
diff --git a/dali-toolkit/devel-api/asset-manager/asset-manager.h b/dali-toolkit/devel-api/asset-manager/asset-manager.h
new file mode 100644 (file)
index 0000000..aa6f2d6
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef DALI_TOOLKIT_ASSET_MANAGER_DEVEL_H
+#define DALI_TOOLKIT_ASSET_MANAGER_DEVEL_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+class AssetManager
+{
+public:
+  static const std::string GetDaliImagePath();
+  static const std::string GetDaliSoundPath();
+  static const std::string GetDaliStylePath();
+  static const std::string GetDaliStyleImagePath();
+  static const std::string GetDaliDataReadOnlyPath();
+};
+
+} // Toolkit
+
+} // Dali
+
+
+#endif // DALI_TOOLKIT_ASSET_MANAGER_DEVEL_H
+
index f99059d..e62c658 100644 (file)
@@ -69,7 +69,7 @@ public:
   /*
    * Iterator to iterate through children
    */
-  class ConstIterator
+  class DALI_TOOLKIT_API ConstIterator
   {
   public:
     typedef KeyNodePair          value_type;
index fad069b..219fb28 100755 (executable)
@@ -3,6 +3,7 @@ SET( devel_api_src_dir ${ROOT_SRC_DIR}/dali-toolkit/devel-api )
 
 # Add local source files here
 SET( devel_api_src_files
+  ${devel_api_src_dir}/asset-manager/asset-manager.cpp
   ${devel_api_src_dir}/builder/base64-encoding.cpp
   ${devel_api_src_dir}/builder/builder.cpp
   ${devel_api_src_dir}/builder/json-parser.cpp
@@ -125,6 +126,7 @@ SET( devel_api_visuals_header_files
   ${devel_api_src_dir}/visuals/animated-image-visual-actions-devel.h
   ${devel_api_src_dir}/visuals/animated-vector-image-visual-actions-devel.h
   ${devel_api_src_dir}/visuals/animated-vector-image-visual-signals-devel.h
+  ${devel_api_src_dir}/visuals/arc-visual-properties-devel.h
   ${devel_api_src_dir}/visuals/color-visual-properties-devel.h
   ${devel_api_src_dir}/visuals/image-visual-properties-devel.h
   ${devel_api_src_dir}/visuals/image-visual-actions-devel.h
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
diff --git a/dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h b/dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h
new file mode 100644 (file)
index 0000000..a10df8a
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef DALI_TOOLKIT_ARC_VISUAL_PROPERTIES_DEVEL_H
+#define DALI_TOOLKIT_ARC_VISUAL_PROPERTIES_DEVEL_H
+
+/*
+ * 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.
+ * 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-toolkit/public-api/toolkit-property-index-ranges.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelArcVisual
+{
+
+/**
+ * @brief ArcVisual Properties.
+ */
+namespace Property
+{
+
+/**
+ * @brief Enumeration for the instance of properties belonging to the ArcVisual.
+ */
+enum
+{
+  /**
+   * @brief The thickness of the arc.
+   * @details Name "thickness", type Property::FLOAT.
+   * @note Mandatory.
+   */
+  THICKNESS = VISUAL_PROPERTY_START_INDEX,
+
+  /**
+   * @brief The start angle where the arc begins in degrees.
+   * @details Name "startAngle", type Property::FLOAT.
+   * @note Optional. If not specified, the default is 0.
+   */
+  START_ANGLE,
+
+  /**
+   * @brief The sweep angle of the arc in degrees.
+   * @details Name "sweepAngle", type Property::FLOAT.
+   * The arc starts at a specified start angle and sweeps clockwise, drawing slices of pie.
+   * @note Optional. If not specified, the default is 360.
+   */
+  SWEEP_ANGLE,
+
+  /**
+   * @brief The cap of the arc.
+   * @details Name "cap", Type Cap::Type (Property::INTEGER)
+   * It specifies the shape of the endpoints.
+   * @note Optional. If not specified, the default is Cap::BUTT.
+   */
+  CAP,
+};
+
+} // namespace Property
+
+/**
+ * @brief Enumeration for the cap style.
+ */
+namespace Cap
+{
+
+enum Type
+{
+  BUTT,      ///< The arc does not extend beyond its two endpoints.
+  ROUND      ///< The arc will be extended by a half circle with the center at the end.
+};
+
+} // namespace Cap
+
+} // namespace DevelArcVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_ARC_VISUAL_PROPERTIES_DEVEL_H
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 8dfb3cc..3d304a1 100644 (file)
@@ -49,6 +49,7 @@ enum Type
 
   ANIMATED_GRADIENT     = ANIMATED_IMAGE + 1,  ///< Renders an animated gradient.
   ANIMATED_VECTOR_IMAGE = ANIMATED_IMAGE + 2,  ///< Renders an animated vector image.
+  ARC                   = ANIMATED_IMAGE + 3,  ///< Renders an arc.
 };
 
 /**
index 9eeab0e..7f69861 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -58,10 +59,10 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOC
 const char* const ACTOR_FOCUSABLE("focusable");
 const char* const IS_FOCUS_GROUP("isFocusGroup");
 
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png";
+const char* FOCUS_BORDER_IMAGE_FILE_NAME = "B16-8_TTS_focus.9.png";
 
-const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg";
-const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg";
+const char* FOCUS_SOUND_FILE_NAME = "Focus.ogg";
+const char* FOCUS_CHAIN_END_SOUND_FILE_NAME = "End_of_List.ogg";
 
 /**
  * The function to be used in the hit-test algorithm to check whether the actor is hittable.
@@ -112,6 +113,8 @@ AccessibilityManager::AccessibilityManager()
   mFocusIndicatorActor(),
   mPreviousPosition( 0.0f, 0.0f ),
   mRecursiveFocusMoveCounter(0),
+  mFocusSoundFilePath(),
+  mFocusChainEndSoundFilePath(),
   mIsWrapped(false),
   mIsFocusWithinGroup(false),
   mIsEndcapFeedbackEnabled(false),
@@ -119,7 +122,9 @@ AccessibilityManager::AccessibilityManager()
   mIsAccessibilityTtsEnabled(false),
   mTtsCreated(false),
   mIsFocusIndicatorEnabled(false),
-  mContinuousPlayMode(false)
+  mContinuousPlayMode(false),
+  mIsFocusSoundFilePathSet(false),
+  mIsFocusChainEndSoundFilePathSet(false)
 {
 }
 
@@ -357,7 +362,13 @@ bool AccessibilityManager::DoSetCurrentFocusActor(const unsigned int actorID)
         Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get();
         if(soundPlayer)
         {
-          soundPlayer.PlaySound(FOCUS_SOUND_FILE);
+          if (!mIsFocusSoundFilePathSet)
+          {
+            const std::string soundDirPath = AssetManager::GetDaliSoundPath();
+            mFocusSoundFilePath = soundDirPath + FOCUS_SOUND_FILE_NAME;
+            mIsFocusSoundFilePathSet = true;
+          }
+          soundPlayer.PlaySound(mFocusSoundFilePath);
         }
 
         // Play the accessibility attributes with the TTS player.
@@ -595,7 +606,10 @@ Actor AccessibilityManager::GetFocusIndicatorActor()
   if( ! mFocusIndicatorActor )
   {
     // Create the default if it hasn't been set and one that's shared by all the keyboard focusable actors
-    mFocusIndicatorActor = Toolkit::ImageView::New( FOCUS_BORDER_IMAGE_PATH );
+    const std::string imageDirPath = AssetManager::GetDaliImagePath();
+    const std::string focusBorderImagePath = imageDirPath + FOCUS_BORDER_IMAGE_FILE_NAME;
+
+    mFocusIndicatorActor = Toolkit::ImageView::New(focusBorderImagePath);
     mFocusIndicatorActor.SetParentOrigin( ParentOrigin::CENTER );
     mFocusIndicatorActor.SetZ( 1.0f );
 
@@ -622,7 +636,13 @@ bool AccessibilityManager::DoMoveFocus(FocusIDIter focusIDIter, bool forward, bo
         Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get();
         if(soundPlayer)
         {
-          soundPlayer.PlaySound(FOCUS_CHAIN_END_SOUND_FILE);
+          if (!mIsFocusChainEndSoundFilePathSet)
+          {
+            const std::string soundDirPath = AssetManager::GetDaliSoundPath();
+            mFocusChainEndSoundFilePath = soundDirPath + FOCUS_CHAIN_END_SOUND_FILE_NAME;
+            mIsFocusChainEndSoundFilePathSet = true;
+          }
+          soundPlayer.PlaySound(mFocusChainEndSoundFilePath);
         }
 
         mIsEndcapFeedbackPlayed = true;
index d51d753..5c518fd 100644 (file)
@@ -729,6 +729,8 @@ private:
   Actor mFocusIndicatorActor;               ///< The focus indicator actor shared by all the focusable actors for highlight
   Vector2 mPreviousPosition;                ///< The previous pan position; useful for calculating velocity for Gesture::Finished events
   unsigned int mRecursiveFocusMoveCounter;  ///< The counter to count the number of recursive focus movement attempted before the focus movement is successful.
+  std::string mFocusSoundFilePath;          ///< The path of the focus sound file
+  std::string mFocusChainEndSoundFilePath;  ///< The path of the focus chain end sound file
 
   bool mIsWrapped:1;                        ///< Whether the focus movement is wrapped around or not
   bool mIsFocusWithinGroup:1;               ///< Whether the focus movement is limited to the current focus group or not
@@ -738,6 +740,8 @@ private:
   bool mTtsCreated:1;                       ///< Whether the TTS Player has been accessed
   bool mIsFocusIndicatorEnabled:1;          ///< Whether indicator should be shown / hidden. It could be enabled when TTS enabled or 'Tab' key operated.
   bool mContinuousPlayMode:1;               ///< Keeps track of whether or not we are in continuous play mode
+  bool mIsFocusSoundFilePathSet:1;          ///< Whether the path of the focus sound file has been set
+  bool mIsFocusChainEndSoundFilePathSet:1;  ///< Whether the path of the focus chain end sound file has been set
 
 };
 
index 78000be..5165a09 100644 (file)
@@ -35,6 +35,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/devel-api/builder/json-parser.h>
 
 #include <dali-toolkit/internal/builder/builder-declarations.h>
@@ -155,10 +156,10 @@ Builder::Builder()
   mParser = Dali::Toolkit::JsonParser::New();
 
   Property::Map defaultDirs;
-  defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]       = DALI_IMAGE_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ]       = DALI_SOUND_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ]       = DALI_STYLE_DIR;
-  defaultDirs[ TOKEN_STRING(DALI_STYLE_IMAGE_DIR) ] = DALI_STYLE_IMAGE_DIR;
+  defaultDirs[TOKEN_STRING(DALI_IMAGE_DIR)]       = AssetManager::GetDaliImagePath();
+  defaultDirs[TOKEN_STRING(DALI_SOUND_DIR)]       = AssetManager::GetDaliSoundPath();
+  defaultDirs[TOKEN_STRING(DALI_STYLE_DIR)]       = AssetManager::GetDaliStylePath();
+  defaultDirs[TOKEN_STRING(DALI_STYLE_IMAGE_DIR)] = AssetManager::GetDaliStyleImagePath();
 
   AddConstants( defaultDirs );
 }
index cde648a..e11c89f 100644 (file)
@@ -34,6 +34,7 @@
 #include <dali/public-api/size-negotiation/relayout-container.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -177,29 +178,29 @@ const Scripting::StringEnum ContextualModeTable[] = {
 }; const unsigned int ContextualModeTableCount = sizeof( ContextualModeTable ) / sizeof( ContextualModeTable[0] );
 
 // Popup defaults.
-const Vector3 DEFAULT_POPUP_PARENT_RELATIVE_SIZE( 0.75f, 1.0f, 1.0f );                      ///< Default size percentage of parent.
-const float   DEFAULT_POPUP_ANIMATION_DURATION =  0.6f;                                     ///< Duration of hide/show animations.
-const float   POPUP_OUT_MARGIN_WIDTH =            16.f;                                     ///< Space between the screen edge and the popup edge in the horizontal dimension.
-const float   POPUP_OUT_MARGIN_HEIGHT =           36.f;                                     ///< Space between the screen edge and the popup edge in the vertical dimension.
-const Vector3 DEFAULT_TAIL_POSITION( 0.5f, 1.0f, 0.0f );                                    ///< Position the tail will be displayed when enabled without setting the position.
+const Vector3 DEFAULT_POPUP_PARENT_RELATIVE_SIZE( 0.75f, 1.0f, 1.0f );            ///< Default size percentage of parent.
+const float   DEFAULT_POPUP_ANIMATION_DURATION =  0.6f;                           ///< Duration of hide/show animations.
+const float   POPUP_OUT_MARGIN_WIDTH =            16.f;                           ///< Space between the screen edge and the popup edge in the horizontal dimension.
+const float   POPUP_OUT_MARGIN_HEIGHT =           36.f;                           ///< Space between the screen edge and the popup edge in the vertical dimension.
+const Vector3 DEFAULT_TAIL_POSITION( 0.5f, 1.0f, 0.0f );                          ///< Position the tail will be displayed when enabled without setting the position.
 
 // Contextual defaults.
-const Vector2 DEFAULT_CONTEXTUAL_ADJACENCY_MARGIN( 10.0f, 10.0f );                          ///< How close the Popup will be to it's contextual parent.
-const Vector2 DEFAULT_CONTEXTUAL_STAGE_BORDER( 15.0f, 15.0f );                              ///< How close the Popup can be to the stage edges.
+const Vector2 DEFAULT_CONTEXTUAL_ADJACENCY_MARGIN( 10.0f, 10.0f );                ///< How close the Popup will be to it's contextual parent.
+const Vector2 DEFAULT_CONTEXTUAL_STAGE_BORDER( 15.0f, 15.0f );                    ///< How close the Popup can be to the stage edges.
 
 // Popup style defaults.
-const char*   DEFAULT_BACKGROUND_IMAGE_PATH =     DALI_IMAGE_DIR "00_popup_bg.9.png";       ///< Background image.
-const char*   DEFAULT_TAIL_UP_IMAGE_PATH =        DALI_IMAGE_DIR "popup_tail_up.png";       ///< Tail up image.
-const char*   DEFAULT_TAIL_DOWN_IMAGE_PATH =      DALI_IMAGE_DIR "popup_tail_down.png";     ///< Tail down image.
-const char*   DEFAULT_TAIL_LEFT_IMAGE_PATH =      DALI_IMAGE_DIR "popup_tail_left.png";     ///< Tail left image.
-const char*   DEFAULT_TAIL_RIGHT_IMAGE_PATH =     DALI_IMAGE_DIR "popup_tail_right.png";    ///< Tail right image.
-
-const Vector4 DEFAULT_BACKING_COLOR( 0.0f, 0.0f, 0.0f, 0.5f );                              ///< Color of the dimmed backing.
-const Rect<int> DEFAULT_BACKGROUND_BORDER( 17, 17, 13, 13 );                                ///< Default border of the background.
-const Rect<float>  DEFAULT_TITLE_PADDING( 20.0f, 20.0f, 20.0f, 20.0f );                     ///< Title padding used on popups with content and/or controls (from Tizen GUI UX).
-const Rect<float>  DEFAULT_TITLE_ONLY_PADDING( 8.0f, 8.0f, 8.0f, 8.0f );                    ///< Title padding used on popups with a title only (like toast popups).
-const Vector3 FOOTER_SIZE( 620.0f, 96.0f,0.0f );                                            ///< Default size of the bottom control area.
-const float   DEFAULT_RELATIVE_PARENT_WIDTH =     0.75f;                                    ///< If width is not fixed, relative size to parent is used by default.
+const char*   DEFAULT_BACKGROUND_IMAGE_FILE_NAME =     "00_popup_bg.9.png";       ///< Background image.
+const char*   DEFAULT_TAIL_UP_IMAGE_FILE_NAME =        "popup_tail_up.png";       ///< Tail up image.
+const char*   DEFAULT_TAIL_DOWN_IMAGE_FILE_NAME =      "popup_tail_down.png";     ///< Tail down image.
+const char*   DEFAULT_TAIL_LEFT_IMAGE_FILE_NAME =      "popup_tail_left.png";     ///< Tail left image.
+const char*   DEFAULT_TAIL_RIGHT_IMAGE_FILE_NAME =     "popup_tail_right.png";    ///< Tail right image.
+
+const Vector4 DEFAULT_BACKING_COLOR( 0.0f, 0.0f, 0.0f, 0.5f );                    ///< Color of the dimmed backing.
+const Rect<int> DEFAULT_BACKGROUND_BORDER( 17, 17, 13, 13 );                      ///< Default border of the background.
+const Rect<float>  DEFAULT_TITLE_PADDING( 20.0f, 20.0f, 20.0f, 20.0f );           ///< Title padding used on popups with content and/or controls (from Tizen GUI UX).
+const Rect<float>  DEFAULT_TITLE_ONLY_PADDING( 8.0f, 8.0f, 8.0f, 8.0f );          ///< Title padding used on popups with a title only (like toast popups).
+const Vector3 FOOTER_SIZE( 620.0f, 96.0f,0.0f );                                  ///< Default size of the bottom control area.
+const float   DEFAULT_RELATIVE_PARENT_WIDTH =     0.75f;                          ///< If width is not fixed, relative size to parent is used by default.
 
 } // Unnamed namespace
 
@@ -257,12 +258,18 @@ Popup::Popup()
   mPopupBackgroundImage(),
   mBackgroundBorder( DEFAULT_BACKGROUND_BORDER ),
   mMargin(),
-  mTailUpImage( DEFAULT_TAIL_UP_IMAGE_PATH ),
-  mTailDownImage( DEFAULT_TAIL_DOWN_IMAGE_PATH ),
-  mTailLeftImage( DEFAULT_TAIL_LEFT_IMAGE_PATH ),
-  mTailRightImage( DEFAULT_TAIL_RIGHT_IMAGE_PATH )
+  mTailUpImage(),
+  mTailDownImage(),
+  mTailLeftImage(),
+  mTailRightImage()
 {
   SetKeyboardNavigationSupport( true );
+
+  const std::string imageDirPath = AssetManager::GetDaliImagePath();
+  mTailUpImage = imageDirPath + DEFAULT_TAIL_UP_IMAGE_FILE_NAME;
+  mTailDownImage = imageDirPath + DEFAULT_TAIL_DOWN_IMAGE_FILE_NAME;
+  mTailLeftImage = imageDirPath + DEFAULT_TAIL_LEFT_IMAGE_FILE_NAME;
+  mTailRightImage = imageDirPath + DEFAULT_TAIL_RIGHT_IMAGE_FILE_NAME;
 }
 
 void Popup::OnInitialize()
@@ -308,7 +315,8 @@ void Popup::OnInitialize()
   mPopupLayout = Toolkit::TableView::New( 3, 1 );
 
   // Adds the default background image.
-  SetPopupBackgroundImage( Toolkit::ImageView::New( DEFAULT_BACKGROUND_IMAGE_PATH ) );
+  const std::string imageDirPath = AssetManager::GetDaliImagePath();
+  SetPopupBackgroundImage( Toolkit::ImageView::New( imageDirPath + DEFAULT_BACKGROUND_IMAGE_FILE_NAME ) );
 
   mPopupLayout.SetName( "popupLayoutTable" );
   mPopupLayout.SetParentOrigin( ParentOrigin::CENTER );
index 2f7bd6b..990aedf 100644 (file)
@@ -21,6 +21,9 @@
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+
 namespace Dali
 {
 
@@ -33,6 +36,8 @@ namespace Internal
 namespace
 {
 
+const char* const IMAGE_BRDF_FILE_NAME = "brdfLUT.png";
+
 // glTF file extension
 const std::string GLTF_EXT( ".gltf" );
 
@@ -208,7 +213,8 @@ void Scene3dView::SetCubeMap( const std::string& diffuseTexturePath, const std::
   mLightType = Toolkit::Scene3dView::LightType::IMAGE_BASED_LIGHT;
 
   // BRDF texture
-  std::string imageBrdfUrl = DALI_IMAGE_DIR "brdfLUT.png";
+  const std::string imageDirPath = AssetManager::GetDaliImagePath();
+  const std::string imageBrdfUrl = imageDirPath + IMAGE_BRDF_FILE_NAME;
   mBRDFTexture = LoadTexture( imageBrdfUrl.c_str(), true );
   if( !mBRDFTexture )
   {
index cd8438e..6b842fe 100755 (executable)
@@ -30,6 +30,7 @@
 #include <dali/devel-api/object/property-helper-devel.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
@@ -38,7 +39,7 @@ using namespace Dali;
 namespace
 {
 
-const char* DEFAULT_INDICATOR_IMAGE_PATH = DALI_IMAGE_DIR "popup_scroll.9.png";
+const char* DEFAULT_INDICATOR_IMAGE_FILE_NAME = "popup_scroll.9.png";
 const float DEFAULT_SLIDER_DEPTH(1.0f);
 const float DEFAULT_INDICATOR_SHOW_DURATION(0.5f);
 const float DEFAULT_INDICATOR_HIDE_DURATION(0.5f);
@@ -240,7 +241,8 @@ void ScrollBar::SetScrollPropertySource( Handle handle, Property::Index property
 
 void ScrollBar::CreateDefaultIndicatorActor()
 {
-  Toolkit::ImageView indicator = Toolkit::ImageView::New( DEFAULT_INDICATOR_IMAGE_PATH );
+  const std::string imageDirPath = AssetManager::GetDaliImagePath();
+  Toolkit::ImageView indicator = Toolkit::ImageView::New( imageDirPath + DEFAULT_INDICATOR_IMAGE_FILE_NAME );
   indicator.SetParentOrigin( ParentOrigin::TOP_LEFT );
   indicator.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   indicator.SetStyleName( "ScrollBarIndicator" );
index 275995d..419d222 100755 (executable)
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
@@ -87,11 +88,11 @@ const float DEFAULT_HIT_HEIGHT = 72.0f;
 const float DEFAULT_HANDLE_HEIGHT = DEFAULT_HIT_HEIGHT;
 const float POPUP_TEXT_PADDING = 10.0f;
 
-const char* SKINNED_TRACK_VISUAL = DALI_IMAGE_DIR "slider-skin.9.png";
-const char* SKINNED_HANDLE_VISUAL = DALI_IMAGE_DIR "slider-skin-handle.png";
-const char* SKINNED_PROGRESS_VISUAL = DALI_IMAGE_DIR "slider-skin-progress.9.png";
-const char* SKINNED_POPUP_VISUAL = DALI_IMAGE_DIR "slider-popup.9.png";
-const char* SKINNED_POPUP_ARROW_VISUAL = DALI_IMAGE_DIR "slider-popup-arrow.png";
+const char* SKINNED_TRACK_VISUAL_FILE_NAME = "slider-skin.9.png";
+const char* SKINNED_HANDLE_VISUAL_FILE_NAME = "slider-skin-handle.png";
+const char* SKINNED_PROGRESS_VISUAL_FILE_NAME = "slider-skin-progress.9.png";
+const char* SKINNED_POPUP_VISUAL_FILE_NAME = "slider-popup.9.png";
+const char* SKINNED_POPUP_ARROW_VISUAL_FILE_NAME = "slider-popup-arrow.png";
 
 const Vector2 DEFAULT_HIT_REGION( DEFAULT_WIDTH, DEFAULT_HIT_HEIGHT );
 const Vector2 DEFAULT_TRACK_REGION( DEFAULT_WIDTH, DEFAULT_HEIGHT );
@@ -176,11 +177,12 @@ void Slider::OnInitialize()
   SetTrackRegion(   DEFAULT_TRACK_REGION   );
   SetHandleSize(    DEFAULT_HANDLE_SIZE    );
 
-  SetTrackVisual(            SKINNED_TRACK_VISUAL             );
-  SetHandleVisual(           SKINNED_HANDLE_VISUAL            );
-  SetProgressVisual(         SKINNED_PROGRESS_VISUAL          );
-  SetPopupVisual(            SKINNED_POPUP_VISUAL             );
-  SetPopupArrowVisual(       SKINNED_POPUP_ARROW_VISUAL       );
+  const std::string imageDirPath = AssetManager::GetDaliImagePath();
+  SetTrackVisual(            imageDirPath + SKINNED_TRACK_VISUAL_FILE_NAME             );
+  SetHandleVisual(           imageDirPath + SKINNED_HANDLE_VISUAL_FILE_NAME            );
+  SetProgressVisual(         imageDirPath + SKINNED_PROGRESS_VISUAL_FILE_NAME          );
+  SetPopupVisual(            imageDirPath + SKINNED_POPUP_VISUAL_FILE_NAME             );
+  SetPopupArrowVisual(       imageDirPath + SKINNED_POPUP_ARROW_VISUAL_FILE_NAME       );
 
   SetShowPopup( DEFAULT_SHOW_POPUP );
   SetShowValue( DEFAULT_SHOW_VALUE );
index 4375a29..08d5d46 100644 (file)
 #include <dali/devel-api/adaptor-framework/style-monitor.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/devel-api/builder/json-parser.h>
 #include <dali-toolkit/internal/feedback/feedback-ids.h>
 
-using std::string;
-
 namespace // unnamed namespace
 {
 
@@ -38,7 +37,7 @@ namespace // unnamed namespace
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::General, false, "LOG_FEEDBACK");
 #endif
 
-const char* DEFAULT_FEEDBACK_THEME_PATH = DALI_STYLE_DIR"default-feedback-theme.json";
+const char* DEFAULT_FEEDBACK_THEME_FILE_NAME = "default-feedback-theme.json";
 
 // Sets bool and string if the node has a child "name"
 void GetIfString(const Dali::Toolkit::TreeNode& node, const std::string& name, bool& exists, std::string& str)
@@ -76,11 +75,11 @@ struct SignalFeedbackInfo
 
   bool mHasHapticFeedbackInfo;
   bool mHasSoundFeedbackInfo;
-  string mSignalName;
-  string mHapticFeedbackPattern;
-  string mSoundFeedbackPattern;
-  string mHapticFeedbackFile;
-  string mSoundFeedbackFile;
+  std::string mSignalName;
+  std::string mHapticFeedbackPattern;
+  std::string mSoundFeedbackPattern;
+  std::string mHapticFeedbackFile;
+  std::string mSoundFeedbackFile;
 };
 
 typedef std::vector<SignalFeedbackInfo> SignalFeedbackInfoContainer;
@@ -95,7 +94,7 @@ struct FeedbackStyleInfo
   {
   }
 
-  string mTypeName;
+  std::string mTypeName;
 
   SignalFeedbackInfoContainer mSignalFeedbackInfoList;
 };
@@ -106,17 +105,20 @@ FeedbackStyle::FeedbackStyle()
 {
   mFeedback = Dali::FeedbackPlayer::Get();
 
-  string defaultTheme;
+  const std::string styleDirPath = AssetManager::GetDaliStylePath();
+  const std::string defaultThemeFilePath = styleDirPath + DEFAULT_FEEDBACK_THEME_FILE_NAME;
+
+  std::string defaultTheme;
 
-  if( mFeedback && mFeedback.LoadFile( DEFAULT_FEEDBACK_THEME_PATH, defaultTheme ) )
+  if( mFeedback && mFeedback.LoadFile( defaultThemeFilePath, defaultTheme ) )
   {
     LoadTheme( defaultTheme );
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ResourceLoader::LoadTheme(%s) - loaded %d bytes\n",
-                   DEFAULT_FEEDBACK_THEME_PATH, defaultTheme.size() );
+                   defaultThemeFilePath.c_str(), defaultTheme.size() );
   }
   else
   {
-    DALI_LOG_ERROR("ResourceLoader::LoadTheme(%s) - failed to load\n", DEFAULT_FEEDBACK_THEME_PATH);
+    DALI_LOG_ERROR("ResourceLoader::LoadTheme(%s) - failed to load\n", defaultThemeFilePath.c_str());
   }
 
 }
@@ -127,7 +129,7 @@ FeedbackStyle::~FeedbackStyle()
 
 struct PlayFeedbackFromSignal
 {
-  PlayFeedbackFromSignal( FeedbackStyle& controller, const string& typeName, const string& signalName )
+  PlayFeedbackFromSignal( FeedbackStyle& controller, const std::string& typeName, const std::string& signalName )
   : mController( controller ),
     mTypeName( typeName ),
     mSignalName( signalName )
@@ -140,18 +142,16 @@ struct PlayFeedbackFromSignal
   }
 
   FeedbackStyle& mController;
-  string mTypeName;
-  string mSignalName;
+  std::string mTypeName;
+  std::string mSignalName;
 };
 
 
 void FeedbackStyle::ObjectCreated( BaseHandle handle )
 {
-  std::string typeName = handle.GetTypeName();
-
   if( handle )
   {
-    string type = handle.GetTypeName();
+    const std::string& type = handle.GetTypeName();
 
     const FeedbackStyleInfo styleInfo = GetStyleInfo( type );
 
@@ -180,9 +180,9 @@ void FeedbackStyle::ObjectCreated( BaseHandle handle )
   }
 }
 
-const FeedbackStyleInfo& FeedbackStyle::GetStyleInfo( const string& type ) const
+const FeedbackStyleInfo& FeedbackStyle::GetStyleInfo( const std::string& type ) const
 {
-  std::map<const string, FeedbackStyleInfo>::const_iterator iter( mStyleInfoLut.find( type ) );
+  std::map<const std::string, FeedbackStyleInfo>::const_iterator iter( mStyleInfoLut.find( type ) );
   if( iter != mStyleInfoLut.end() )
   {
     return iter->second;
@@ -197,7 +197,7 @@ void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali:
 {
   if( styleChange == StyleChange::THEME_CHANGE )
   {
-    string userDefinedTheme;
+    std::string userDefinedTheme;
 
     if( mFeedback && mFeedback.LoadFile( userDefinedThemePath, userDefinedTheme ) )
     {
@@ -205,8 +205,11 @@ void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali:
       {
         DALI_LOG_ERROR("FeedbackStyle::StyleChanged() User defined theme failed to load! \n");
 
+        const std::string styleDirPath = AssetManager::GetDaliStylePath();
+        const std::string defaultThemeFilePath = styleDirPath + DEFAULT_FEEDBACK_THEME_FILE_NAME;
+
         //If there is any problem is using the user defined theme, then fall back to default theme
-        if( !LoadTheme( DEFAULT_FEEDBACK_THEME_PATH ) )
+        if( !LoadTheme( defaultThemeFilePath ) )
         {
           //If the default theme fails, Then No luck!
           DALI_LOG_ERROR("FeedbackStyle::StyleChanged() Default theme failed to load! \n");
@@ -225,7 +228,7 @@ void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali:
   }
 }
 
-bool FeedbackStyle::LoadTheme( const string& data )
+bool FeedbackStyle::LoadTheme( const std::string& data )
 {
   bool result = false;
 
@@ -244,7 +247,7 @@ bool FeedbackStyle::LoadTheme( const string& data )
   return result;
 }
 
-void FeedbackStyle::LoadFromString( const string& data )
+void FeedbackStyle::LoadFromString( const std::string& data )
 {
   Toolkit::JsonParser parser = Toolkit::JsonParser::New();
   const Toolkit::TreeNode* root = NULL;
@@ -348,7 +351,7 @@ void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackI
   }
 }
 
-void FeedbackStyle::PlayFeedback(const string& type, const string& signalName)
+void FeedbackStyle::PlayFeedback(const std::string& type, const std::string& signalName)
 {
   const FeedbackStyleInfo styleInfo = GetStyleInfo(type);
   SignalFeedbackInfoConstIter iter;
@@ -394,7 +397,7 @@ void FeedbackStyle::PlayFeedback(const string& type, const string& signalName)
   }
 }
 
-FeedbackPattern FeedbackStyle::GetFeedbackPattern( const string &pattern )
+FeedbackPattern FeedbackStyle::GetFeedbackPattern( const std::string &pattern )
 {
   if( 0 == mFeedbackPatternLut.size() )
   {
@@ -450,7 +453,7 @@ FeedbackPattern FeedbackStyle::GetFeedbackPattern( const string &pattern )
     mFeedbackPatternLut["FEEDBACK_PATTERN_SLIDER_SWEEP"]        = Dali::FEEDBACK_PATTERN_SLIDER_SWEEP;
   }
 
-  std::map<const string, FeedbackPattern>::const_iterator iter( mFeedbackPatternLut.find( pattern ) );
+  std::map<const std::string, FeedbackPattern>::const_iterator iter( mFeedbackPatternLut.find( pattern ) );
 
   if( iter != mFeedbackPatternLut.end() )
   {
index 9642ef8..8f3b2f2 100644 (file)
@@ -22,6 +22,7 @@ SET( toolkit_src_files
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-task.cpp
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-thread.cpp
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-rasterize-thread.cpp
+   ${toolkit_src_dir}/visuals/arc/arc-visual.cpp
    ${toolkit_src_dir}/visuals/border/border-visual.cpp
    ${toolkit_src_dir}/visuals/color/color-visual.cpp
    ${toolkit_src_dir}/visuals/gradient/gradient-visual.cpp
index c0fffa0..691f9ab 100644 (file)
@@ -37,6 +37,7 @@
 #include <dali/integration-api/adaptor-framework/scene-holder.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -63,7 +64,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEY
 
 const char* const IS_FOCUS_GROUP_PROPERTY_NAME = "isKeyboardFocusGroup"; // This property will be replaced by a flag in Control.
 
-const char* const FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.9.png";
+const char* const FOCUS_BORDER_IMAGE_FILE_NAME = "keyboard_focus.9.png";
 
 BaseHandle Create()
 {
@@ -731,7 +732,8 @@ Actor KeyboardFocusManager::GetFocusIndicatorActor()
   if( ! mFocusIndicatorActor )
   {
     // Create the default if it hasn't been set and one that's shared by all the keyboard focusable actors
-    mFocusIndicatorActor = Toolkit::ImageView::New( FOCUS_BORDER_IMAGE_PATH );
+    const std::string imageDirPath = AssetManager::GetDaliImagePath();
+    mFocusIndicatorActor = Toolkit::ImageView::New( imageDirPath + FOCUS_BORDER_IMAGE_FILE_NAME );
 
     // Apply size constraint to the focus indicator
     mFocusIndicatorActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
index 066d812..a5a02dd 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/adaptor-framework/application.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/internal/builder/builder-impl.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -38,12 +39,12 @@ namespace
 const char* PORTRAIT_QUALIFIER  = "portrait";
 const char* FONT_SIZE_QUALIFIER = "fontsize";
 
-const char* DEFAULT_THEME = DALI_STYLE_DIR "dali-toolkit-default-theme.json";
+const char* DEFAULT_THEME_FILE_NAME = "dali-toolkit-default-theme.json";
 
 const char* PACKAGE_PATH_KEY = "PACKAGE_PATH";
 const char* APPLICATION_RESOURCE_PATH_KEY = "APPLICATION_RESOURCE_PATH";
 
-const char* DEFAULT_PACKAGE_PATH = DALI_DATA_READ_ONLY_DIR "/toolkit/";
+const char* DEFAULT_TOOLKIT_PACKAGE_PATH = "/toolkit/";
 
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_STYLE");
@@ -108,10 +109,12 @@ Toolkit::StyleManager StyleManager::Get()
 StyleManager::StyleManager()
 : mDefaultFontSize( -1 ),
   mDefaultFontFamily(""),
-  mFeedbackStyle( NULL )
+  mDefaultThemeFilePath(),
+  mFeedbackStyle( nullptr )
 {
   // Add theme builder constants
-  mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
+  const std::string dataReadOnlyDir = AssetManager::GetDaliDataReadOnlyPath();
+  mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = dataReadOnlyDir + DEFAULT_TOOLKIT_PACKAGE_PATH;
   mThemeBuilderConstants[ APPLICATION_RESOURCE_PATH_KEY ] = Application::GetResourcePath();
 
   mStyleMonitor = StyleMonitor::Get();
@@ -121,6 +124,10 @@ StyleManager::StyleManager()
     mDefaultFontSize = mStyleMonitor.GetDefaultFontSize();
   }
 
+  // Set the full path for the default style theme.
+  const std::string styleDirPath = AssetManager::GetDaliStylePath();
+  mDefaultThemeFilePath = styleDirPath + DEFAULT_THEME_FILE_NAME;
+
   // Sound & haptic style
   mFeedbackStyle = new FeedbackStyle();
 }
@@ -137,7 +144,7 @@ void StyleManager::ApplyTheme( const std::string& themeFile )
 
 void StyleManager::ApplyDefaultTheme()
 {
-  SetTheme( DEFAULT_THEME );
+  SetTheme(mDefaultThemeFilePath);
 }
 
 const std::string& StyleManager::GetDefaultFontFamily() const
@@ -240,10 +247,10 @@ void StyleManager::SetTheme( const std::string& themeFile )
   {
     loading = true;
     mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
-    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME ); // Sets themeLoaded to true if theme exists
+    themeLoaded = LoadJSON( mThemeBuilder, mDefaultThemeFilePath ); // Sets themeLoaded to true if theme exists
   }
 
-  if( themeFile.compare(DEFAULT_THEME) != 0 )
+  if( themeFile.compare(mDefaultThemeFilePath) != 0 )
   {
     // The theme is different to the default: Merge it
     loading = true;
@@ -291,8 +298,8 @@ const Property::Map StyleManager::GetConfigurations()
     mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
 
     // Load default theme because this is first try to load stylesheet.
-    themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME );
-    mThemeFile = DEFAULT_THEME;
+    themeLoaded = LoadJSON( mThemeBuilder, mDefaultThemeFilePath );
+    mThemeFile = mDefaultThemeFilePath;
 
     if( themeLoaded )
     {
index 7ca7535..7b3fd53 100644 (file)
@@ -229,6 +229,7 @@ private:
 
   int mDefaultFontSize;               ///< Logical size, not a point-size
   std::string mDefaultFontFamily;
+  std::string mDefaultThemeFilePath;  ///< The full path of the default theme file
   std::string mThemeFile;             ///< The full path of the current theme file
 
   Property::Map mThemeBuilderConstants;   ///< Contants to give the theme builder
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.
    */
diff --git a/dali-toolkit/internal/visuals/arc/arc-visual.cpp b/dali-toolkit/internal/visuals/arc/arc-visual.cpp
new file mode 100644 (file)
index 0000000..a1eb02a
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/visuals/arc/arc-visual.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+//INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+namespace
+{
+
+// cap
+DALI_ENUM_TO_STRING_TABLE_BEGIN( CAP )
+DALI_ENUM_TO_STRING_WITH_SCOPE( DevelArcVisual::Cap, BUTT )
+DALI_ENUM_TO_STRING_WITH_SCOPE( DevelArcVisual::Cap, ROUND )
+DALI_ENUM_TO_STRING_TABLE_END( CAP )
+
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  uniform highp   mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  varying mediump vec2 vPosition;\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
+
+  vec4 ComputeVertexPosition()\n
+  {\n
+    vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
+    vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
+    vPosition = aPosition* visualSize;\n
+    return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
+  }\n
+
+  void main()\n
+  {\n
+    gl_Position = uMvpMatrix * ComputeVertexPosition();\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER_BUTT_CAP = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vPosition;\n
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform mediump float thickness;\n
+  uniform mediump float radius;\n
+  uniform mediump float startAngle;\n
+  uniform mediump float sweepAngle;\n
+  \n
+  const mediump float M_PI_OVER_2 = 1.57079632679;\n
+  const mediump float M_PI = 3.14159265359;\n
+  const mediump float M_PI_2 = 6.28318530718;\n
+  \n
+  mediump float GetOpacity()\n
+  {\n
+      mediump float start = radians( mod( startAngle, 360.0 ) );\n
+      mediump float angle = mod( atan( vPosition.y, vPosition.x ) + M_PI_OVER_2 - start, M_PI_2 );\n
+      mediump float dist = length( vPosition );\n
+      if( angle <= radians( sweepAngle ) )\n
+      {\n
+        return smoothstep( -1.0, 1.0, thickness / 2.0 - ( abs( dist - radius ) ) );\n
+      }\n
+      mediump float end = radians( mod( startAngle + sweepAngle, 360.0 ) );\n
+      mediump vec2 q0 = vec2( dist * cos( start - M_PI_OVER_2 ), dist * sin( start - M_PI_OVER_2 ) );\n
+      mediump vec2 q1 = vec2( dist * cos( end - M_PI_OVER_2 ), dist * sin( end - M_PI_OVER_2 ) );\n
+      mediump float opacity = 1.0 - smoothstep( 0.0, 2.0, min( length( vPosition - q0 ), length( vPosition - q1 ) ) );\n
+      opacity *= step( 0.0, thickness / 2.0 - abs( dist - radius ) );\n
+      return opacity;\n
+  }\n
+  void main()\n
+  {\n
+    gl_FragColor = vec4( mixColor, 1.0 ) * uColor;\n
+    gl_FragColor.a *= GetOpacity();\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER_ROUND_CAP = DALI_COMPOSE_SHADER(
+  varying mediump vec2 vPosition;\n
+  uniform lowp vec4 uColor;\n
+  uniform lowp vec3 mixColor;\n
+  uniform mediump float thickness;\n
+  uniform mediump float radius;\n
+  uniform mediump float startAngle;\n
+  uniform mediump float sweepAngle;\n
+  \n
+  const mediump float M_PI_OVER_2 = 1.57079632679;\n
+  const mediump float M_PI_2 = 6.28318530718;\n
+  \n
+  mediump float GetOpacity()\n
+  {\n
+      mediump float start = radians( mod( startAngle, 360.0 ) );\n
+      mediump float angle = mod( atan( vPosition.y, vPosition.x ) + M_PI_OVER_2 - start, M_PI_2 );\n
+      mediump float dist = length( vPosition );\n
+      if( angle <= radians( sweepAngle ) )\n
+      {\n
+        return smoothstep( -1.0, 1.0, thickness / 2.0 - ( abs( dist - radius ) ) );\n
+      }\n
+      mediump float end = radians( mod( startAngle + sweepAngle, 360.0 ) );\n
+      mediump vec2 q0 = vec2( radius * cos( start - M_PI_OVER_2 ), radius * sin( start - M_PI_OVER_2 ) );\n
+      mediump vec2 q1 = vec2( radius * cos( end - M_PI_OVER_2 ), radius * sin( end - M_PI_OVER_2 ) );\n
+      return smoothstep( -1.0, 1.0, thickness / 2.0 - min( length( vPosition - q0 ), length( vPosition - q1 ) ) );\n
+  }\n
+  void main()\n
+  {\n
+    gl_FragColor = vec4( mixColor, 1.0 ) * uColor;\n
+    gl_FragColor.a *= GetOpacity();\n
+  }\n
+);
+
+}
+
+ArcVisualPtr ArcVisual::New( VisualFactoryCache& factoryCache, const Property::Map& properties )
+{
+  ArcVisualPtr arcVisualPtr( new ArcVisual( factoryCache ) );
+  arcVisualPtr->SetProperties( properties );
+  return arcVisualPtr;
+}
+
+ArcVisual::ArcVisual( VisualFactoryCache& factoryCache )
+: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+  mThickness( 0.0f ),
+  mRadius( 0.0f ),
+  mStartAngle( 0.0f ),
+  mSweepAngle( 360.0f ),
+  mRadiusIndex( Property::INVALID_INDEX ),
+  mCapType( DevelArcVisual::Cap::BUTT )
+{
+}
+
+ArcVisual::~ArcVisual()
+{
+}
+
+void ArcVisual::DoSetProperties( const Property::Map& propertyMap )
+{
+  Property::Value* thicknessValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::THICKNESS, THICKNESS_NAME );
+  if( thicknessValue )
+  {
+    if( !thicknessValue->Get( mThickness ) )
+    {
+      DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: THICKNESS property has incorrect type: %d\n", thicknessValue->GetType() );
+    }
+  }
+
+  Property::Value* startAngleValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::START_ANGLE, START_ANGLE_NAME );
+  if( startAngleValue )
+  {
+    if( !startAngleValue->Get( mStartAngle ) )
+    {
+      DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: START_ANGLE property has incorrect type: %d\n", startAngleValue->GetType() );
+    }
+  }
+
+  Property::Value* sweepAngleValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::SWEEP_ANGLE, SWEEP_ANGLE_NAME );
+  if( sweepAngleValue )
+  {
+    if( !sweepAngleValue->Get( mSweepAngle ) )
+    {
+      DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: SWEEP_ANGLE property has incorrect type: %d\n", sweepAngleValue->GetType() );
+    }
+  }
+
+  Property::Value* capValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::CAP, CAP_NAME );
+  if( capValue )
+  {
+    int capType = 0;
+    Scripting::GetEnumerationProperty( *capValue, CAP_TABLE, CAP_TABLE_COUNT, capType );
+    mCapType = Toolkit::DevelArcVisual::Cap::Type( capType );
+  }
+}
+
+void ArcVisual::DoSetOnStage( Actor& actor )
+{
+  InitializeRenderer();
+
+  actor.AddRenderer( mImpl->mRenderer );
+
+  // Arc Visual generated and ready to display
+  ResourceReady( Toolkit::Visual::ResourceStatus::READY );
+}
+
+void ArcVisual::DoCreatePropertyMap( Property::Map& map ) const
+{
+  map.Clear();
+  map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::ARC );
+  map.Insert( Toolkit::DevelArcVisual::Property::THICKNESS, mThickness );
+  map.Insert( Toolkit::DevelArcVisual::Property::START_ANGLE, mStartAngle );
+  map.Insert( Toolkit::DevelArcVisual::Property::SWEEP_ANGLE, mSweepAngle );
+  map.Insert( Toolkit::DevelArcVisual::Property::CAP, mCapType );
+}
+
+void ArcVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+  // Do nothing
+}
+
+void ArcVisual::OnSetTransform()
+{
+  Vector2 visualSize = mImpl->mTransform.GetVisualSize( mImpl->mControlSize );
+  mRadius = ( std::min( visualSize.width, visualSize.height ) - mThickness ) / 2.0f;
+
+  if( mImpl->mRenderer )
+  {
+    mImpl->mRenderer.SetProperty( mRadiusIndex, mRadius );
+  }
+}
+
+void ArcVisual::InitializeRenderer()
+{
+  Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
+
+  Shader shader;
+  if( mCapType == DevelArcVisual::Cap::BUTT )
+  {
+    shader = mFactoryCache.GetShader( VisualFactoryCache::ARC_BUTT_CAP_SHADER );
+    if( !shader )
+    {
+      shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_BUTT_CAP );
+      mFactoryCache.SaveShader( VisualFactoryCache::ARC_BUTT_CAP_SHADER, shader );
+    }
+  }
+  else
+  {
+    shader = mFactoryCache.GetShader( VisualFactoryCache::ARC_ROUND_CAP_SHADER );
+    if( !shader )
+    {
+      shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_ROUND_CAP );
+      mFactoryCache.SaveShader( VisualFactoryCache::ARC_ROUND_CAP_SHADER, shader );
+    }
+  }
+
+  mImpl->mRenderer = Renderer::New( geometry, shader );
+
+  mImpl->mRenderer.RegisterProperty( THICKNESS_NAME, mThickness );
+  mImpl->mRenderer.RegisterProperty( START_ANGLE_NAME, mStartAngle );
+  mImpl->mRenderer.RegisterProperty( SWEEP_ANGLE_NAME, mSweepAngle );
+  mImpl->mRenderer.RegisterProperty( CAP_NAME, 0.0f );
+
+  mRadiusIndex = mImpl->mRenderer.RegisterProperty( RADIUS_NAME, mRadius );
+
+  mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+
+  // Register transform properties
+  mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/visuals/arc/arc-visual.h b/dali-toolkit/internal/visuals/arc/arc-visual.h
new file mode 100644 (file)
index 0000000..e9fa083
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
+#define DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+class ArcVisual;
+typedef IntrusivePtr< ArcVisual > ArcVisualPtr;
+
+/**
+ * The visual which renders an arc to the control's quad
+ *
+ * The following properties are required for create an ArcVisual
+ *
+ * | %Property Name  | Type        |
+ * |-----------------|-------------|
+ * | THICKNESS       | FLOAT       |
+ * | START_ANGLE     | FLOAT       |
+ * | SWEEP_ANGLE     | FLOAT       |
+ * | CAP             | INTEGER     |
+ */
+class ArcVisual: public Visual::Base
+{
+public:
+
+  /**
+   * @brief Create a new arc visual.
+   *
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] properties A Property::Map containing settings for this visual
+   * @return A smart-pointer to the newly allocated visual.
+   */
+  static ArcVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
+
+public:  // from Visual
+
+  /**
+   * @copydoc Visual::Base::CreatePropertyMap
+   */
+  void DoCreatePropertyMap( Property::Map& map ) const override;
+
+  /**
+   * @copydoc Visual::Base::CreateInstancePropertyMap
+   */
+  void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+
+protected:
+
+  /**
+   * @brief Constructor.
+   *
+   * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   */
+  ArcVisual( VisualFactoryCache& factoryCache );
+
+  /**
+   * @brief A reference counted object may only be deleted by calling Unreference().
+   */
+  virtual ~ArcVisual();
+
+  /**
+   * @copydoc Visual::Base::DoSetProperties
+   */
+  void DoSetProperties( const Property::Map& propertyMap ) override;
+
+  /**
+   * @copydoc Visual::Base::DoSetOnStage
+   */
+  void DoSetOnStage( Actor& actor ) override;
+
+  /**
+   * @copydoc Visual::Base::OnSetTransform
+   */
+  void OnSetTransform() override;
+
+private:
+
+  /**
+   * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
+   */
+  void InitializeRenderer();
+
+private:
+
+  // Undefined
+  ArcVisual( const ArcVisual& arcVisual ) = delete;
+
+  // Undefined
+  ArcVisual& operator=( const ArcVisual& arcVisual ) = delete;
+
+private:
+
+  float mThickness;                    ///< The thickness of the arc.
+  float mRadius;                       ///< The radius of the arc.
+  float mStartAngle;                   ///< The start angle of the arc.
+  float mSweepAngle;                   ///< The sweep angle of the arc.
+  Property::Index mRadiusIndex;        ///< The index of the radius property.
+  DevelArcVisual::Cap::Type mCapType;  ///< The cap type.
+};
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif /* DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H */
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 594c12f..854a43a 100644 (file)
 #include <dali-toolkit/internal/visuals/svg/svg-visual.h>
 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
 
-
-namespace
-{
-const char * const BROKEN_VISUAL_IMAGE_URL( DALI_IMAGE_DIR "broken.png");
-}
-
 namespace Dali
 {
 
index 44b61f5..e3629d3 100644 (file)
@@ -91,7 +91,9 @@ public:
     ANIMATED_GRADIENT_SHADER_RADIAL_USER_REPEAT,
     ANIMATED_GRADIENT_SHADER_RADIAL_USER_CLAMP,
     WIREFRAME_SHADER,
-    SHADER_TYPE_MAX = WIREFRAME_SHADER
+    ARC_BUTT_CAP_SHADER,
+    ARC_ROUND_CAP_SHADER,
+    SHADER_TYPE_MAX = ARC_ROUND_CAP_SHADER
   };
 
   /**
index dcc997b..dc35220 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
@@ -42,6 +43,7 @@
 #include <dali-toolkit/internal/visuals/text/text-visual.h>
 #include <dali-toolkit/internal/visuals/animated-image/animated-image-visual.h>
 #include <dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h>
+#include <dali-toolkit/internal/visuals/arc/arc-visual.h>
 #include <dali-toolkit/internal/visuals/wireframe/wireframe-visual.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/internal/visuals/visual-url.h>
@@ -73,7 +75,7 @@ BaseHandle Create()
 
 DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::VisualFactory, Dali::BaseHandle, Create, true )
 DALI_TYPE_REGISTRATION_END()
-const char * const  BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png" ); ///< URL For the broken image
+const char* const BROKEN_IMAGE_FILE_NAME = "broken.png"; ///< The file name of the broken image.
 
 } // namespace
 
@@ -94,7 +96,8 @@ void VisualFactory::OnStyleChangedSignal( Toolkit::StyleManager styleManager, St
 {
   if( type == StyleChange::THEME_CHANGE )
   {
-    std::string brokenImageUrl(BROKEN_IMAGE_URL);
+    const std::string imageDirPath = AssetManager::GetDaliImagePath();
+    std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME;
 
     Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
     config["brokenImageUrl"].Get( brokenImageUrl );
@@ -275,6 +278,12 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
       }
       break;
     }
+
+    case Toolkit::DevelVisual::ARC:
+    {
+      visualPtr = ArcVisual::New( GetFactoryCache(), propertyMap );
+      break;
+    }
   }
 
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "VisualFactory::CreateVisual( VisualType:%s %s%s)\n",
@@ -403,7 +412,9 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache()
   {
     mFactoryCache = std::unique_ptr<VisualFactoryCache>( new VisualFactoryCache( mPreMultiplyOnLoad ) );
 
-    std::string brokenImageUrl(BROKEN_IMAGE_URL);
+    const std::string imageDirPath = AssetManager::GetDaliImagePath();
+    std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME;
+
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
     if( styleManager )
     {
index ff07979..4c4f3b1 100644 (file)
@@ -45,6 +45,7 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, ANIMATED_IMAGE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::Visual, WIREFRAME )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::DevelVisual, ANIMATED_GRADIENT )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::DevelVisual, ANIMATED_VECTOR_IMAGE )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::DevelVisual, ARC )
 DALI_ENUM_TO_STRING_TABLE_END( VISUAL_TYPE )
 
 // Visual Type
@@ -210,6 +211,11 @@ const char * const BEVEL_PERCENTAGE( "bevelPercentage" );
 const char * const BEVEL_SMOOTHNESS( "bevelSmoothness" );
 const char * const LIGHT_POSITION_UNIFORM_NAME( "lightPosition" );
 
+// Arc visual
+const char * const THICKNESS_NAME( "thickness" );
+const char * const START_ANGLE_NAME( "startAngle" );
+const char * const SWEEP_ANGLE_NAME( "sweepAngle" );
+const char * const CAP_NAME( "cap" );
 
 } // namespace Internal
 
index 6959905..c1a13e9 100644 (file)
@@ -195,6 +195,12 @@ extern const char * const BEVEL_PERCENTAGE;
 extern const char * const BEVEL_SMOOTHNESS;
 extern const char * const LIGHT_POSITION_UNIFORM_NAME;
 
+// Arc visual
+extern const char * const THICKNESS_NAME;
+extern const char * const START_ANGLE_NAME;
+extern const char * const SWEEP_ANGLE_NAME;
+extern const char * const CAP_NAME;
+
 } // namespace Internal
 
 } // namespace Toolkit
index d335e76..bd59baf 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 = 5;
+const unsigned int TOOLKIT_MICRO_VERSION = 6;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index a10b1c5..7056268 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.9.5
+Version:    1.9.6
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT