Merge branch 'devel/master' into tizen
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 27 Jul 2020 06:11:18 +0000 (15:11 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 27 Jul 2020 06:11:34 +0000 (15:11 +0900)
Change-Id: Ia0f4b78c16820328e41e1672bc7d8fac1ee0cc1e

117 files changed:
.gitignore
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali/CMakeLists.txt
automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h
automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp
automated-tests/src/dali/dali-test-suite-utils/test-native-image.h
automated-tests/src/dali/test-sample-addon.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-AddOn.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-Constrainer.cpp
automated-tests/src/dali/utc-Dali-Constraint.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-FrameBuffer.cpp
automated-tests/src/dali/utc-Dali-Geometry.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
automated-tests/src/dali/utc-Dali-Layer.cpp
automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp
automated-tests/src/dali/utc-Dali-Path.cpp
automated-tests/src/dali/utc-Dali-PixelData.cpp
automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp
automated-tests/src/dali/utc-Dali-PropertyNotification.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-RenderTaskList.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
automated-tests/src/dali/utc-Dali-Sampler.cpp
automated-tests/src/dali/utc-Dali-Shader.cpp
automated-tests/src/dali/utc-Dali-Texture.cpp
automated-tests/src/dali/utc-Dali-TextureSet.cpp
automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
automated-tests/src/dali/utc-Dali-WeakHandle.cpp
dali/devel-api/actors/actor-devel.h
dali/devel-api/addons/addon-base.h [new file with mode: 0644]
dali/devel-api/addons/addon-dispatch-table.h [new file with mode: 0644]
dali/devel-api/common/addon-binder.cpp [new file with mode: 0644]
dali/devel-api/common/addon-binder.h [new file with mode: 0644]
dali/devel-api/file.list
dali/devel-api/images/native-image-interface-extension.h [deleted file]
dali/devel-api/rendering/renderer-devel.cpp [new file with mode: 0644]
dali/devel-api/rendering/renderer-devel.h
dali/integration-api/addon-manager.cpp [new file with mode: 0644]
dali/integration-api/addon-manager.h [new file with mode: 0644]
dali/integration-api/file.list
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h [changed mode: 0755->0644]
dali/internal/event/events/touch-event-processor.cpp
dali/internal/event/events/touch-event-processor.h
dali/internal/event/rendering/renderer-impl.cpp
dali/internal/event/rendering/renderer-impl.h
dali/internal/render/common/render-algorithms.cpp
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/renderers/render-renderer.h
dali/internal/render/renderers/render-texture.cpp
dali/internal/update/common/property-condition-step-functions.cpp
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-renderer.h
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor.cpp
dali/public-api/actors/custom-actor.h
dali/public-api/actors/layer.cpp
dali/public-api/actors/layer.h
dali/public-api/animation/animation.cpp
dali/public-api/animation/animation.h
dali/public-api/animation/constraint.cpp
dali/public-api/animation/constraint.h
dali/public-api/animation/key-frames.cpp
dali/public-api/animation/key-frames.h
dali/public-api/animation/linear-constrainer.cpp
dali/public-api/animation/linear-constrainer.h
dali/public-api/animation/path.cpp
dali/public-api/animation/path.h
dali/public-api/dali-core-version.cpp
dali/public-api/images/native-image-interface.h
dali/public-api/images/pixel-data.cpp
dali/public-api/images/pixel-data.h
dali/public-api/object/base-handle.cpp
dali/public-api/object/base-handle.h
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h
dali/public-api/object/object-registry.cpp
dali/public-api/object/object-registry.h
dali/public-api/object/property-conditions.cpp
dali/public-api/object/property-conditions.h
dali/public-api/object/property-notification.cpp
dali/public-api/object/property-notification.h
dali/public-api/object/type-info.cpp
dali/public-api/object/type-info.h
dali/public-api/object/type-registry.cpp
dali/public-api/object/type-registry.h
dali/public-api/object/weak-handle.cpp
dali/public-api/object/weak-handle.h
dali/public-api/render-tasks/render-task-list.cpp
dali/public-api/render-tasks/render-task-list.h
dali/public-api/render-tasks/render-task.cpp
dali/public-api/render-tasks/render-task.h
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/frame-buffer.h
dali/public-api/rendering/geometry.cpp
dali/public-api/rendering/geometry.h
dali/public-api/rendering/property-buffer.cpp
dali/public-api/rendering/property-buffer.h
dali/public-api/rendering/renderer.cpp
dali/public-api/rendering/renderer.h
dali/public-api/rendering/sampler.cpp
dali/public-api/rendering/sampler.h
dali/public-api/rendering/shader.cpp
dali/public-api/rendering/shader.h
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture-set.h
dali/public-api/rendering/texture.cpp
dali/public-api/rendering/texture.h
packaging/dali.spec

index 559051e..2912c11 100644 (file)
@@ -40,6 +40,7 @@ libdali2-core.so*
 *.creator.user
 /docs/generated/*
 /build/tizen/doc
+/build/tizen-cmake/doc
 /build/tizen/.cov
 /build/desktop
 /packaging/home*
index f39572a..22a472d 100644 (file)
@@ -27,6 +27,7 @@ LIST(APPEND TC_SOURCES
         ../dali/dali-test-suite-utils/test-platform-abstraction.cpp
         ../dali/dali-test-suite-utils/test-render-controller.cpp
         ../dali/dali-test-suite-utils/test-trace-call-stack.cpp
+        ../dali/dali-test-suite-utils/test-addon-manager.cpp
 )
 
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
@@ -51,7 +52,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
-    --coverage
+    --coverage -ldl
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
index cd300d0..632363b 100644 (file)
@@ -7,6 +7,7 @@ SET(CAPI_LIB "dali")
 
 SET(TC_SOURCES
         utc-Dali-Actor.cpp
+        utc-Dali-AddOn.cpp
         utc-Dali-AlphaFunction.cpp
         utc-Dali-AngleAxis.cpp
         utc-Dali-Animation.cpp
@@ -119,6 +120,7 @@ LIST(APPEND TC_SOURCES
         dali-test-suite-utils/test-platform-abstraction.cpp
         dali-test-suite-utils/test-render-controller.cpp
         dali-test-suite-utils/test-trace-call-stack.cpp
+        dali-test-suite-utils/test-addon-manager.cpp
 )
 
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
@@ -138,12 +140,30 @@ INCLUDE_DIRECTORIES(
     dali-test-suite-utils
 )
 
+ADD_DEFINITIONS( -DADDON_LIBS_PATH=\"${CMAKE_CURRENT_BINARY_DIR}\" )
+
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
-    -lpthread --coverage
+    -lpthread -ldl --coverage
 )
 
+# Path to installed precompiled addons
+
 INSTALL(PROGRAMS ${EXEC_NAME}
     DESTINATION ${BIN_DIR}/${EXEC_NAME}
 )
+
+# build addons
+MESSAGE( STATUS "BINDIR: ${CMAKE_CURRENT_BINARY_DIR}")
+SET(ADDON_NAME SampleAddOn )
+SET(ADDON_SOURCES test-sample-addon.cpp )
+ADD_LIBRARY( ${ADDON_NAME} SHARED ${ADDON_SOURCES} )
+TARGET_LINK_LIBRARIES(${ADDON_NAME}
+        -lpthread -ldl --coverage
+        )
+
+INSTALL( TARGETS ${ADDON_NAME} DESTINATION ${BIN_DIR} )
+
+# store AddOn list
+FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/addons.txt lib${ADDON_NAME}.so )
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.cpp
new file mode 100644 (file)
index 0000000..307e0a0
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * 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 "test-addon-manager.h"
+#include <dali-test-suite-utils.h>
+#include <cstring>
+#include <dlfcn.h>
+
+#ifndef ADDON_LIBS_PATH
+#define ADDON_LIBS_PATH ""
+#endif
+
+namespace Dali
+{
+namespace Test
+{
+
+std::vector<std::string> AddOnManager::EnumerateAddOns()
+{
+  std::string listFileName(ADDON_LIBS_PATH);
+  listFileName += "/addons.txt";
+
+  // Read list of available test addons
+  tet_printf("Enumerating addons, file: %s\n", listFileName.c_str());
+  std::vector<std::string> addons{};
+  auto* fin = fopen( listFileName.c_str(), "r" );
+  char* lineBuf = new char[256];
+  size_t n = 256;
+  while( getline( &lineBuf, &n, fin ) > 0 )
+  {
+    tet_printf("Adding %s\n", lineBuf);
+    addons.emplace_back( lineBuf );
+  }
+  fclose(fin);
+  delete [] lineBuf;
+  std::vector<std::string> retval{};
+  // Open addons
+  for( auto& name : addons )
+  {
+    std::string path(ADDON_LIBS_PATH);
+    path += "/";
+    path += name;
+
+    mAddOnCache.emplace_back();
+    mAddOnCache.back().handle = dlopen( path.c_str(), RTLD_DEEPBIND|RTLD_LAZY );
+    if( !mAddOnCache.back().handle )
+    {
+      mAddOnCache.back().valid = false;
+      tet_printf( "Can't open addon lib: %s\n", path.c_str());
+      continue;
+    }
+    // Here addon must self register
+    if( !mAddOnCache.back().valid )
+    {
+      puts("Addon invalid!");
+    }
+    else
+    {
+      tet_printf( "Valid AddOn: %s\n", mAddOnCache.back().name.c_str() );
+      retval.emplace_back( mAddOnCache.back().name );
+    }
+  }
+
+  return retval;
+
+  /**
+   * Check for self-registering addons
+   */
+}
+
+void AddOnManager::RegisterAddOnDispatchTable( const AddOnDispatchTable* dispatchTable )
+{
+  // Register the dispatch table
+  auto& entry = mAddOnCache.back();
+  entry.name = dispatchTable->name;
+  tet_printf( "Registering AddOn: %s\n", entry.name.c_str());
+  entry.GetGlobalProc = dispatchTable->GetGlobalProc;
+  entry.GetInstanceProc = dispatchTable->GetInstanceProc;
+  entry.GetAddOnInfo = dispatchTable->GetAddOnInfo;
+  entry.OnStart = dispatchTable->OnStart;
+  entry.OnStop = dispatchTable->OnStop;
+  entry.OnPause = dispatchTable->OnPause;
+  entry.OnResume = dispatchTable->OnResume;
+  entry.valid = true;
+}
+
+bool AddOnManager::GetAddOnInfo(const std::string& name, AddOnInfo& info )
+{
+  auto retval = false;
+  std::find_if( mAddOnCache.begin(), mAddOnCache.end(),
+    [&retval, name, &info]( AddOnCacheEntry& entry )
+  {
+    if(entry.name == name)
+    {
+      entry.GetAddOnInfo( info );
+      retval = true;
+      return true;
+    }
+    return false;
+  });
+  return retval;
+}
+
+std::vector<AddOnLibrary> AddOnManager::LoadAddOns( const std::vector<std::string>& addonNames )
+{
+  if(mAddOnCache.empty())
+  {
+    EnumerateAddOns();
+  }
+
+  std::vector<AddOnLibrary> retval{};
+  for( auto& name : addonNames)
+  {
+    size_t index = 0;
+    auto iter = std::find_if( mAddOnCache.begin(), mAddOnCache.end(),
+      [&retval, name, &index]( AddOnCacheEntry& entry )
+      {
+        index++;
+        if(entry.name == name)
+        {
+          return true;
+        }
+        return false;
+      });
+    if( iter != mAddOnCache.end() )
+    {
+      retval.emplace_back( *reinterpret_cast<void**>( &index ) );
+    }
+    else
+    {
+      retval.emplace_back( nullptr );
+    }
+  }
+
+  return retval;
+}
+
+void* AddOnManager::GetGlobalProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName )
+{
+  auto index = *reinterpret_cast<const size_t*>( &addOnLibrary );
+  return mAddOnCache[index-1].GetGlobalProc( procName );
+}
+
+void* AddOnManager::GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName )
+{
+  auto index = *reinterpret_cast<const size_t*>( &addOnLibrary );
+  return mAddOnCache[index-1].GetInstanceProc( procName );
+}
+
+void AddOnManager::Start()
+{
+  for( auto& entry : mAddOnCache )
+  {
+    if(entry.OnStart)
+    {
+      entry.OnStart();
+    }
+  }
+}
+
+void AddOnManager::Resume()
+{
+  for( auto& entry : mAddOnCache )
+  {
+    if(entry.OnResume)
+    {
+      entry.OnResume();
+    }
+  }
+}
+
+void AddOnManager::Stop()
+{
+  for( auto& entry : mAddOnCache )
+  {
+    if(entry.OnStop)
+    {
+      entry.OnStop();
+    }
+  }
+}
+
+void AddOnManager::Pause()
+{
+  for( auto& entry : mAddOnCache )
+  {
+    if(entry.OnPause)
+    {
+      entry.OnPause();
+    }
+  }
+}
+
+}
+}
+
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.h b/automated-tests/src/dali/dali-test-suite-utils/test-addon-manager.h
new file mode 100644 (file)
index 0000000..e924876
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef TEST_ADDON_MANAGER_H
+#define TEST_ADDON_MANAGER_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.
+ *
+ */
+
+#include <dali/integration-api/addon-manager.h>
+#include <dali/public-api/common/vector-wrapper.h>
+#include <string>
+
+namespace Dali
+{
+namespace Test
+{
+class AddOnManager : public Dali::Integration::AddOnManager
+{
+public:
+
+  /**
+   * @brief Constructor, initialised by the Adaptor
+   */
+  AddOnManager() = default;
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~AddOnManager() = default;
+
+  std::vector<std::string> EnumerateAddOns() override;
+
+  bool GetAddOnInfo(const std::string& name, AddOnInfo& info ) override;
+
+  std::vector<AddOnLibrary> LoadAddOns( const std::vector<std::string>& addonNames ) override;
+
+  void* GetGlobalProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) override;
+
+  void* GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) override;
+
+  void RegisterAddOnDispatchTable( const AddOnDispatchTable* dispatchTable ) override;
+
+  void Start() override;
+
+  void Resume() override;
+
+  void Stop() override;
+
+  void Pause() override;
+
+  struct AddOnCacheEntry
+  {
+    std::string name{};
+    AddOnInfo info{};
+
+    // library handle
+    void* handle {nullptr};
+
+    // main function pointers
+    void(*GetAddOnInfo)(AddOnInfo& ) = nullptr; ///< Returns AddOnInfo structure
+    void*(*GetInstanceProc)( const char* ) = nullptr; ///< Returns pointer of instance function (member funtion)
+    void*(*GetGlobalProc)( const char* ) = nullptr; ///< Returns pointer of global function (non-member function)
+
+    void(*OnStart)() = nullptr;
+    void(*OnResume)() = nullptr;
+    void(*OnPause)() = nullptr;
+    void(*OnStop)() = nullptr;
+
+    bool valid = false;
+  };
+
+  std::vector<AddOnCacheEntry> mAddOnCache;
+};
+} // Namespace Test
+} // namespace Dali
+
+#endif // TEST_ADDON_MANAGER_H
index 8a94e49..ee2397e 100644 (file)
@@ -1,6 +1,23 @@
 #ifndef TEST_CUSTOM_ACTOR_H
 #define TEST_CUSTOM_ACTOR_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.
+ *
+ */
+
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/integration-api/scene.h>
@@ -52,6 +69,9 @@ public:
   virtual ~TestCustomActor();
   Impl::TestCustomActor& GetImpl();
 
+  TestCustomActor( TestCustomActor&& rhs ) = default;
+  TestCustomActor& operator=( TestCustomActor&& rhs ) = default;
+
   std::vector< std::string >& GetMethodsCalled();
   void ResetCallStack();
   void SetDaliProperty(std::string s);
index ee6c17a..5fdc5c3 100644 (file)
@@ -31,26 +31,10 @@ TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
 TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
 : mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
-  mExtension = new TestNativeImageExtension();
 }
 
 TestNativeImage::~TestNativeImage()
 {
 }
 
-
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
-{
-  return new TestNativeImageNoExt(width, height);
-}
-
-TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
-{
-}
-
-TestNativeImageNoExt::~TestNativeImageNoExt()
-{
-}
-
 } // namespace dali
index 0c215b7..89d5095 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/images/native-image-interface.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
 #include <dali/integration-api/gl-defines.h>
 
 namespace Dali
 {
 class TestNativeImage;
-class TestNativeImageNoExt;
 typedef IntrusivePtr<TestNativeImage> TestNativeImagePointer;
-typedef IntrusivePtr<TestNativeImageNoExt> TestNativeImageNoExtPointer;
-
-class DALI_CORE_API TestNativeImageExtension: public Dali::NativeImageInterface::Extension
-{
-public:
-  inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
-  inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
-
-  inline int32_t GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
-
-};
 
 class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
 {
@@ -46,14 +33,21 @@ public:
   static TestNativeImagePointer New(uint32_t width, uint32_t height);
 
   inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
-  inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
-  inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
-  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
+  inline virtual bool CreateResource() { ++mExtensionCreateCalls; return createResult;};
+  inline virtual void DestroyResource() { ++mExtensionDestroyCalls; };
+  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return mTargetTextureError;};
   inline virtual void PrepareTexture() {};
   inline virtual uint32_t GetWidth() const {return mWidth;};
   inline virtual uint32_t GetHeight() const {return mHeight;};
   inline virtual bool RequiresBlending() const {return true;};
-  inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
+  inline virtual int GetTextureTarget() const {return GL_TEXTURE_EXTERNAL_OES;};
+  inline virtual const char* GetCustomFragmentPrefix() const {return "#extension GL_OES_EGL_image_external:require\n";};
+  inline const char* GetCustomSamplerTypename() const override { return "samplerExternalOES"; };
+
+  inline Any GetNativeImageHandle() const override { return nullptr; };
+  inline bool SourceChanged() const override { return false; };
+
+  inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return nullptr;}
 
 private:
   TestNativeImage(uint32_t width, uint32_t height);
@@ -65,38 +59,11 @@ public:
   int32_t mExtensionCreateCalls;
   int32_t mExtensionDestroyCalls;
   int32_t mTargetTextureCalls;
-
+  uint32_t mTargetTextureError=0u;
   bool createResult;
-  TestNativeImageExtension* mExtension;
 };
 
 
-class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
-{
-public:
-  static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
-
-  inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
-  inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
-  inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
-  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
-  inline virtual void PrepareTexture() {};
-  inline virtual uint32_t GetWidth() const {return mWidth;};
-  inline virtual uint32_t GetHeight() const {return mHeight;};
-  inline virtual bool RequiresBlending() const {return true;};
-
-private:
-  TestNativeImageNoExt(uint32_t width, uint32_t height);
-  virtual ~TestNativeImageNoExt();
-
-  uint32_t mWidth;
-  uint32_t mHeight;
-public:
-  int32_t mExtensionCreateCalls;
-  int32_t mExtensionDestroyCalls;
-  int32_t mTargetTextureCalls;
-  bool createResult;
-};
 
 } // Dali
 
diff --git a/automated-tests/src/dali/test-sample-addon.cpp b/automated-tests/src/dali/test-sample-addon.cpp
new file mode 100644 (file)
index 0000000..8a3931e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * 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 <cstring>
+#include <dali/devel-api/addons/addon-base.h>
+#include <dali-test-suite-utils.h>
+
+static const std::string DUMMY_ADDON_NAME = "SampleAddOn";
+
+int StringLen( const char* str )
+{
+  return strlen( str );
+}
+
+int DoSum( int a, int b )
+{
+  return a+b;
+}
+
+class TestDummyAddOn : public Dali::AddOns::AddOnBase
+{
+public:
+
+  void GetAddOnInfo( Dali::AddOnInfo& info ) override
+  {
+    info.type = Dali::AddOnType::GENERIC;
+    info.name = "SampleAddOn";
+    info.version = Dali::DALI_ADDON_VERSION( 1, 0, 0 );
+    info.next = nullptr;
+    tet_printf( "SampleAddOn: GetAddOnInfo() : name = %s\n", info.name.c_str());
+  }
+
+  /**
+   * Dispatch table for global functions
+   * @return
+   */
+  Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
+  {
+    static Dali::AddOns::DispatchTable dispatchTable{};
+    if( dispatchTable.Empty() )
+    {
+      dispatchTable["DoSum"]            = DoSum;
+      dispatchTable["StringLen"]        = StringLen;
+    }
+    return &dispatchTable;
+  }
+
+  /**
+   * Lifecycle
+   */
+
+  void OnStart() override
+  {
+  }
+
+  void OnStop() override
+  {
+  }
+
+  void OnPause() override
+  {
+  }
+
+  void OnResume() override
+  {
+  }
+
+  /**
+   * Dispatch table for instance functions
+   * @return
+   */
+  Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
+  {
+    return nullptr;
+  }
+};
+
+REGISTER_ADDON_CLASS( TestDummyAddOn );
index f9451d2..69b3138 100644 (file)
@@ -323,6 +323,41 @@ int UtcDaliActorDownCastN(void)
   END_TEST;
 }
 
+int UtcDaliActorMoveConstructor(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK( actor );
+
+  int id = actor.GetProperty< int >( Actor::Property::ID );
+
+  Actor moved = std::move( actor);
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+  DALI_TEST_CHECK( !actor );
+
+  END_TEST;
+}
+
+int UtcDaliActorMoveAssignment(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK( actor );
+
+  int id = actor.GetProperty< int >( Actor::Property::ID );
+
+  Actor moved;
+  moved = std::move( actor);
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+  DALI_TEST_CHECK( !actor );
+
+  END_TEST;
+}
+
 //& purpose: Testing Dali::Actor::GetName()
 int UtcDaliActorGetName(void)
 {
@@ -7864,3 +7899,42 @@ int utcDaliActorPartialUpdateActorsWithSizeHint(void)
   END_TEST;
 }
 
+int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get<bool>(), false, TEST_LOCATION);
+  actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true);
+  DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get<bool>(), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(actor.GetPropertyType(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), Property::BOOLEAN, TEST_LOCATION);
+  DALI_TEST_EQUALS(actor.IsPropertyWritable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(actor.IsPropertyAnimatable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(actor.IsPropertyAConstraintInput(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(actor.GetPropertyName(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), "captureAllTouchAfterStart", TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliActorCaptureAllTouchAfterStartPropertyN(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Make sure setting invalid types does not cause a crash
+  try
+  {
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, 1.0f);
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector2::ONE);
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector3::ONE);
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector4::ONE);
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Map());
+    actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Array());
+    tet_result(TET_PASS);
+  }
+  catch(...)
+  {
+     tet_result(TET_FAIL);
+  }
+  END_TEST;
+}
diff --git a/automated-tests/src/dali/utc-Dali-AddOn.cpp b/automated-tests/src/dali/utc-Dali-AddOn.cpp
new file mode 100644 (file)
index 0000000..f221d51
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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 <dali-test-suite-utils.h>
+#include <dali/devel-api/common/addon-binder.h>
+#include "dali-test-suite-utils/test-addon-manager.h"
+
+struct DummyAddOn : public Dali::AddOn::AddOnBinder
+{
+  DummyAddOn() : Dali::AddOn::AddOnBinder( "SampleAddOn" )
+  {}
+
+  ~DummyAddOn() = default;
+
+  ADDON_BIND_FUNCTION( DoSum, int(int, int) );
+
+  ADDON_BIND_FUNCTION( StringLen, int() );
+};
+
+int UtcDaliAddOnBinderP(void)
+{
+  TestApplication application;
+
+  auto* addOnManager = new Dali::Test::AddOnManager();
+
+  tet_infoline("Testing Dali::AddOn::AddOnBinder");
+
+  DummyAddOn addon;
+
+  // Test whether library handle is non-null
+  DALI_TEST_EQUALS( addon.GetHandle(), (void*)1, TEST_LOCATION );
+
+  // Test whether addon is valid
+  auto isValid = addon.IsValid();
+  DALI_TEST_EQUALS( isValid, true, TEST_LOCATION );
+
+  // Test AddOnInfo
+  const auto& info = addon.GetAddOnInfo();
+  DALI_TEST_EQUALS( info.name, "SampleAddOn", TEST_LOCATION );
+
+  delete addOnManager;
+
+  END_TEST;
+}
+
+int UtcDaliAddOnManagerNotSupportedP(void)
+{
+  TestApplication application;
+
+  tet_infoline("Testing Dali::AddOn::AddOnBinder when AddOnManager not supported");
+
+  // Not supported
+  using VoidPtr = void*;
+  DALI_TEST_EQUALS( VoidPtr(Dali::Integration::AddOnManager::Get()), VoidPtr(nullptr), TEST_LOCATION );
+
+  DummyAddOn addon{};
+
+  // Test whether library handle is non-null
+  DALI_TEST_EQUALS( addon.GetHandle(), (void*)0, TEST_LOCATION );
+
+  // Test whether addon is valid
+  auto isValid = addon.IsValid();
+  DALI_TEST_EQUALS( isValid, false, TEST_LOCATION );
+
+  END_TEST;
+}
index 2f9a3ae..659b83f 100644 (file)
@@ -235,6 +235,82 @@ int UtcDaliAnimationAssignmentOperatorP(void)
   END_TEST;
 }
 
+int UtcDaliAnimationMoveConstructor(void)
+{
+  TestApplication application;
+
+  //Animation
+
+  Animation animation = Animation::New( 1.0f );
+  DALI_TEST_CHECK( animation );
+  DALI_TEST_EQUALS( 1, animation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1.0f, animation.GetDuration(), 0.001f, TEST_LOCATION );
+
+  Animation movedAnimation = std::move( animation );
+  DALI_TEST_CHECK( movedAnimation );
+  DALI_TEST_EQUALS( 1, movedAnimation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1.0f, movedAnimation.GetDuration(), 0.001f, TEST_LOCATION );
+  DALI_TEST_CHECK( !animation );
+
+  // KeyFrames
+
+  KeyFrames keyframes = KeyFrames::New();
+  DALI_TEST_CHECK( keyframes );
+  DALI_TEST_EQUALS( 1, keyframes.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Property::Type::NONE, keyframes.GetType(), TEST_LOCATION );
+
+  keyframes.Add( 0.0f, Vector3( 0.0f, 0.0f, 0.0f ) );
+  keyframes.Add( 1.0f, Vector3( 100.0f, 100.0f, 100.0f ) );
+  DALI_TEST_EQUALS( Property::Type::VECTOR3, keyframes.GetType(), TEST_LOCATION );
+
+  KeyFrames movedKeyFrames = std::move( keyframes );
+  DALI_TEST_CHECK( movedKeyFrames );
+  DALI_TEST_EQUALS( 1, movedKeyFrames.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Property::Type::VECTOR3, movedKeyFrames.GetType(), TEST_LOCATION );
+  DALI_TEST_CHECK( !keyframes );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationMoveAssignment(void)
+{
+  TestApplication application;
+
+  // Animation
+
+  Animation animation = Animation::New( 1.0f );
+  DALI_TEST_CHECK( animation );
+  DALI_TEST_EQUALS( 1, animation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1.0f, animation.GetDuration(), 0.001f, TEST_LOCATION );
+
+  Animation move;
+  move = std::move( animation );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1.0f, move.GetDuration(), 0.001f, TEST_LOCATION );
+  DALI_TEST_CHECK( !animation );
+
+  // KeyFrames
+
+  KeyFrames keyframes = KeyFrames::New();
+  DALI_TEST_CHECK( keyframes );
+  DALI_TEST_EQUALS( 1, keyframes.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Property::Type::NONE, keyframes.GetType(), TEST_LOCATION );
+
+  keyframes.Add( 0.0f, Vector3( 0.0f, 0.0f, 0.0f ) );
+  keyframes.Add( 1.0f, Vector3( 100.0f, 100.0f, 100.0f ) );
+  DALI_TEST_EQUALS( Property::Type::VECTOR3, keyframes.GetType(), TEST_LOCATION );
+
+  KeyFrames movedKeyFrames;
+  movedKeyFrames = std::move( keyframes );
+  DALI_TEST_CHECK( movedKeyFrames );
+  DALI_TEST_EQUALS( 1, movedKeyFrames.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Property::Type::VECTOR3, movedKeyFrames.GetType(), TEST_LOCATION );
+  DALI_TEST_CHECK( !keyframes );
+
+  END_TEST;
+}
+
 int UtcDaliAnimationSetDurationP(void)
 {
   TestApplication application;
index a60fcb1..f147800 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -184,6 +184,53 @@ int UtcDaliBaseHandleAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliBaseHandleMoveConstructor(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  BaseHandle object = Actor::New();
+
+  DALI_TEST_EQUALS( 1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  // Move the object, ref count == 1
+  BaseHandle move = std::move( object );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  if ( move )
+  {
+    DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( !object );
+
+  END_TEST;
+}
+
+int UtcDaliBaseHandleMoveAssignment(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  BaseHandle object = Actor::New();
+
+  DALI_TEST_EQUALS( 1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  // Move the object, ref count == 1
+  BaseHandle move;
+  move = std::move( object );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  if ( move )
+  {
+    DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  }
+  DALI_TEST_CHECK( !object );
+
+  END_TEST;
+}
+
 int UtcDaliBaseHandleGetBaseObject(void)
 {
   TestApplication application;
index b413783..1e96dc3 100644 (file)
@@ -72,6 +72,25 @@ static void SetupLinearConstrainerUniformProgress( Dali::LinearConstrainer& line
   linearConstrainer.SetProperty( Dali::LinearConstrainer::Property::VALUE, points );
 }
 
+static void VerifyLinearConstrainerUniformProgress( Dali::LinearConstrainer& linearConstrainer )
+{
+  Dali::Property::Array points;
+  points.Resize(3);
+  points[0] = 0.0f;
+  points[1] = 1.0f;
+  points[2] = 0.0f;
+
+  Property::Value value = linearConstrainer.GetProperty( Dali::LinearConstrainer::Property::VALUE );
+  Property::Array* array = value.GetArray();
+  DALI_TEST_CHECK( array );
+
+  const unsigned int noOfPoints = points.Size();
+  for( unsigned int i = 0; i < noOfPoints; ++i )
+  {
+    DALI_TEST_EQUALS( ( *array )[i].Get< float >(), points[i].Get< float >(), TEST_LOCATION );
+  }
+}
+
 static void SetupLinearConstrainerNonUniformProgress( Dali::LinearConstrainer& linearConstrainer)
 {
   Dali::Property::Array points;
@@ -424,6 +443,47 @@ int UtcLinearConstrainerCopyConstructor(void)
   END_TEST;
 }
 
+int UtcLinearConstrainerMoveConstructor(void)
+{
+  TestApplication application;
+
+  Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
+  DALI_TEST_CHECK( linearConstrainer );
+  DALI_TEST_EQUALS( 1, linearConstrainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  SetupLinearConstrainerUniformProgress( linearConstrainer );
+  VerifyLinearConstrainerUniformProgress( linearConstrainer );
+
+  Dali::LinearConstrainer moved = std::move( linearConstrainer );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  VerifyLinearConstrainerUniformProgress( moved );
+  DALI_TEST_CHECK( !linearConstrainer );
+
+  END_TEST;
+}
+
+int UtcLinearConstrainerMoveAssignment(void)
+{
+  TestApplication application;
+
+  Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
+  DALI_TEST_CHECK( linearConstrainer );
+  DALI_TEST_EQUALS( 1, linearConstrainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  SetupLinearConstrainerUniformProgress( linearConstrainer );
+  VerifyLinearConstrainerUniformProgress( linearConstrainer );
+
+  Dali::LinearConstrainer moved;
+  moved = std::move( linearConstrainer );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  VerifyLinearConstrainerUniformProgress( moved );
+  DALI_TEST_CHECK( !linearConstrainer );
+
+  END_TEST;
+}
+
 int UtcLinearConstrainerApply(void)
 {
   TestApplication application;
index 0bf072e..86b3f15 100644 (file)
@@ -528,6 +528,53 @@ int UtcDaliConstraintCopyAndAssignment(void)
 }
 ///////////////////////////////////////////////////////////////////////////////
 
+int UtcDaliConstraintMoveConstructor(void)
+{
+  // Ensure copy constructor & assignment operators work
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  application.GetScene().Add( actor );
+
+  Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
+  DALI_TEST_CHECK( constraint );
+  DALI_TEST_EQUALS( 1, constraint.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( constraint.GetTargetObject() == actor );
+
+  Constraint moved = std::move( constraint );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( moved.GetTargetObject() == actor );
+  DALI_TEST_CHECK( !constraint );
+
+  END_TEST;
+}
+
+int UtcDaliConstraintMoveAssignment(void)
+{
+  // Ensure copy constructor & assignment operators work
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  application.GetScene().Add( actor );
+
+  Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
+  DALI_TEST_CHECK( constraint );
+  DALI_TEST_EQUALS( 1, constraint.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( constraint.GetTargetObject() == actor );
+
+  Constraint moved;
+  moved = std::move( constraint );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( moved.GetTargetObject() == actor );
+  DALI_TEST_CHECK( !constraint );
+
+  END_TEST;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 // Constraint::DownCast
 ///////////////////////////////////////////////////////////////////////////////
index 8a0ec2c..4bcfd3a 100644 (file)
@@ -113,6 +113,45 @@ int UtcDaliCustomActorDownCastNegative(void)
   END_TEST;
 }
 
+int UtcDaliCustomActorMoveConstructor(void)
+{
+  TestApplication application;
+
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
+  DALI_TEST_CHECK( custom );
+  DALI_TEST_EQUALS( 1, custom.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  int id = custom.GetProperty< int >( Actor::Property::ID );
+
+  Test::TestCustomActor moved = std::move( custom );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !custom );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorMoveAssignment(void)
+{
+  TestApplication application;
+
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
+  DALI_TEST_CHECK( custom );
+  DALI_TEST_EQUALS( 1, custom.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  int id = custom.GetProperty< int >( Actor::Property::ID );
+
+  Test::TestCustomActor moved;
+  moved = std::move( custom );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !custom );
+
+  END_TEST;
+}
+
 int UtcDaliCustomActorOnStageConnectionDisconnection(void)
 {
   TestApplication application;
index 8ae9f0a..69d703b 100644 (file)
@@ -253,6 +253,53 @@ int UtcDaliFrameBufferAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliFrameBufferMoveConstructor(void)
+{
+  TestApplication application;
+
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
+  DALI_TEST_CHECK( frameBuffer );
+  DALI_TEST_EQUALS( 1, frameBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+  frameBuffer.AttachColorTexture( texture );
+  DALI_TEST_EQUALS( frameBuffer.GetColorTexture(), texture, TEST_LOCATION );
+
+  FrameBuffer move = std::move( frameBuffer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetColorTexture(), texture, TEST_LOCATION );
+  DALI_TEST_CHECK( !frameBuffer );
+
+  END_TEST;
+}
+
+int UtcDaliFrameBufferMoveAssignment(void)
+{
+  TestApplication application;
+
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
+  DALI_TEST_CHECK( frameBuffer );
+  DALI_TEST_EQUALS( 1, frameBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+  frameBuffer.AttachColorTexture( texture );
+  DALI_TEST_EQUALS( frameBuffer.GetColorTexture(), texture, TEST_LOCATION );
+
+  FrameBuffer move;
+  move = std::move( frameBuffer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetColorTexture(), texture, TEST_LOCATION );
+  DALI_TEST_CHECK( !frameBuffer );
+
+  END_TEST;
+}
+
 int UtcDaliFrameBufferDownCast01(void)
 {
   TestApplication application;
index dfd1f39..2b7b381 100644 (file)
@@ -105,6 +105,51 @@ int UtcDaliGeometryAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliGeometryMoveConstructor(void)
+{
+  TestApplication application;
+
+  Geometry geometry = Geometry::New();
+  DALI_TEST_CHECK( geometry );
+  DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+  PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+  geometry.AddVertexBuffer( vertexBuffer );
+  DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+  Geometry move = std::move( geometry );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, move.GetNumberOfVertexBuffers(), TEST_LOCATION );
+  DALI_TEST_CHECK( !geometry );
+
+  END_TEST;
+}
+
+int UtcDaliGeometryMoveAssignment(void)
+{
+  TestApplication application;
+
+  Geometry geometry = Geometry::New();
+  DALI_TEST_CHECK( geometry );
+  DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+  PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+  geometry.AddVertexBuffer( vertexBuffer );
+  DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+  Geometry move;
+  move = std::move( geometry );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, move.GetNumberOfVertexBuffers(), TEST_LOCATION );
+  DALI_TEST_CHECK( !geometry );
+
+  END_TEST;
+}
+
 int UtcDaliGeometryDownCast01(void)
 {
   TestApplication application;
index d6a6e49..7a21a9e 100644 (file)
@@ -135,6 +135,57 @@ int UtcDaliHandleAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliHandleMoveConstructor(void)
+{
+  TestApplication application;
+
+  // Initialize a handle, ref count == 1
+  Handle handle = Actor::New();
+
+  DALI_TEST_EQUALS( 1, handle.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  int value( 20 );
+  Property::Index index = handle.RegisterProperty( "customProperty",  value );
+  DALI_TEST_CHECK( handle.GetProperty<int>( index ) == value );
+
+  // Move the object, ref count == 1
+  Handle move = std::move( handle );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( move.GetProperty<int>( index ) == value );
+  DALI_TEST_CHECK( !handle );
+
+  END_TEST;
+}
+
+int UtcDaliHandleMoveAssignment(void)
+{
+  TestApplication application;
+
+  // Initialize a handle, ref count == 1
+  Handle handle = Actor::New();
+
+  DALI_TEST_EQUALS( 1, handle.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  int value( 20 );
+  Property::Index index = handle.RegisterProperty( "customProperty",  value );
+  DALI_TEST_CHECK( handle.GetProperty<int>( index ) == value );
+
+  // Move the object, ref count == 1
+  Handle move;
+  move = std::move( handle );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( move.GetProperty<int>( index ) == value );
+  DALI_TEST_CHECK( !handle );
+
+  END_TEST;
+}
+
 int UtcDaliHandleSupports(void)
 {
   tet_infoline("Positive Test Dali::Handle::Supports()");
index 6ab1dc1..35637cf 100644 (file)
@@ -80,6 +80,48 @@ int UtcDaliLayerDownCast2(void)
   END_TEST;
 }
 
+int UtcDaliLayerMoveConstructor(void)
+{
+  TestApplication application;
+  Layer layer = Layer::New();
+  DALI_TEST_CHECK( layer );
+  DALI_TEST_EQUALS( 1, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+  application.GetScene().Add( layer );
+  DALI_TEST_EQUALS( 2, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+  Layer move = std::move( layer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, move.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+  DALI_TEST_CHECK( !layer );
+
+  END_TEST;
+}
+
+int UtcDaliLayerMoveAssignment(void)
+{
+  TestApplication application;
+  Layer layer = Layer::New();
+  DALI_TEST_CHECK( layer );
+  DALI_TEST_EQUALS( 1, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+  application.GetScene().Add( layer );
+  DALI_TEST_EQUALS( 2, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+  Layer move;
+  move = std::move( layer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, move.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+  DALI_TEST_CHECK( !layer );
+
+  END_TEST;
+}
 
 int UtcDaliLayerGetDepth(void)
 {
index b65703d..fd18ba3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -148,6 +148,43 @@ int UtcDaliObjectRegistryCopyConstructor(void)
   END_TEST;
 }
 
+int UtcDaliObjectRegistryMoveConstructor(void)
+{
+  TestApplication application;
+
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 2, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  ObjectRegistry move = std::move( registry );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !registry );
+
+  END_TEST;
+}
+
+int UtcDaliObjectRegistryMoveAssignment(void)
+{
+  TestApplication application;
+
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 2, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  ObjectRegistry move;
+  move = std::move( registry );
+  DALI_TEST_CHECK( move );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !registry );
+
+  END_TEST;
+}
+
 int UtcDaliObjectRegistrySignalActorCreated(void)
 {
   tet_infoline("Testing GetObjectRegistry()");
index be13ee8..c87a35c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -501,3 +501,43 @@ int UtcDaliPathRegisterProperty(void)
   END_TEST;
 }
 
+int UtcDaliPathMoveConstrcutor(void)
+{
+  TestApplication application;
+
+  Dali::Path path = Dali::Path::New();
+  DALI_TEST_CHECK( path );
+  DALI_TEST_EQUALS( 1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  path.AddPoint(Vector3( 50.0,  50.0, 0.0));
+  DALI_TEST_EQUALS( path.GetPoint(0), Vector3( 50.0,  50.0, 0.0), TEST_LOCATION );
+
+  Dali::Path move = std::move( path );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetPoint(0), Vector3( 50.0,  50.0, 0.0), TEST_LOCATION );
+  DALI_TEST_CHECK( !path );
+
+  END_TEST;
+}
+
+int UtcDaliPathMoveAssignment(void)
+{
+  TestApplication application;
+
+  Dali::Path path = Dali::Path::New();
+  DALI_TEST_CHECK( path );
+  DALI_TEST_EQUALS( 1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  path.AddPoint(Vector3( 50.0,  50.0, 0.0));
+  DALI_TEST_EQUALS( path.GetPoint(0), Vector3( 50.0,  50.0, 0.0), TEST_LOCATION );
+
+  Dali::Path move;
+  move = std::move( path );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetPoint(0), Vector3( 50.0,  50.0, 0.0), TEST_LOCATION );
+  DALI_TEST_CHECK( !path );
+
+  END_TEST;
+}
index 6151545..2a50a5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -98,3 +98,49 @@ int UtcDaliPixelDataAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliPixelDataMoveConstructor(void)
+{
+  TestApplication application;
+
+  unsigned int width = 10u;
+  unsigned int height = 10u;
+  unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::L8 );
+  unsigned char* buffer = new unsigned char [ bufferSize ];
+
+  PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::L8, PixelData::DELETE_ARRAY );
+  DALI_TEST_CHECK( pixelData );
+  DALI_TEST_EQUALS( width, pixelData.GetWidth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( height, pixelData.GetHeight(), TEST_LOCATION );
+
+  PixelData moved = std::move( pixelData);
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( width, moved.GetWidth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( height, moved.GetHeight(), TEST_LOCATION );
+  DALI_TEST_CHECK( !pixelData );
+
+  END_TEST;
+}
+
+int UtcDaliPixelDataMoveAssignment(void)
+{
+  TestApplication application;
+
+  unsigned int width = 10u;
+  unsigned int height = 10u;
+  unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::L8 );
+  unsigned char* buffer = new unsigned char [ bufferSize ];
+
+  PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::L8, PixelData::DELETE_ARRAY );
+  DALI_TEST_CHECK( pixelData );
+  DALI_TEST_EQUALS( width, pixelData.GetWidth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( height, pixelData.GetHeight(), TEST_LOCATION );
+
+  PixelData moved;
+  moved = std::move( pixelData);
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( width, moved.GetWidth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( height, moved.GetHeight(), TEST_LOCATION );
+  DALI_TEST_CHECK( !pixelData );
+
+  END_TEST;
+}
index e2b2689..599d73a 100644 (file)
@@ -110,6 +110,43 @@ int UtcDaliPropertyBufferAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliPropertyBufferMoveConstructor(void)
+{
+  TestApplication application;
+
+  PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+  DALI_TEST_CHECK( propertyBuffer );
+  DALI_TEST_EQUALS( 1, propertyBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, propertyBuffer.GetSize(), TEST_LOCATION );
+
+  PropertyBuffer move = std::move( propertyBuffer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, move.GetSize(), TEST_LOCATION );
+  DALI_TEST_CHECK( !propertyBuffer );
+
+  END_TEST;
+}
+
+int UtcDaliPropertyBufferMoveAssignment(void)
+{
+  TestApplication application;
+
+  PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+  DALI_TEST_CHECK( propertyBuffer );
+  DALI_TEST_EQUALS( 1, propertyBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, propertyBuffer.GetSize(), TEST_LOCATION );
+
+  PropertyBuffer move;
+  move = std::move( propertyBuffer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0u, move.GetSize(), TEST_LOCATION );
+  DALI_TEST_CHECK( !propertyBuffer );
+
+  END_TEST;
+}
+
 int UtcDaliPropertyBufferSetData01(void)
 {
   TestApplication application;
index 2bd3c58..e112d56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -162,6 +162,74 @@ int UtcDaliPropertyNotificationDownCastNegative(void)
   END_TEST;
 }
 
+int UtcDaliPropertyNotificationMoveConstructor(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X, GreaterThanCondition(100.0f));
+  DALI_TEST_CHECK( notification );
+  DALI_TEST_EQUALS( 2, notification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  PropertyNotification movedNotification = std::move( notification );
+  DALI_TEST_CHECK( movedNotification );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, movedNotification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !notification );
+
+  PropertyCondition condition = movedNotification.GetCondition();
+  DALI_TEST_CHECK( condition );
+  DALI_TEST_EQUALS( 2, condition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, condition.GetArgumentCount(), TEST_LOCATION );
+
+  PropertyCondition movedCondition = std::move( condition );
+  DALI_TEST_CHECK( movedCondition );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, movedCondition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, movedCondition.GetArgumentCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !condition );
+
+  END_TEST;
+}
+
+int UtcDaliPropertyNotificationMoveAssignment(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X, GreaterThanCondition(100.0f));
+  DALI_TEST_CHECK( notification );
+  DALI_TEST_EQUALS( 2, notification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  PropertyNotification movedNotification;
+  movedNotification = std::move( notification );
+  DALI_TEST_CHECK( movedNotification );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, movedNotification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !notification );
+
+  PropertyCondition condition = movedNotification.GetCondition();
+  DALI_TEST_CHECK( condition );
+  DALI_TEST_EQUALS( 2, condition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, condition.GetArgumentCount(), TEST_LOCATION );
+
+  PropertyCondition movedCondition;
+  movedCondition = std::move( condition );
+  DALI_TEST_CHECK( movedCondition );
+
+  // Check that object is moved (not copied, so ref count keeps the same)
+  DALI_TEST_EQUALS( 2, movedCondition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1, movedCondition.GetArgumentCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !condition );
+
+  END_TEST;
+}
+
 int UtcDaliAddPropertyNotification(void)
 {
   TestApplication application; // Reset all test adapter return codes
@@ -824,38 +892,206 @@ int UtcDaliPropertyConditionGetArguments(void)
   END_TEST;
 }
 
-int UtcDaliPropertyNotificationStep(void)
+int UtcDaliPropertyNotificationStepVector4(void)
 {
   TestApplication application;
-  tet_infoline(" UtcDaliPropertyNotificationStep");
+  tet_infoline(" UtcDaliPropertyNotificationStepVector4");
 
   Actor actor = Actor::New();
   application.GetScene().Add(actor);
 
-  const float step = 100.0f;
+  const float step = 10.0f;
+  float initValue = 5.0f;
+
+  PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::COLOR, StepCondition(step * 2, 0.0f) );
+  notification.NotifySignal().Connect( &TestCallback );
+
+  actor.SetProperty( Actor::Property::COLOR, Vector4(initValue, 0.0f, 0.0f, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  // test both directions
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to positive
+    gCallBackCalled = false;
+    actor.SetProperty( Actor::Property::COLOR, Vector4(initValue + (i++ * step), 0.0f, 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::COLOR, Vector4(initValue + (i++ * step), 0.0f, 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+
+  initValue = -5.0f;
+  actor.SetProperty( Actor::Property::COLOR, Vector4(initValue, 0.0f, 0.0f, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to negative
+    gCallBackCalled = false;
+    actor.SetProperty( Actor::Property::COLOR, Vector4(initValue -(i++ * step), 0.0f, 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::COLOR, Vector4(initValue -(i++ * step), 0.0f, 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+  END_TEST;
+}
+
+int UtcDaliPropertyNotificationStepFloat(void)
+{
+  TestApplication application;
+  tet_infoline(" UtcDaliPropertyNotificationStepFloat");
+
+  Actor actor = Actor::New();
+  application.GetScene().Add(actor);
+
+  const float step = 10.0f;
+  float initValue = 5.0f;
+
   // float
-  PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, StepCondition(step, 50.0f) );
+  PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, StepCondition(step * 2, 0.0f) );
   notification.NotifySignal().Connect( &TestCallback );
 
   // set initial position
-  actor.SetProperty( Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
+  actor.SetProperty( Actor::Property::POSITION, Vector3(initValue, 0.0f, 0.0f));
   Wait(application, DEFAULT_WAIT_PERIOD);
 
   // test both directions
-  for( int i = 1 ; i < 10 ; ++i )
+  for( int i = 1 ; i < 10 ; )
   {
-    // Move x to negative position
+    // Move x to positive
     gCallBackCalled = false;
-    actor.SetProperty( Actor::Property::POSITION, Vector3((i * step), 0.0f, 0.0f));
+    actor.SetProperty( Actor::Property::POSITION, Vector3(initValue + (i++ * step), 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::POSITION, Vector3(initValue + (i++ * step), 0.0f, 0.0f));
     Wait(application, DEFAULT_WAIT_PERIOD);
     DALI_TEST_CHECK( gCallBackCalled );
   }
 
-  for( int i = 1 ; i < 10 ; ++i )
+  initValue = -5.0f;
+  actor.SetProperty( Actor::Property::POSITION, Vector3(initValue, 0.0f, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to negative
+    gCallBackCalled = false;
+    actor.SetProperty( Actor::Property::POSITION, Vector3(initValue -(i++ * step), 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::POSITION, Vector3(initValue -(i++ * step), 0.0f, 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+  END_TEST;
+}
+
+int UtcDaliPropertyNotificationStepVector2(void)
+{
+  TestApplication application;
+  tet_infoline(" UtcDaliPropertyNotificationStepVector2");
+
+  Actor actor = Actor::New();
+  application.GetScene().Add(actor);
+
+  const float step = 10.0f;
+  float initValue = 5.0f;
+
+  Property::Index propertyIndex = actor.RegisterProperty( "testProperty", Vector2::ZERO );
+
+  PropertyNotification notification = actor.AddPropertyNotification( propertyIndex, StepCondition(step * 2, 0.0f) );
+  notification.NotifySignal().Connect( &TestCallback );
+
+  actor.SetProperty( propertyIndex, Vector2(initValue, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  // test both directions
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to positive
+    gCallBackCalled = false;
+    actor.SetProperty( propertyIndex, Vector2(initValue + (i++ * step), 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( propertyIndex, Vector2(initValue + (i++ * step), 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+
+  initValue = -5.0f;
+  actor.SetProperty( propertyIndex, Vector2(initValue, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to negative
+    gCallBackCalled = false;
+    actor.SetProperty( propertyIndex, Vector2(initValue -(i++ * step), 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( propertyIndex, Vector2(initValue -(i++ * step), 0.0f));
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+  END_TEST;
+}
+
+int UtcDaliPropertyNotificationStepVector3(void)
+{
+  TestApplication application;
+  tet_infoline(" UtcDaliPropertyNotificationStepVector3");
+
+  Actor actor = Actor::New();
+  application.GetScene().Add(actor);
+
+  const float step = 10.0f;
+  float initValue = 5.0f;
+
+  // float
+  PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, StepCondition(step * 2, 0.0f) );
+  notification.NotifySignal().Connect( &TestCallback );
+
+  // set initial position
+  actor.SetProperty( Actor::Property::POSITION, Vector3(initValue, 0.0f, 0.0f));
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  // test both directions
+  for( int i = 1 ; i < 10 ; )
+  {
+    // Move x to positive position
+    gCallBackCalled = false;
+    actor.SetProperty( Actor::Property::POSITION, Vector3( initValue + (i++ * step), 0.0f, 0.0f) );
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::POSITION, Vector3( initValue + (i++ * step), 0.0f, 0.0f) );
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( gCallBackCalled );
+  }
+
+  initValue = -5.0f;
+  actor.SetProperty( Actor::Property::POSITION, Vector3( initValue, 0.0f, 0.0f) );
+  Wait(application, DEFAULT_WAIT_PERIOD);
+
+  for( int i = 1 ; i < 10 ; )
   {
     // Move x to negative position
     gCallBackCalled = false;
-    actor.SetProperty( Actor::Property::POSITION, Vector3(-(i * step), 0.0f, 0.0f));
+    actor.SetProperty( Actor::Property::POSITION, Vector3( initValue -(i++ * step), 0.0f, 0.0f) );
+    Wait(application, DEFAULT_WAIT_PERIOD);
+    DALI_TEST_CHECK( !gCallBackCalled );
+
+    actor.SetProperty( Actor::Property::POSITION, Vector3( initValue -(i++ * step), 0.0f, 0.0f) );
     Wait(application, DEFAULT_WAIT_PERIOD);
     DALI_TEST_CHECK( gCallBackCalled );
   }
index c0b7219..17e96d1 100644 (file)
@@ -2795,3 +2795,60 @@ int UtcDaliRenderTaskSetClearEnabled(void)
 
   END_TEST;
 }
+
+int UtcDaliRenderTaskMoveConstrctor(void)
+{
+  TestApplication application;
+
+  Vector4 testColor( 1.0f, 2.0f, 3.0f, 4.0f );
+
+  RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+  RenderTask task = taskList.GetTask( 0u );
+  DALI_TEST_CHECK( task );
+  DALI_TEST_EQUALS( 2, task.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( task.GetClearColor() != testColor );
+
+  task.SetClearColor( testColor );
+
+  // Wait a frame.
+  Wait(application);
+
+  DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
+
+  RenderTask move = std::move( task );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetClearColor(), testColor, TEST_LOCATION );
+  DALI_TEST_CHECK( !task );
+
+  END_TEST;
+}
+
+int UtcDaliRenderTaskMoveAssignment(void)
+{
+  TestApplication application;
+
+  Vector4 testColor( 1.0f, 2.0f, 3.0f, 4.0f );
+
+  RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+  RenderTask task = taskList.GetTask( 0u );
+  DALI_TEST_CHECK( task );
+  DALI_TEST_EQUALS( 2, task.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( task.GetClearColor() != testColor );
+
+  task.SetClearColor( testColor );
+
+  // Wait a frame.
+  Wait(application);
+
+  DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
+
+  RenderTask move;
+  move = std::move( task );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetClearColor(), testColor, TEST_LOCATION );
+  DALI_TEST_CHECK( !task );
+
+  END_TEST;
+}
index 28dd0d6..e19b508 100644 (file)
@@ -75,6 +75,42 @@ int UtcDaliRenderTaskListAssignment(void)
   END_TEST;
 }
 
+int UtcDaliRenderTaskListMoveConstructor(void)
+{
+  TestApplication application;
+
+  RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+  DALI_TEST_CHECK( taskList );
+  DALI_TEST_EQUALS( 2, taskList.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+
+  RenderTaskList move = std::move( taskList );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( 1u == move.GetTaskCount() );
+  DALI_TEST_CHECK( !taskList );
+
+  END_TEST;
+}
+
+int UtcDaliRenderTaskListMoveAssignment(void)
+{
+  TestApplication application;
+
+  RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+  DALI_TEST_CHECK( taskList );
+  DALI_TEST_EQUALS( 2, taskList.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+
+  RenderTaskList move;
+  move = std::move( taskList );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( 1u == move.GetTaskCount() );
+  DALI_TEST_CHECK( !taskList );
+
+  END_TEST;
+}
 
 int UtcDaliRenderTaskListDownCast(void)
 {
index 5dadf7b..09dd80d 100644 (file)
@@ -140,6 +140,57 @@ int UtcDaliRendererAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliRendererMoveConstructor(void)
+{
+  TestApplication application;
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+  Renderer renderer = Renderer::New( geometry, shader );
+  DALI_TEST_CHECK( renderer );
+  DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+  renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+  Renderer move = std::move( renderer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+  DALI_TEST_CHECK( !renderer );
+
+  END_TEST;
+}
+
+int UtcDaliRendererMoveAssignment(void)
+{
+  TestApplication application;
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+  Renderer renderer = Renderer::New( geometry, shader );
+  DALI_TEST_CHECK( renderer );
+  DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+  renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+  Renderer move;
+  move = std::move( renderer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+  DALI_TEST_CHECK( !renderer );
+
+  END_TEST;
+}
+
 int UtcDaliRendererDownCast01(void)
 {
   TestApplication application;
@@ -3057,3 +3108,64 @@ int UtcDaliRendererRegenerateUniformMap(void)
 
   END_TEST;
 }
+
+int UtcDaliRendererAddDrawCommands(void)
+{
+  TestApplication application;
+
+  tet_infoline("Test adding draw commands to the renderer");
+
+  TestGlAbstraction &glAbstraction = application.GetGlAbstraction();
+  glAbstraction.EnableEnableDisableCallTrace(true);
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader   shader   = Shader::New("vertexSrc", "fragmentSrc");
+  Renderer renderer = Renderer::New(geometry, shader);
+
+  renderer.SetProperty( Renderer::Property::BLEND_MODE, Dali::BlendMode::ON );
+  Actor actor = Actor::New();
+  actor.AddRenderer(renderer);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0f));
+  actor.SetProperty(Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 1.0f));
+  application.GetScene().Add(actor);
+
+  // Expect delivering a single draw call
+  auto &drawTrace = glAbstraction.GetDrawTrace();
+  drawTrace.Reset();
+  drawTrace.Enable(true);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
+
+  auto drawCommand1 = DevelRenderer::DrawCommand{};
+  drawCommand1.drawType     = DevelRenderer::DrawType::INDEXED;
+  drawCommand1.firstIndex   = 0;
+  drawCommand1.elementCount = 2;
+  drawCommand1.queue        = DevelRenderer::RENDER_QUEUE_OPAQUE;
+
+  auto drawCommand2 = DevelRenderer::DrawCommand{};
+  drawCommand2.drawType     = DevelRenderer::DrawType::INDEXED;
+  drawCommand2.firstIndex   = 2;
+  drawCommand2.elementCount = 2;
+  drawCommand2.queue        = DevelRenderer::RENDER_QUEUE_TRANSPARENT;
+
+  auto drawCommand3 = DevelRenderer::DrawCommand{};
+  drawCommand3.drawType     = DevelRenderer::DrawType::ARRAY;
+  drawCommand3.firstIndex   = 2;
+  drawCommand3.elementCount = 2;
+  drawCommand3.queue        = DevelRenderer::RENDER_QUEUE_OPAQUE;
+
+  DevelRenderer::AddDrawCommand(renderer, drawCommand1);
+  DevelRenderer::AddDrawCommand(renderer, drawCommand2);
+  DevelRenderer::AddDrawCommand(renderer, drawCommand3);
+
+  drawTrace.Reset();
+  drawTrace.Enable(true);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 3, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file
index 6f7ca28..c3806f4 100644 (file)
@@ -74,6 +74,39 @@ int UtcDaliSamplerCopyConstructor(void)
   END_TEST;
 }
 
+int UtcDaliSamplerMoveConstructor(void)
+{
+  TestApplication application;
+
+  Sampler sampler = Sampler::New();
+  DALI_TEST_CHECK( sampler );
+  DALI_TEST_EQUALS( 1, sampler.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Sampler move = std::move( sampler );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !sampler );
+
+  END_TEST;
+}
+
+int UtcDaliSamplerMoveAssignment(void)
+{
+  TestApplication application;
+
+  Sampler sampler = Sampler::New();
+  DALI_TEST_CHECK( sampler );
+  DALI_TEST_EQUALS( 1, sampler.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Sampler move;
+  move = std::move( sampler );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( !sampler );
+
+  END_TEST;
+}
+
 int UtcDaliSamplerDownCast01(void)
 {
   TestApplication application;
index 6a06fa3..278af12 100644 (file)
@@ -94,6 +94,51 @@ int UtcDaliShaderAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliShaderMoveConstructor(void)
+{
+  TestApplication application;
+
+  Shader shader = Shader::New(VertexSource, FragmentSource);
+  DALI_TEST_CHECK( shader );
+  DALI_TEST_EQUALS( 1, shader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  // Register a custom property
+  Vector2 vec( 1.0f, 2.0f );
+  Property::Index customIndex = shader.RegisterProperty( "custom", vec );
+  DALI_TEST_EQUALS( shader.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+
+  Shader move = std::move( shader );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+  DALI_TEST_CHECK( !shader );
+
+  END_TEST;
+}
+
+int UtcDaliShaderMoveAssignment(void)
+{
+  TestApplication application;
+
+  Shader shader = Shader::New(VertexSource, FragmentSource);
+  DALI_TEST_CHECK( shader );
+  DALI_TEST_EQUALS( 1, shader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  // Register a custom property
+  Vector2 vec( 1.0f, 2.0f );
+  Property::Index customIndex = shader.RegisterProperty( "custom", vec );
+  DALI_TEST_EQUALS( shader.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+
+  Shader move;
+  move = std::move( shader );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+  DALI_TEST_CHECK( !shader );
+
+  END_TEST;
+}
+
 int UtcDaliShaderDownCast01(void)
 {
   TestApplication application;
index 0222064..19d4a03 100644 (file)
@@ -59,7 +59,7 @@ int UtcDaliTextureNew03(void)
   TestApplication application;
 
   // Create a native image source.
-  TestNativeImageNoExtPointer testNativeImage = TestNativeImageNoExt::New( 64u, 64u );
+  TestNativeImagePointer testNativeImage = TestNativeImage::New( 64u, 64u );
 
   // Create a texture from the native image source.
   Texture nativeTexture = Texture::New( *testNativeImage );
@@ -101,6 +101,51 @@ int UtcDaliTextureAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliTextureMoveConstructor(void)
+{
+  TestApplication application;
+
+  uint32_t width = 64;
+  uint32_t height = 64;
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+  DALI_TEST_CHECK( texture );
+  DALI_TEST_EQUALS( 1, texture.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( texture.GetWidth(), width, TEST_LOCATION );
+  DALI_TEST_EQUALS( texture.GetHeight(), height, TEST_LOCATION );
+
+  Texture move = std::move( texture );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetWidth(), width, TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetHeight(), height, TEST_LOCATION );
+  DALI_TEST_CHECK( !texture );
+
+  END_TEST;
+}
+
+int UtcDaliTextureMoveAssignment(void)
+{
+  TestApplication application;
+
+  uint32_t width = 64;
+  uint32_t height = 64;
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+  DALI_TEST_CHECK( texture );
+  DALI_TEST_EQUALS( 1, texture.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( texture.GetWidth(), width, TEST_LOCATION );
+  DALI_TEST_EQUALS( texture.GetHeight(), height, TEST_LOCATION );
+
+  Texture move;
+  move = std::move( texture );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetWidth(), width, TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetHeight(), height, TEST_LOCATION );
+  DALI_TEST_CHECK( !texture );
+
+  END_TEST;
+}
+
 int UtcDaliTextureDownCast01(void)
 {
   TestApplication application;
@@ -738,20 +783,74 @@ int UtcDaliTextureContextLoss(void)
   END_TEST;
 }
 
-int UtcDaliNativeImageTexture(void)
+int UtcDaliNativeImageTexture01(void)
 {
   TestApplication application;
-  tet_infoline( "UtcDaliNativeImageTexture" );
+  tet_infoline( "UtcDaliNativeImageTexture01" );
 
   TestNativeImagePointer imageInterface = TestNativeImage::New( 16, 16 );
-  Texture texture = Texture::New( *(imageInterface.Get()) );
-  DALI_TEST_CHECK( texture );
+  {
+    Texture texture = Texture::New( *(imageInterface.Get()) );
+    Actor actor = CreateRenderableActor(texture, "", "");
+    application.GetScene().Add(actor);
 
+    DALI_TEST_CHECK( texture );
+
+    application.SendNotification();
+    application.Render(16);
+
+    DALI_TEST_EQUALS( imageInterface->mExtensionCreateCalls, 1, TEST_LOCATION );
+    DALI_TEST_EQUALS( imageInterface->mExtensionDestroyCalls, 0, TEST_LOCATION );
+    DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE), Property::Value(Vector3(16,16,0)), TEST_LOCATION);
+
+    UnparentAndReset(actor);
+
+    application.SendNotification();
+    application.Render(16);
+  }
   application.SendNotification();
   application.Render(16);
 
-  DALI_TEST_CHECK( texture );
+  DALI_TEST_EQUALS( imageInterface->mExtensionCreateCalls, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( imageInterface->mExtensionDestroyCalls, 1, TEST_LOCATION );
 
   END_TEST;
 }
 
+
+int UtcDaliNativeImageTexture02(void)
+{
+  TestApplication application;
+  tet_infoline( "UtcDaliNativeImageTexture02 - test error on TargetTexture" );
+
+  TestNativeImagePointer imageInterface = TestNativeImage::New( 16, 16 );
+  imageInterface->mTargetTextureError = 1u;
+  {
+    Texture texture = Texture::New( *(imageInterface.Get()) );
+    Actor actor = CreateRenderableActor(texture, "", "");
+    application.GetScene().Add(actor);
+
+    DALI_TEST_CHECK( texture );
+
+    application.SendNotification();
+    application.Render(16);
+
+    // Expect 2 attempts to create the texture - once when adding the texture
+    // to the scene-graph, and again since that failed, during the Bind.
+    DALI_TEST_EQUALS( imageInterface->mExtensionCreateCalls, 2, TEST_LOCATION );
+    DALI_TEST_EQUALS( imageInterface->mExtensionDestroyCalls, 2, TEST_LOCATION );
+
+    UnparentAndReset(actor);
+
+    application.SendNotification();
+    application.Render(16);
+  }
+  application.SendNotification();
+  application.Render(16);
+
+  // Expect that there are no further calls to create/destroy resource
+  DALI_TEST_EQUALS( imageInterface->mExtensionCreateCalls, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( imageInterface->mExtensionDestroyCalls, 2, TEST_LOCATION );
+
+  END_TEST;
+}
index 73a3b26..6b190ec 100644 (file)
@@ -120,6 +120,49 @@ int UtcDaliTextureSetAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliTextureSetMoveConstructor(void)
+{
+  TestApplication application;
+
+  TextureSet textureSet = TextureSet::New();
+  DALI_TEST_CHECK( textureSet );
+  DALI_TEST_EQUALS( 1, textureSet.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 32, 32 );
+  textureSet.SetTexture( 0u, texture );
+  DALI_TEST_EQUALS( textureSet.GetTexture( 0u ), texture, TEST_LOCATION );
+
+  TextureSet move = std::move( textureSet );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetTexture( 0u ), texture, TEST_LOCATION );
+  DALI_TEST_CHECK( !textureSet );
+
+  END_TEST;
+}
+
+int UtcDaliTextureSetMoveAssignment(void)
+{
+  TestApplication application;
+
+  TextureSet textureSet = TextureSet::New();
+  DALI_TEST_CHECK( textureSet );
+  DALI_TEST_EQUALS( 1, textureSet.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 32, 32 );
+  textureSet.SetTexture( 0u, texture );
+  DALI_TEST_EQUALS( textureSet.GetTexture( 0u ), texture, TEST_LOCATION );
+
+  TextureSet move;
+  move = std::move( textureSet );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetTexture( 0u ), texture, TEST_LOCATION );
+  DALI_TEST_CHECK( !textureSet );
+
+  END_TEST;
+}
+
 int UtcDaliTextureSetDownCast01(void)
 {
   TestApplication application;
index 4e96d66..95db95e 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
+#include <dali/devel-api/actors/actor-devel.h>
 
 using namespace Dali;
 
@@ -2034,3 +2035,56 @@ int UtcDaliTouchDataGetMouseButtonNagative(void)
   END_TEST;
 }
 
+int UtcDaliTouchDataCapturePropertySet(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchDataFunctor functor( data );
+  actor.TouchSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( PointState::STARTED, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Now motion outside of actor, we should not receive the event
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 110.0f, 110.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Up event, should receive an interrupted
+  application.ProcessEvent( GenerateSingleTouch( PointState::FINISHED, Vector2( 110.0f, 110.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( data.touchData.GetPoint(0).state, PointState::INTERRUPTED, TEST_LOCATION );
+
+  // Now set the capture property
+  actor.SetProperty( DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true);
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( PointState::STARTED, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Now motion outside of actor, we now SHOULD receive the event
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 110.0f, 110.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Up event, we should receive it again, but as ended rather than interrupted
+  application.ProcessEvent( GenerateSingleTouch( PointState::FINISHED, Vector2( 110.0f, 110.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( data.touchData.GetPoint(0).state, PointState::FINISHED, TEST_LOCATION );
+
+  END_TEST;
+}
index 51a2e57..bfcf5cf 100644 (file)
@@ -573,6 +573,66 @@ int UtcDaliTypeRegistryAssignmentOperatorP(void)
   END_TEST;
 }
 
+int UtcDaliTypeRegistryMoveConstructor(void)
+{
+  TestApplication application;
+
+  TypeRegistry registry = TypeRegistry::Get();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+  TypeRegistry movedRegistry = std::move( registry );
+  DALI_TEST_CHECK( movedRegistry );
+  DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+  DALI_TEST_CHECK( !registry );
+
+  Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( info );
+  DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+  Dali::TypeInfo movedInfo = std::move( info );
+  DALI_TEST_CHECK( movedInfo );
+  DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+  DALI_TEST_CHECK( !info );
+
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryMoveAssignment(void)
+{
+  TestApplication application;
+
+  TypeRegistry registry = TypeRegistry::Get();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+  TypeRegistry movedRegistry;
+  movedRegistry = std::move( registry );
+  DALI_TEST_CHECK( movedRegistry );
+  DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+  DALI_TEST_CHECK( !registry );
+
+  Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( info );
+  DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+  Dali::TypeInfo movedInfo;
+  movedInfo = std::move( info );
+  DALI_TEST_CHECK( movedInfo );
+  DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+  DALI_TEST_CHECK( !info );
+
+  END_TEST;
+}
+
 int UtcDaliTypeRegistryAssignP(void)
 {
   TestApplication application;
index 6848f1f..0e81340 100644 (file)
@@ -264,6 +264,45 @@ int UtcDaliWeakHandleBaseAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliWeakHandleBaseMoveConstructor(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandleBase object( actor );
+  DALI_TEST_CHECK( object.GetBaseHandle() == actor);
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandleBase move = std::move( object );
+  DALI_TEST_CHECK(move.GetBaseHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+  DALI_TEST_CHECK( !object.GetBaseHandle() ); // object moved
+
+  END_TEST;
+}
+
+int UtcDaliWeakHandleBaseMoveAssignment(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandleBase object( actor );
+  DALI_TEST_CHECK( object.GetBaseHandle() == actor);
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandleBase move;
+  move = std::move( object );
+  DALI_TEST_CHECK(move.GetBaseHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+  DALI_TEST_CHECK( !object.GetBaseHandle() ); // object moved
+
+  END_TEST;
+}
+
 int UtcDaliWeakHandleBaseEqualityOperatorP(void)
 {
   TestApplication application;
@@ -412,4 +451,42 @@ int UtcDaliWeakHandleGetHandle(void)
   END_TEST;
 }
 
+int UtcDaliWeakHandleMoveConstructor(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandle<Actor> object( actor );
+  DALI_TEST_CHECK( object.GetHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandle<Actor> move = std::move( object );
+  DALI_TEST_CHECK( move.GetHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+  DALI_TEST_CHECK( !object.GetHandle() ); // object moved
+
+  END_TEST;
+}
+
+int UtcDaliWeakHandleMoveAssignment(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandle<Actor> object( actor );
+  DALI_TEST_CHECK( object.GetHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+  WeakHandle<Actor> move;
+  move = std::move( object );
+  DALI_TEST_CHECK( move.GetHandle() == actor );
+  DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+  DALI_TEST_CHECK( !object.GetHandle() ); // object moved
+
+  END_TEST;
+}
 
index 9eccc32..9a82366 100644 (file)
@@ -106,14 +106,21 @@ enum Type
    * @note Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the
    * sibling order. The values set by this Property will likely change.
    */
-  SIBLING_ORDER = KEYBOARD_FOCUSABLE + 1,
+  SIBLING_ORDER,
 
   /**
    * @brief Sets the update size hint of the actor.
    * @details Name "updateSizeHint", type Property::VECTOR2.
    * @note Overrides the size used for the actor damaged area calculation. Affected by the actor model view matrix.
    */
-  UPDATE_SIZE_HINT = SIBLING_ORDER + 1,
+  UPDATE_SIZE_HINT,
+
+  /**
+    * @brief If this actor receives a touch-start event, then all following touch events are sent to this actor until a touch-end.
+    * @details Name "captureAllTouchAfterStart", type Property::BOOLEAN
+    * @note Default is false, i.e. actor under touch event will receive the touch even if touch started on this actor
+    */
+  CAPTURE_ALL_TOUCH_AFTER_START
 };
 
 } // namespace Property
diff --git a/dali/devel-api/addons/addon-base.h b/dali/devel-api/addons/addon-base.h
new file mode 100644 (file)
index 0000000..f3c3279
--- /dev/null
@@ -0,0 +1,270 @@
+#ifndef DALI_ADDONS_ADDON_BASE_H
+#define DALI_ADDONS_ADDON_BASE_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.
+ *
+ */
+
+#include <dali/integration-api/addon-manager.h>
+#include <dali/devel-api/addons/addon-dispatch-table.h>
+#include <vector>
+
+namespace Dali
+{
+namespace AddOns
+{
+
+/**
+ * @class AddOnBase
+ *
+ * @brief AddOnBase is a base class for AddOns and should be used rather
+ * than writing exported functions of the AddOn directly.
+ *
+ */
+class AddOnBase
+{
+protected:
+
+  /**
+   * @brief Constructor
+   */
+  AddOnBase()
+  {
+    mSingleton = this;
+  }
+
+public:
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~AddOnBase() = default;
+
+  /**
+   * @brief Retrieves AddOn info
+   * @param[out] addonInfo AddOnInfo structure to fill by the function
+   */
+  virtual void GetAddOnInfo( Dali::AddOnInfo& addonInfo ) = 0;
+
+  /**
+   * @brief Returns a dispatch table for global functions.
+   * @return Valid dispatch table object or nullptr
+   */
+  virtual DispatchTable* GetGlobalDispatchTable() = 0;
+
+  /**
+   * @brief Returns a dispatch table for instance functions
+   * @return Valid dispatch table object or nullptr
+   */
+  virtual DispatchTable* GetInstanceDispatchTable() = 0;
+
+  /**
+   * @brief OnStart event.
+   * It's optional and should be implemented by the AddOn when it's required to handle the event.
+   */
+  virtual void OnStart() {}
+
+  /**
+   * @brief OnResume event.
+   * It's optional and should be implemented by the AddOn when it's required to handle the event.
+   */
+  virtual void OnResume() {}
+
+  /**
+   * @brief OnPause event.
+   * It's optional and should be implemented by the AddOn when it's required to handle the event.
+   */
+  virtual void OnPause() {}
+
+  /**
+   * @brief OnStop event.
+   * It's optional and should be implemented by the AddOn when it's required to handle the event.
+   */
+  virtual void OnStop() {}
+
+  /**
+   * @brief Getter of static singleton
+   * @return Returns valid singleton pointer
+   */
+  static AddOnBase* Get()
+  {
+    return mSingleton;
+  }
+
+private:
+
+  static AddOnBase* mSingleton;
+};
+
+/**
+ * @brief The function is automatically added to the AddOn code
+ * with use of REGISTER_ADDON_CLASS() macro
+ * @return The valid pointer to the AddOnBase interface
+ */
+extern Dali::AddOns::AddOnBase* CreateAddOn();
+
+/**
+ * Fills AddOnInfo structure.
+ * @param[out] info Reference to AddOnInfo structure
+ */
+template<class T>
+void GetAddOnInfo( Dali::AddOnInfo& info )
+{
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+  addon->GetAddOnInfo( info );
+}
+
+/**
+ * Returns pointer to AddOn's global function
+ * @param[in] funcname Name of function
+ * @return Valid pointer or nullptr if function not found.
+ */
+template<class T>
+void* GetGlobalProc( const char* funcname )
+{
+  if( !funcname )
+  {
+    return nullptr;
+  }
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+
+  // AddOn must be initialised up to this point!
+  if( !addon )
+  {
+    return nullptr;
+  }
+
+  static Dali::AddOns::DispatchTable* globalDispatchTable = addon->GetGlobalDispatchTable();
+
+  if( globalDispatchTable )
+  {
+    return globalDispatchTable->Find( funcname );
+  }
+  return nullptr;
+}
+
+/**
+ * Returns pointer to AddOn's instance function
+ * @param[in] funcname Name of function
+ * @return Valid pointer or nullptr if function not found.
+ */
+template<class T>
+void* GetInstanceProc( const char* funcname )
+{
+  if( !funcname )
+  {
+    return nullptr;
+  }
+
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+
+  // AddOn must be initialised up to this point!
+  if( !addon )
+  {
+    return nullptr;
+  }
+
+  static Dali::AddOns::DispatchTable* instanceDispatchTable = addon->GetInstanceDispatchTable();
+
+  if( instanceDispatchTable )
+  {
+    return instanceDispatchTable->Find( funcname );
+  }
+  return nullptr;
+}
+
+/**
+ * Lifecycle functions to export.
+ * They will be instantiated only if macro REGISTER_ADDON_CLASS is used
+ */
+template<class T>
+void OnStart()
+{
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+  addon->OnStart();
+}
+
+template<class T>
+void OnPause()
+{
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+  addon->OnPause();
+}
+
+template<class T>
+void OnResume()
+{
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+  addon->OnResume();
+}
+
+template<class T>
+void OnStop()
+{
+  auto* addon = Dali::AddOns::AddOnBase::Get();
+  addon->OnStop();
+}
+
+/**
+ * @brief AddOn library internal constructor.
+ */
+inline void AddOnConstructorInternal()
+{
+  auto* addon = Dali::AddOns::CreateAddOn();
+
+  Dali::AddOnInfo info{};
+  addon->GetAddOnInfo( info );
+
+  // Generate dispatch tables
+  addon->GetGlobalDispatchTable();
+  addon->GetInstanceDispatchTable();
+
+  // Bind basic functions
+  Dali::AddOnDispatchTable table;
+  table.name = info.name;
+  table.GetAddOnInfo = GetAddOnInfo<void>;
+  table.GetGlobalProc = GetGlobalProc<void>;
+  table.GetInstanceProc = GetInstanceProc<void>;
+  table.OnStart = OnStart<void>;
+  table.OnStop = OnStop<void>;
+  table.OnResume = OnResume<void>;
+  table.OnPause = OnPause<void>;
+
+  // Register dispatch table
+  Dali::Integration::AddOnManager::Get()->RegisterAddOnDispatchTable( &table );
+}
+
+} // namespace AddOns
+} // namespace Dali
+
+/**
+ * Macro must be used in order to auto-register AddOn with the AddOnManager.
+ * Note: The macro requires GCC/Clang compiler and currently only Linux-based environment
+ * is supported.
+ */
+#define REGISTER_ADDON_CLASS( ADDON_CLASS_WITH_FULL_NAMESPACE ) \
+namespace Dali { namespace AddOns { \
+__attribute__((constructor)) void AddOnConstructor() { \
+  AddOnConstructorInternal();\
+}\
+AddOnBase* AddOnBase::mSingleton = nullptr; \
+AddOnBase* CreateAddOn() \
+{\
+  return new ADDON_CLASS_WITH_FULL_NAMESPACE();\
+}\
+}}
+
+#endif // DALI_ADDON_BASE_H
diff --git a/dali/devel-api/addons/addon-dispatch-table.h b/dali/devel-api/addons/addon-dispatch-table.h
new file mode 100644 (file)
index 0000000..1699a5c
--- /dev/null
@@ -0,0 +1,139 @@
+#ifndef DALI_ADDON_DISPATCH_TABLE_H
+#define DALI_ADDON_DISPATCH_TABLE_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.
+ *
+ */
+
+namespace Dali
+{
+namespace AddOns
+{
+
+/**
+ * DispatchTable contains essential function pointers
+ * needed to register the AddOn with AddOnManager.
+ */
+struct DispatchTable
+{
+  typedef void* FunctionPointer;
+  /**
+   * Struct Entry
+   * The structure contains details of a single function binding
+   */
+  struct Entry
+  {
+    /**
+     * @brief Assignment operator. Converts function pointer into void*.
+     * @param[in] funcPtr Function pointer
+     * @return Reference to self
+     */
+    template<class T>
+    Entry &operator=(T funcPtr)
+    {
+      functionPtr = reinterpret_cast<void *>( funcPtr );
+      if (index < 0)
+      {
+        index = int32_t(table->entries.size());
+        table->entries.emplace_back(*this);
+      }
+      else
+      {
+        table->entries[index].functionPtr = reinterpret_cast<void *>( funcPtr );
+      }
+      return *this;
+    }
+
+    std::string    functionName{};        ///< Name of function
+    void*          functionPtr{nullptr};  ///< Function pointer
+    DispatchTable* table{nullptr};        ///< DispatchTable associated with entry
+    int32_t        index = -1;            ///< Index within the dispatch table
+  };
+
+  /**
+   * @brief Accessor of an indexed entry from the dispatch table
+   * @param[in] functionName name of function
+   * @return Returns Entry object
+   */
+  Entry operator[](const char *functionName)
+  {
+    auto iter = std::find_if(entries.begin(), entries.end(), [functionName](Entry &entry)
+    {
+      if (entry.functionName == functionName)
+      {
+        return true;
+      }
+      return false;
+    });
+    if (iter == entries.end())
+    {
+      Entry retval;
+      retval.table        = this;
+      retval.functionName = functionName;
+      return retval;
+    }
+    return Entry(*iter);
+  }
+
+  /**
+   * @brief Tests whether cache is empty
+   * @return True if empty, False otherwise
+   */
+  bool Empty() const
+  {
+    return entries.empty();
+  }
+
+  /**
+   * @brief Returns size of cache
+   * @return Size of cache
+   */
+  uint32_t Size() const
+  {
+    return entries.size();
+  }
+
+  /**
+   * @brief Function pointer lookup
+   * @param[in] funcName Name of function
+   * @return valid pointer or nullptr if function not found
+   */
+  FunctionPointer Find(const char *funcName)
+  {
+    if (entries.empty())
+    {
+      return nullptr;
+    }
+
+    auto iter = std::find_if(entries.begin(), entries.end(), [funcName, entries = &this->entries](Entry &entry)
+    {
+      return (entry.functionName == funcName);
+    });
+    if (iter != entries.end())
+    {
+      return iter->functionPtr;
+    }
+    return nullptr;
+  }
+
+  std::vector <Entry> entries;
+};
+
+} // namespace AddOns
+
+} // namespace Dali
+
+#endif // DALI_ADDON_DISPATCH_TABLE_H
diff --git a/dali/devel-api/common/addon-binder.cpp b/dali/devel-api/common/addon-binder.cpp
new file mode 100644 (file)
index 0000000..3f56e79
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 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 "addon-binder.h"
+
+namespace Dali
+{
+
+namespace AddOn
+{
+
+Dali::Integration::AddOnManager* AddOnBinder::mAddOnManager = nullptr;
+
+} // namespace AddOn
+
+} // namespace Dali
diff --git a/dali/devel-api/common/addon-binder.h b/dali/devel-api/common/addon-binder.h
new file mode 100644 (file)
index 0000000..b43a90e
--- /dev/null
@@ -0,0 +1,177 @@
+#ifndef DALI_ADDON_BINDER_H
+#define DALI_ADDON_BINDER_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.
+ */
+
+#include <dali/integration-api/addon-manager.h>
+
+namespace Dali
+{
+namespace AddOn
+{
+
+/**
+ * Class automates binding an AddOn interface.
+ *
+ * This interface is meant to be used as a base
+ * for classes that use function binding macros.
+ *
+ * Sample use:
+ * \code{.cpp}
+ * #include <dali/devel-api/common/addon-binder.h>
+ * struct AddOnImageLoader : public Dali::DevelAddOn::AddOnBinder
+ * {
+ *   // Constructor requires the AddOn name and optional version (0 - any version accepted)
+ *   AddOnImageLoader( const char* addonname ) : Dali::DevelAddOn::AddOnBinder( addonname, 0 ) {}
+ *
+ *   ~AddOnImageLoader() = default;
+ *
+ *   // Binding block
+ *   // Using ADDON_BIND_FUNCTION() macro requires function name (resolved by the AddOn) and function
+ *   // signature. It will generate member function with correct binding.
+ *
+ *   // LoadBitmap
+ *   ADDON_BIND_FUNCTION( LoadBitmap, bool(const Dali::ImageLoader::Input&, Dali::Devel::PixelBuffer&) );
+ *
+ *   // LoadHeader
+ *   ADDON_BIND_FUNCTION( LoadHeader, bool(const Dali::ImageLoader::Input&, unsigned int&, unsigned int&) );
+ *
+ *   // GetFormatExtension
+ *   ADDON_BIND_FUNCTION( GetFormatExtension, const char*() );
+ *
+ *   // GetFormatMagicNumber
+ *   ADDON_BIND_FUNCTION( GetFormatMagicNumber, uint16_t() );
+ *
+ *   // GetBitmapProfile
+ *   ADDON_BIND_FUNCTION( GetBitmapProfile, Bitmap::Profile() );
+ *  };
+ *  \endcode
+ */
+
+class AddOnBinder
+{
+public:
+
+  /**
+   * @brief Constructor. Opens an AddOn and creates interface
+   * @param[in] addonName Name of AddOn
+   * @param[in] version Version of AddOn
+   */
+  explicit AddOnBinder( const char* addonName, uint32_t version = 0u )
+  {
+    mAddOnManager = Dali::Integration::AddOnManager::Get();
+    if (mAddOnManager)
+    {
+      mAddOnHandle = mAddOnManager->GetAddOn(addonName);
+      if (mAddOnHandle)
+      {
+        mAddOnManager->GetAddOnInfo(addonName, mAddOnInfo);
+      }
+    }
+  }
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~AddOnBinder() = default;
+
+  /**
+   * @brief Looks up and converts c-style void* function into pointer of type T
+   * @param[in] funcName name of the function
+   * @return Returns a new pointer
+   */
+  template<class T>
+  T* ConvertFunction( const std::string& funcName )
+  {
+    if(mAddOnHandle)
+    {
+      auto ptr = mAddOnManager->GetGlobalProc(mAddOnHandle, funcName.c_str());
+      return *reinterpret_cast<T**>(&ptr);
+    }
+    return nullptr;
+  }
+
+  /**
+   * @brief Returns a handle to the AddOn library
+   * @return Handle object
+   */
+  Dali::AddOnLibrary GetHandle()
+  {
+    return mAddOnHandle;
+  }
+
+  /**
+   * @brief Returns pointer to the global AddOn function.
+   * @param[in] name Name of the function
+   * @return Valid pointer or nullptr
+   */
+  void* GetGlobalProc( const char* name )
+  {
+    return mAddOnManager ? mAddOnManager->GetGlobalProc( mAddOnHandle, name ) : nullptr;
+  }
+
+  /**
+   * @brief Returns pointer to the instance AddOn function.
+   * @param[in] name Name of the function
+   * @return Valid pointer or nullptr
+   */
+  void* GetInstanceProc( const char* name )
+  {
+    return mAddOnManager ? mAddOnManager->GetInstanceProc( mAddOnHandle, name ) : nullptr;
+  }
+
+  /**
+   * @brief Tests whether the interface is valid
+   * @return True if valid, false otherwise
+   */
+  virtual bool IsValid()
+  {
+    return GetHandle() != nullptr;
+  }
+
+  /**
+   * @brief Returns AddOn info structure
+   * @return AddOn info structure.
+   */
+  const AddOnInfo& GetAddOnInfo() const
+  {
+    return mAddOnInfo;
+  }
+
+protected:
+
+  static DALI_CORE_API Dali::Integration::AddOnManager* mAddOnManager; ///< Pointer to the AddOn manager
+
+  Dali::AddOnLibrary mAddOnHandle { nullptr }; ///< Handle to the AddOn library
+  Dali::AddOnInfo mAddOnInfo {}; ///< Stored AddOnInfo structure
+};
+
+
+/**
+ * Macro binds function as a member function of the class, for example, the call:
+ *
+ * ADDON_BIND_FUNCTION( SomeAddOnFunction, void(int, char*) );
+ *
+ * will create a std::function object named SomeAddOnFunction and bound to the AddOn library.
+ */
+#define ADDON_BIND_FUNCTION( FUNCNAME, FUNCTYPE ) \
+std::function<FUNCTYPE> FUNCNAME{ConvertFunction<FUNCTYPE>( std::string(#FUNCNAME) )};
+
+} // namespace AddOn
+} // namespace Dali
+
+#endif // DALI_ADDON_BINDER_H
index afe91fc..8c908b8 100644 (file)
@@ -8,6 +8,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/animation/animation-data.cpp
   ${devel_api_src_dir}/animation/animation-devel.cpp
   ${devel_api_src_dir}/animation/path-constrainer.cpp
+  ${devel_api_src_dir}/common/addon-binder.cpp
   ${devel_api_src_dir}/common/hash.cpp
   ${devel_api_src_dir}/common/singleton-service.cpp
   ${devel_api_src_dir}/common/stage-devel.cpp
@@ -23,6 +24,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/object/handle-devel.cpp
   ${devel_api_src_dir}/object/csharp-type-registry.cpp
   ${devel_api_src_dir}/rendering/frame-buffer-devel.cpp
+  ${devel_api_src_dir}/rendering/renderer-devel.cpp
   ${devel_api_src_dir}/scripting/scripting.cpp
   ${devel_api_src_dir}/signals/signal-delegate.cpp
   ${devel_api_src_dir}/threading/conditional-wait.cpp
@@ -41,6 +43,10 @@ SET( devel_api_core_actors_header_files
   ${devel_api_src_dir}/actors/camera-actor-devel.h
 )
 
+SET( devel_api_core_addons_header_files
+  ${devel_api_src_dir}/addons/addon-base.h
+  ${devel_api_src_dir}/addons/addon-dispatch-table.h
+)
 
 SET( devel_api_core_animation_header_files
   ${devel_api_src_dir}/animation/animation-data.h
@@ -50,6 +56,7 @@ SET( devel_api_core_animation_header_files
 
 
 SET( devel_api_core_common_header_files
+  ${devel_api_src_dir}/common/addon-binder.h
   ${devel_api_src_dir}/common/bitwise-enum.h
   ${devel_api_src_dir}/common/circular-queue.h
   ${devel_api_src_dir}/common/hash.h
@@ -76,7 +83,6 @@ SET( devel_api_core_events_header_files
 
 SET( devel_api_core_images_header_files
   ${devel_api_src_dir}/images/distance-field.h
-  ${devel_api_src_dir}/images/native-image-interface-extension.h
   ${devel_api_src_dir}/images/pixel-data-devel.h
 )
 
@@ -126,6 +132,7 @@ SET( SOURCES ${SOURCES}
 
 SET( DEVEL_API_HEADERS ${DEVEL_API_HEADERS}
   ${devel_api_core_actors_header_files}
+  ${devel_api_core_addons_header_files}
   ${devel_api_core_animation_header_files}
   ${devel_api_core_common_header_files}
   ${devel_api_core_events_header_files}
diff --git a/dali/devel-api/images/native-image-interface-extension.h b/dali/devel-api/images/native-image-interface-extension.h
deleted file mode 100644 (file)
index 2ca3d9a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_EXTENSION_H
-#define DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_EXTENSION_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.
- *
- */
-
-#include <dali/public-api/images/native-image-interface.h>
-
-namespace Dali
-{
-
-/**
- * @brief Extension abstract interface to provide platform-specific support for handling image data.
- *
- */
-class NativeImageInterface::Extension
-{
-public:
-
-  class Extension2; ///< Forward declare future extension interface
-
-  /**
-   * @brief Get custom fragment prefix for rendering native image.
-   *
-   * @return Custom fragment prefix code as string.
-   */
-  virtual const char* GetCustomFragmentPreFix() = 0;
-
-  /**
-   * @brief Get custom sampler type name for rendering native image.
-   *
-   * @return Custom sampler type name.
-   */
-  virtual const char* GetCustomSamplerTypename() = 0;
-
-  /**
-   * @brief Get texture target for binding native image as texture.
-   *
-   * @return Texture target.
-   */
-  virtual int GetEglImageTextureTarget() = 0;
-
-  /**
-   * @brief Retrieve the extension for the interface.
-   *
-   * @return Extension2 pointer if available, NULL otherwise
-   */
-  virtual Extension2* GetExtension2()
-  {
-    return NULL;
-  }
-
-protected:
-
-  /**
-   * @brief Destructor.
-   *
-   */
-  virtual ~Extension()
-  {
-  }
-
-};
-
-} // namespace Dali
-
-#endif // DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_EXTENSION_H
diff --git a/dali/devel-api/rendering/renderer-devel.cpp b/dali/devel-api/rendering/renderer-devel.cpp
new file mode 100644 (file)
index 0000000..0d987cb
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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/internal/event/rendering/renderer-impl.h>
+
+namespace Dali
+{
+
+namespace DevelRenderer
+{
+
+void AddDrawCommand( Dali::Renderer renderer, const DrawCommand& drawCommand )
+{
+  auto& impl = GetImplementation( renderer );
+  impl.AddDrawCommand( drawCommand );
+}
+
+} // DevelRenderer
+} // Dali
\ No newline at end of file
index 02292ab..8fb2032 100644 (file)
@@ -27,6 +27,45 @@ namespace Dali
 namespace DevelRenderer
 {
 
+/**
+ * The index of render queue used by the DrawCommand
+ */
+using RenderQueueIndex = uint32_t;
+
+constexpr RenderQueueIndex RENDER_QUEUE_OPAQUE = 0; ///< Queue for opaque elements
+constexpr RenderQueueIndex RENDER_QUEUE_TRANSPARENT = 1; ///<Queue for transparent elements
+constexpr RenderQueueIndex RENDER_QUEUE_MAX = 2;
+
+/**
+ * Enum describing way of rendering the primitives (indexed draw, array draw)
+ */
+enum class DrawType
+{
+  INDEXED,
+  ARRAY,
+};
+
+/**
+ * Draw command can be attached to the Dali::Renderer and override the default
+ * rendering functionality. Renderer may have several DrawCommands attached to it
+ * and the will be executed sequentially in the order of the 'queue' index.
+ */
+struct DrawCommand
+{
+  DrawType         drawType; ///< Type of drawing (indexed, array)
+  uint32_t         firstIndex ; ///< First index into the geometry array
+  uint32_t         elementCount; ///< Number of elements to draw
+  RenderQueueIndex queue; ///< Queue index
+};
+
+/**
+ * @brief Adds a draw command to the renderer
+ * Once the draw command is added, the default Renderer's behaviour is overriden.
+ * @param[in] renderer a valid Renderer object
+ * @param[in] drawCommand Valid DrawCommand to add to the Renderer
+ */
+DALI_CORE_API void AddDrawCommand( Dali::Renderer renderer, const DrawCommand& drawCommand );
+
 namespace Property
 {
 
@@ -74,6 +113,8 @@ namespace Property
 namespace Rendering
 {
 
+
+
 /**
  * @brief Enumeration for the rendering behavior
  */
diff --git a/dali/integration-api/addon-manager.cpp b/dali/integration-api/addon-manager.cpp
new file mode 100644 (file)
index 0000000..1376386
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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 "addon-manager.h"
+
+namespace Dali
+{
+namespace Integration
+{
+AddOnManager* AddOnManager::mSingleton = nullptr;
+
+AddOnManager::AddOnManager()
+{
+  mSingleton = this;
+}
+
+AddOnManager::~AddOnManager() = default;
+
+AddOnManager* AddOnManager::Get()
+{
+  return mSingleton;
+}
+}
+}
diff --git a/dali/integration-api/addon-manager.h b/dali/integration-api/addon-manager.h
new file mode 100644 (file)
index 0000000..f957f62
--- /dev/null
@@ -0,0 +1,277 @@
+#ifndef DALI_INTEGRATION_ADDON_MANAGER_H
+#define DALI_INTEGRATION_ADDON_MANAGER_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/public-api/object/base-handle.h>
+
+// EXTERNAL EXCLUDES
+#include <string>
+#include <memory>
+#include <vector>
+#include <functional>
+#include <cstdio>
+
+namespace Dali
+{
+// Type of extensions (may be used internally)
+enum class AddOnType
+{
+  GENERIC,
+  IMAGE_LOADER
+};
+
+/**
+ * @brief Helper function building the version number as 32-bit integer.
+ * The return value should be used to encode AddOnInfo::version field.
+ *
+ * @param[in] maj Major version number
+ * @param[in] min Minor version number
+ * @param[in] rev Revision version number
+ * @return returns 32-bit version number
+ */
+constexpr uint32_t DALI_ADDON_VERSION( uint32_t maj, uint32_t min, uint32_t rev )
+{
+  return ((maj&0xff) << 24) | ((min & 0xfff) << 16);
+}
+
+/**
+ * Structure describes AddOn details
+ */
+struct AddOnInfo
+{
+  AddOnType type;        /// may be use in order to classify extension
+  void* next;           /// holds pointer to additional data-structures
+
+  std::string name;     /// Name of the extension
+  uint32_t    version;
+
+  /**
+   * Structure contains details of build
+   */
+  struct BuildInfo
+  {
+    uint32_t libCoreVersion;
+    uint32_t libAdaptorVersion;
+    uint32_t libToolkitVersion;
+  } buildInfo;
+};
+
+/**
+ * The structure contains essential function pointers which AddOnManager
+ * requires in order to use AddOns.
+ */
+struct AddOnDispatchTable
+{
+  std::string name;
+  void (*GetAddOnInfo)( Dali::AddOnInfo&) = nullptr;
+  void*(*GetGlobalProc)(const char*) = nullptr;
+  void*(*GetInstanceProc)(const char*) = nullptr;
+
+  // Lifecycle callbacks
+  void(*OnStart)() = nullptr;
+  void(*OnResume)() = nullptr;
+  void(*OnPause)() = nullptr;
+  void(*OnStop)() = nullptr;
+};
+
+/**
+ * The AddOnLibrary type represents fully opaque object which hides
+ * the actual handle to the library and other related data.
+ */
+typedef void* AddOnLibrary;
+
+namespace Integration
+{
+/**
+ * AddOnManager class
+ *
+ * Handles DALi AddOn support. The object of AddOnManager exists as a singleton and
+ * is created by the Adaptor. The AddOnManager is used by:
+ *
+ * 1) Application - query the AddOns and obtain AddOn interfaces
+ * 2) DALi - handling lifecycle events
+ * 3) AddOn - self-registering the AddOn dispatch table
+ *
+ * It is up to the implementation how the AddOn libraries are enumerated and opened. Any
+ * caching (functions, open libraries) must be handled by the implementation.
+ */
+class DALI_CORE_API AddOnManager
+{
+protected:
+  /**
+   * @brief Constructor, initialised by the Adaptor
+   */
+  AddOnManager();
+
+public:
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~AddOnManager();
+
+  // Functions called by the application
+public:
+  /**
+   * @brief Retrieves list of the available AddOns
+   * @return List of AddOn names
+   */
+  virtual std::vector<std::string> EnumerateAddOns() = 0;
+
+  /**
+   * @brief Returns AddOnInfo structure for specified AddOn name
+   * @param[in] name Name of AddOn
+   * @param[out]] info Output reference
+   * @return True on success, False if extension info cannot be retrieved
+   */
+  virtual bool GetAddOnInfo(const std::string& name, AddOnInfo& info ) = 0;
+
+  /**
+   * @brief Loads and initialises specified extensions
+   * @param[in] extensionNames Array of extension names
+   * @return vector of initialised extension handles
+   */
+  virtual std::vector<AddOnLibrary> LoadAddOns( const std::vector<std::string>& addonNames ) = 0;
+
+  /**
+   * @brief Loads AddOn with specified name
+   * @param[in] addOnName Name of AddOn to be acquired
+   * @return Returns a valid handle or nullptr
+   */
+  inline AddOnLibrary GetAddOn( const std::string& addonName )
+  {
+    return LoadAddOns( { addonName } )[0];
+  }
+
+  /**
+   * @brief Returns AddOn global function pointer
+   * @param[in] addOnLibrary valid AddOn library object
+   * @param[in] procName Name of the function to retrieve
+   * @return Pointer to the function or null if function doesn't exist
+   */
+  virtual void* GetGlobalProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) = 0;
+
+  /**
+   * @brief Returns addon instance function pointer
+   * @param[in] addOnLibrary valid AddOn library object
+   * @param[in] procName Name of the function to retrieve
+   * @return Pointer to the function or null if function doesn't exist
+   */
+  virtual void* GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName ) = 0;
+
+  /**
+   * @brief Returns addon global function of specified type
+   * @param[in] addOnLibrary valid AddOn library object
+   * @param[in] procName Name of the function to retrieve
+   * @return std::function object or null if function doesn't exist
+   */
+  template<class T>
+  DALI_INTERNAL std::function<T> GetGlobalProc( const Dali::AddOnLibrary& addonlibrary, const char* procName )
+  {
+    auto ptr = GetGlobalProc( addonlibrary, procName );
+    if( ptr )
+    {
+      return std::function<T>( *reinterpret_cast<T**>(&ptr) );
+    }
+    return {};
+  };
+
+  /**
+   * @brief Returns AddOn instance function of specified type
+   * @param[in] addOnLibrary valid AddOn library object
+   * @param[in] procName Name of the function to retrieve
+   * @return std::function object or null if function doesn't exist
+   */
+  template<class T>
+  DALI_INTERNAL std::function<T> GetInstanceProc( const Dali::AddOnLibrary& addOnLibrary, const char* procName )
+  {
+    auto ptr = GetInstanceProc( addOnLibrary, procName );
+    if( ptr )
+    {
+      return std::function<T>( *reinterpret_cast<T**>(&ptr) );
+    }
+    return {};
+  };
+
+  /**
+   * @brief Invokes global function by name
+   * @param[in] addOnLibrary valid AddOn library object
+   * @param[in] functionName Name of function to be called
+   * @param args[in] Arguments
+   * @return Result of called function
+   */
+  template<class R, class... Args>
+  DALI_INTERNAL R InvokeGlobalProc( AddOnLibrary addOnLibrary, const char* functionName, Args&&... args)
+  {
+    return std::move(GetGlobalProc<R(Args...)>( addOnLibrary, functionName )( args... ));
+  }
+
+  // Lifecycle events, functions are called by the Adaptor
+public:
+
+  /**
+   * @brief Lifecycle pause function
+   */
+  virtual void Pause() = 0;
+
+  /**
+   * @brief Lifecycle resume function
+   */
+  virtual void Resume() = 0;
+
+  /**
+   * @brief Lifecycle start function
+   */
+  virtual void Start() = 0;
+
+  /**
+   * @brief Lifecycle stop function
+   */
+  virtual void Stop() = 0;
+
+  // Functions called by the AddOn
+public:
+
+  /**
+   * @brief Registers the dispatch table with AddOnManager.
+   *
+   * The function must be called by the AddOn in order to self-register and add
+   * the dispatch table. The platform-dependent implementation must override it
+   * in order to store the dispatch table. The way the dispatch table is stored
+   * depends on the implementation.
+   *
+   * @param[in] dispatchTable Pointer to the valid dispatch table
+   */
+  virtual void RegisterAddOnDispatchTable( const AddOnDispatchTable* dispatchTable ) = 0;
+
+  /**
+   * @brief Retrieves AddOnManager singleton
+   * @return pointer to the AddOnManager
+   */
+  static AddOnManager* Get();
+
+protected:
+
+  static AddOnManager* mSingleton; ///< Singleton storing an instance of AddOnManager
+};
+} // namespace Integration
+} // namespace Dali
+
+#endif // DALI_INTEGRATION_ADDON_MANAGER
index 940771c..f5ffa3c 100644 (file)
@@ -3,6 +3,7 @@ SET( platform_abstraction_src_dir ${ROOT_SRC_DIR}/dali/integration-api )
 
 # Add platform abstraction source files here
 SET( platform_abstraction_src_files
+   ${platform_abstraction_src_dir}/addon-manager.cpp
    ${platform_abstraction_src_dir}/bitmap.cpp
    ${platform_abstraction_src_dir}/core.cpp
    ${platform_abstraction_src_dir}/debug.cpp
@@ -24,6 +25,7 @@ SET( platform_abstraction_src_files
 
 
 SET( platform_abstraction_header_files
+   ${platform_abstraction_src_dir}/addon-manager.h
    ${platform_abstraction_src_dir}/core.h
    ${platform_abstraction_src_dir}/core-enumerations.h
    ${platform_abstraction_src_dir}/context-notifier.h
index 65e9ee2..85d6034 100644 (file)
@@ -220,6 +220,7 @@ DALI_PROPERTY( "connectedToScene",          BOOLEAN,  false, false, false, Dali:
 DALI_PROPERTY( "keyboardFocusable",         BOOLEAN,  true,  false, false, Dali::Actor::Property::KEYBOARD_FOCUSABLE )
 DALI_PROPERTY( "siblingOrder",              INTEGER,  true,  false, false, Dali::DevelActor::Property::SIBLING_ORDER )
 DALI_PROPERTY( "updateSizeHint",            VECTOR2,  true,  false, false, Dali::DevelActor::Property::UPDATE_SIZE_HINT )
+DALI_PROPERTY( "captureAllTouchAfterStart", BOOLEAN,  true,  false, false, Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START )
 DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties )
 
 // Signals
@@ -2807,6 +2808,16 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       break;
     }
 
+    case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
+    {
+      bool boolValue = false;
+      if ( property.Get( boolValue ) )
+      {
+        mCaptureAllTouchAfterStart = boolValue;
+      }
+      break;
+    }
+
     default:
     {
       // this can happen in the case of a non-animatable default property so just do nothing
@@ -3939,6 +3950,12 @@ bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& valu
       break;
     }
 
+    case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
+    {
+      value = mCaptureAllTouchAfterStart;
+      break;
+    }
+
     default:
     {
       // Must be a scene-graph only property
old mode 100755 (executable)
new mode 100644 (file)
index 4e57518..0adfa39
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ACTOR_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.
@@ -1374,6 +1374,15 @@ public:
    */
   bool IsHittable() const;
 
+  /**
+   * Query whether the actor captures all touch after it starts even if touch leaves its boundary.
+   * @return true, if it captures all touch after start
+   */
+  bool CapturesAllTouchAfterStart() const
+  {
+    return mCaptureAllTouchAfterStart;
+  }
+
   // Gestures
 
   /**
@@ -2017,6 +2026,7 @@ protected:
   bool mPositionUsesAnchorPoint                    : 1; ///< Cached: Whether the position uses the anchor point or not.
   bool mVisible                                    : 1; ///< Cached: Whether the actor is visible or not.
   bool mInheritLayoutDirection                     : 1; ///< Whether the actor inherits the layout direction from parent.
+  bool mCaptureAllTouchAfterStart                  : 1; ///< Whether the actor should capture all touch after touch starts even if the motion moves outside of the actor area.
   LayoutDirection::Type mLayoutDirection           : 2; ///< Layout direction, Left to Right or Right to Left.
   DrawMode::Type mDrawMode                         : 3; ///< Cached: How the actor and its children should be drawn
   ColorMode mColorMode                             : 3; ///< Cached: Determines whether mWorldColor is inherited
index 97c15a2..cc08da8 100644 (file)
@@ -147,12 +147,55 @@ Dali::Actor EmitTouchSignals( Actor* actor, RenderTask& renderTask, const TouchE
   return consumingActor;
 }
 
+/**
+ * @brief Parses the primary touch point by performing a hit-test if necessary
+ *
+ * @param[out] hitTestResults The hit test results are put into this variable
+ * @param[in/out] capturingTouchActorObserver The observer for the capturing touch actor member
+ * @param[in] lastRenderTask The last render task member
+ * @param[in] currentPoint The current point information
+ * @param[in] scene The scene that this touch is related to
+ */
+void ParsePrimaryTouchPoint(
+    HitTestAlgorithm::Results& hitTestResults,
+    ActorObserver& capturingTouchActorObserver,
+    const RenderTaskPtr& lastRenderTask,
+    const Integration::Point& currentPoint,
+    const Internal::Scene& scene )
+{
+  Actor* capturingTouchActor = capturingTouchActorObserver.GetActor();
+
+  // We only set the capturing touch actor when the first touch-started actor captures all touch so if it's set, just use it
+  if( capturingTouchActor && lastRenderTask )
+  {
+    hitTestResults.actor = Dali::Actor( capturingTouchActor );
+    hitTestResults.renderTask = lastRenderTask;
+    const Vector2& screenPosition = currentPoint.GetScreenPosition();
+    capturingTouchActor->ScreenToLocal( *lastRenderTask, hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y, screenPosition.x, screenPosition.y );
+  }
+  else
+  {
+    HitTestAlgorithm::HitTest( scene.GetSize(), scene.GetRenderTaskList(), scene.GetLayerList(), currentPoint.GetScreenPosition(), hitTestResults );
+
+    if( currentPoint.GetState() == PointState::STARTED && hitTestResults.actor )
+    {
+      // If we've just started touch, then check whether the actor has requested to capture all touch events
+      Actor* hitActor = &GetImplementation( hitTestResults.actor );
+      if( hitActor->CapturesAllTouchAfterStart() )
+      {
+        capturingTouchActorObserver.SetActor( hitActor );
+      }
+    }
+  }
+}
+
 } // unnamed namespace
 
 TouchEventProcessor::TouchEventProcessor( Scene& scene )
 : mScene( scene ),
   mLastPrimaryHitActor( MakeCallback( this, &TouchEventProcessor::OnObservedActorDisconnected ) ),
   mLastConsumedActor(),
+  mCapturingTouchActor(),
   mTouchDownConsumedActor(),
   mLastRenderTask()
 {
@@ -212,9 +255,10 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
       AllocAndEmitTouchSignals( event.time, touchDownConsumedActorHandle, currentPoint );
     }
 
-    mLastPrimaryHitActor.SetActor( NULL );
-    mLastConsumedActor.SetActor( NULL );
-    mTouchDownConsumedActor.SetActor( NULL );
+    mLastPrimaryHitActor.SetActor( nullptr );
+    mLastConsumedActor.SetActor( nullptr );
+    mCapturingTouchActor.SetActor( nullptr );
+    mTouchDownConsumedActor.SetActor( nullptr );
     mLastRenderTask.Reset();
 
     currentPoint.SetHitActor( Dali::Actor() );
@@ -239,13 +283,25 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   DALI_LOG_INFO( gLogFilter, Debug::General, "Point(s): %d\n", event.GetPointCount() );
 
   RenderTaskPtr currentRenderTask;
+  bool firstPointParsed = false;
 
-  for ( Integration::PointContainerConstIterator iter = event.points.begin(), beginIter = event.points.begin(), endIter = event.points.end(); iter != endIter; ++iter )
+  for ( auto&& currentPoint : event.points )
   {
     HitTestAlgorithm::Results hitTestResults;
-    HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), iter->GetScreenPosition(), hitTestResults );
+    if( !firstPointParsed )
+    {
+      firstPointParsed = true;
+      ParsePrimaryTouchPoint( hitTestResults, mCapturingTouchActor, mLastRenderTask, currentPoint, mScene );
+
+      // Only set the currentRenderTask for the primary hit actor.
+      currentRenderTask = hitTestResults.renderTask;
+    }
+    else
+    {
+      HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), currentPoint.GetScreenPosition(), hitTestResults );
+    }
 
-    Integration::Point newPoint( *iter );
+    Integration::Point newPoint( currentPoint );
     newPoint.SetHitActor( hitTestResults.actor );
     newPoint.SetLocalPosition( hitTestResults.actorCoordinates );
 
@@ -253,16 +309,11 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
     touchData->AddPoint( newPoint );
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
-                   TOUCH_POINT_STATE[iter->GetState()], iter->GetScreenPosition().x, iter->GetScreenPosition().y,
+                   TOUCH_POINT_STATE[currentPoint.GetState()], currentPoint.GetScreenPosition().x, currentPoint.GetScreenPosition().y,
                    ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
                    ( hitTestResults.actor ? hitTestResults.actor.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str() : "" ),
                    hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
 
-    // Only set the currentRenderTask for the primary hit actor.
-    if ( iter == beginIter && hitTestResults.renderTask )
-    {
-      currentRenderTask = hitTestResults.renderTask;
-    }
   }
 
   // 3) Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
@@ -354,8 +405,9 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
 
   if ( primaryPointState == PointState::UP )
   {
-    mLastPrimaryHitActor.SetActor( NULL );
-    mLastConsumedActor.SetActor( NULL );
+    mLastPrimaryHitActor.SetActor( nullptr );
+    mLastConsumedActor.SetActor( nullptr );
+    mCapturingTouchActor.SetActor( nullptr );
     mLastRenderTask.Reset();
   }
   else
@@ -379,8 +431,9 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
     }
     else
     {
-      mLastPrimaryHitActor.SetActor( NULL );
-      mLastConsumedActor.SetActor( NULL );
+      mLastPrimaryHitActor.SetActor( nullptr );
+      mLastConsumedActor.SetActor( nullptr );
+      mCapturingTouchActor.SetActor( nullptr );
       mLastRenderTask.Reset();
     }
   }
index 61edcca..9306e6f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_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.
@@ -91,6 +91,7 @@ private:
 
   ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
   ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
+  ActorObserver mCapturingTouchActor; ///< Stored the actor that captures touch
   ActorObserver mTouchDownConsumedActor; ///< Stores the touch-down consumed actor
   RenderTaskPtr mLastRenderTask; ///< The RenderTask used for the last hit actor
 };
index 7071a67..c560bf4 100644 (file)
@@ -1095,6 +1095,24 @@ bool Renderer::GetCurrentPropertyValue( Property::Index index, Property::Value&
   return valueSet;
 }
 
+void Renderer::AddDrawCommand( const Dali::DevelRenderer::DrawCommand& command )
+{
+  if(!mDrawCommands.capacity())
+  {
+    mDrawCommands.reserve(8);
+  }
+
+  mDrawCommands.emplace_back( command );
+
+  Dali::Internal::SceneGraph::SetDrawCommandsMessage( GetEventThreadServices(),
+                                                      GetRendererSceneObject(),
+                                                      mDrawCommands.data(),
+                                                      uint32_t(mDrawCommands.size())
+
+  );
+}
+
+
 } // namespace Internal
 
 } // namespace Dali
index 3817bd4..3a36186 100755 (executable)
@@ -200,6 +200,14 @@ public: // Default property extensions from Object
    */
   virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
 
+  /**
+   * @brief Adds a draw command to the Renderer.
+   * DrawCommands override Renderer's default behaviour.
+   *
+   * @param[in] command Valid reference to a DrawCommand objects
+   */
+  void AddDrawCommand( const Dali::DevelRenderer::DrawCommand& command );
+
 private: // implementation
 
   /**
@@ -269,6 +277,8 @@ private: // data
   DepthTestMode::Type                 mDepthTestMode:3;            ///< Local copy of the depth test mode
   DevelRenderer::Rendering::Type      mRenderingBehavior:2;        ///< The rendering behavior
   bool                                mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
+
+  std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands;     ///< list of draw commands
 };
 
 } // namespace Internal
index cfd1f92..744ae86 100644 (file)
@@ -440,6 +440,7 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
   for( uint32_t index = 0u; index < count; ++index )
   {
     const RenderItem& item = renderList.GetItem( index );
+
     DALI_PRINT_RENDER_ITEM( item );
 
     // Set up clipping based on both the Renderer and Actor APIs.
@@ -458,9 +459,18 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList,
         SetupDepthBuffer( item, context, autoDepthTestMode, firstDepthBufferUse );
       }
 
-      // Render the item.
-      item.mRenderer->Render( context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix,
-                              viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures, instruction ); // Added instruction for reflection effect
+      // Depending on whether the renderer has draw commands attached or not the rendering process will
+      // iterate through all the render queues. If there are no draw commands attached, only one
+      // iteration must be done and the default behaviour of the renderer will be executed.
+      // The queues allow to iterate over the same renderer multiple times changing the state of the renderer.
+      // It is similar to the multi-pass rendering.
+      auto const MAX_QUEUE = item.mRenderer->GetDrawCommands().empty() ? 1 : DevelRenderer::RENDER_QUEUE_MAX;
+      for( auto queue = 0u; queue < MAX_QUEUE; ++queue )
+      {
+        // Render the item.
+        item.mRenderer->Render(context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix,
+                               viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures, instruction, queue);
+      }
     }
   }
 }
index 7456616..80449e8 100644 (file)
@@ -174,6 +174,11 @@ void Renderer::SetGeometry( Render::Geometry* geometry )
   mGeometry = geometry;
   mUpdateAttributesLocation = true;
 }
+void Renderer::SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size )
+{
+  mDrawCommands.clear();
+  mDrawCommands.insert( mDrawCommands.end(), pDrawCommands, pDrawCommands+size );
+}
 
 void Renderer::SetBlending( Context& context, bool blend )
 {
@@ -550,8 +555,31 @@ void Renderer::Render( Context& context,
                        const Vector3& size,
                        bool blend,
                        Vector<GLuint>& boundTextures,
-                       const Dali::Internal::SceneGraph::RenderInstruction& instruction )
+                       const Dali::Internal::SceneGraph::RenderInstruction& instruction,
+                       uint32_t queueIndex )
 {
+  // Before doing anything test if the call happens in the right queue
+  if( mDrawCommands.empty() && queueIndex > 0 )
+  {
+    return;
+  }
+
+  // Prepare commands
+  std::vector<DevelRenderer::DrawCommand*> commands;
+  for( auto& cmd : mDrawCommands )
+  {
+    if(cmd.queue == queueIndex)
+    {
+      commands.emplace_back( &cmd );
+    }
+  }
+
+  // Have commands but nothing to be drawn - abort
+  if(!mDrawCommands.empty() && commands.empty())
+  {
+    return;
+  }
+
   // Get the program to use:
   Program* program = mRenderDataProvider->GetShader().GetProgram();
   if( !program )
@@ -589,9 +617,6 @@ void Renderer::Render( Context& context,
     context.CullFace( mFaceCullingMode );
   }
 
-  //Set blending mode
-  SetBlending( context, blend );
-
   // Take the program into use so we can send uniforms to it
   program->Use();
 
@@ -626,12 +651,29 @@ void Renderer::Render( Context& context,
       mUpdateAttributesLocation = false;
     }
 
-    mGeometry->Draw( context,
-                     bufferIndex,
-                     mAttributesLocation,
-                     mIndexedDrawFirstElement,
-                     mIndexedDrawElementsCount );
+    if(mDrawCommands.empty())
+    {
+      SetBlending( context, blend );
 
+      mGeometry->Draw( context,
+                       bufferIndex,
+                       mAttributesLocation,
+                       mIndexedDrawFirstElement,
+                       mIndexedDrawElementsCount );
+    }
+    else
+    {
+      for(auto& cmd : commands )
+      {
+        if(cmd->queue == queueIndex )
+        {
+          //Set blending mode
+          SetBlending(context, cmd->queue == DevelRenderer::RENDER_QUEUE_OPAQUE ? false : blend);
+          mGeometry->Draw(context, bufferIndex, mAttributesLocation,
+                          cmd->firstIndex, cmd->elementCount);
+        }
+      }
+    }
     mUpdated = false;
   }
 }
index fccf372..5f4bbfb 100755 (executable)
@@ -155,6 +155,17 @@ public:
    */
   void SetGeometry( Render::Geometry* geometry );
 
+  void SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size );
+
+  /**
+   * @brief Returns a reference to an array of draw commands
+   * @return Valid array of draw commands (may be empty)
+   */
+  const std::vector<Dali::DevelRenderer::DrawCommand>& GetDrawCommands() const
+  {
+    return mDrawCommands;
+  }
+
   /**
    * Second-phase construction.
    * This is called when the renderer is inside render thread
@@ -366,8 +377,8 @@ public:
                const Vector3& size,
                bool blend,
                Vector<GLuint>& boundTextures,
-               const Dali::Internal::SceneGraph::RenderInstruction& instruction //for reflection effect
-               );
+               const Dali::Internal::SceneGraph::RenderInstruction& instruction,
+               uint32_t queueIndex );
 
   /**
    * Write the renderer's sort attributes to the passed in reference
@@ -471,6 +482,7 @@ private:
   bool                         mUpdated:1;
 
 
+  std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands; // Devel stuff
 };
 
 } // namespace SceneGraph
index 5151dc1..20eb465 100644 (file)
@@ -21,7 +21,7 @@
 #include <math.h>   //floor, log2
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
+
 
 namespace Dali
 {
@@ -708,7 +708,7 @@ void Texture::Destroy( Context& context )
 
     if( mNativeImage )
     {
-      mNativeImage->GlExtensionDestroy();
+      mNativeImage->DestroyResource();
     }
   }
 }
@@ -722,13 +722,9 @@ void Texture::Initialize(Context& context)
 {
   if( mNativeImage )
   {
-    if( mNativeImage->GlExtensionCreate() )
+    if( mNativeImage->CreateResource() )
     {
-      NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
-      if( extension )
-      {
-        mTarget = extension->GetEglImageTextureTarget();
-      }
+      mTarget = mNativeImage->GetTextureTarget();
 
       context.GenTextures( 1, &mId );
       context.BindTexture( mTarget, mId );
@@ -744,7 +740,7 @@ void Texture::Initialize(Context& context)
       if( mNativeImage->TargetTexture() != 0u )
       {
         context.DeleteTextures( 1, &mId );
-        mNativeImage->GlExtensionDestroy();
+        mNativeImage->DestroyResource();
         mId = 0u;
       }
     }
index 78cc111..f826341 100644 (file)
@@ -132,25 +132,26 @@ bool Step::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::Ra
 
 bool Step::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const float propertyValue = value.GetVector2().LengthSquared();
+  const float propertyValue = value.GetVector2().Length();
   return Evaluate( propertyValue, arg );
 }
 
 bool Step::EvalVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  float propertyValue = value.GetVector3().LengthSquared();
+  float propertyValue = value.GetVector3().Length();
   return Evaluate( propertyValue, arg );
 }
 
 bool Step::EvalAndCompareVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  float propertyValue = value.GetVector3().LengthSquared();
+  float propertyValue = value.GetVector3().Length();
   bool result = Evaluate( propertyValue, arg );
   if( result == false )
   {
-    if( ( fabsf( arg[ARGINDEX_FIRST_VALUE] - value.GetVector3().x ) > Math::MACHINE_EPSILON_1 )
-        || ( fabsf( arg[ARGINDEX_SECOND_VALUE] - value.GetVector3().y ) > Math::MACHINE_EPSILON_1 )
-        || ( fabsf( arg[ARGINDEX_THIRD_VALUE] - value.GetVector3().z ) > Math::MACHINE_EPSILON_1 ) )
+    const float step = 1.0f / arg[ARGINDEX_STEP_SIZE];
+    if( ( fabsf( arg[ARGINDEX_FIRST_VALUE] - value.GetVector3().x ) > step )
+        || ( fabsf( arg[ARGINDEX_SECOND_VALUE] - value.GetVector3().y ) > step )
+        || ( fabsf( arg[ARGINDEX_THIRD_VALUE] - value.GetVector3().z ) > step ) )
     {
       result = true;
     }
@@ -163,7 +164,7 @@ bool Step::EvalAndCompareVector3( const Dali::PropertyInput& value, PropertyNoti
 
 bool Step::EvalVector4( const  Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const float propertyValue = value.GetVector4().LengthSquared();
+  const float propertyValue = value.GetVector4().Length();
   return Evaluate( propertyValue, arg );
 }
 
index ad0974b..ffb71a9 100644 (file)
@@ -114,6 +114,7 @@ enum Flags
   RESEND_STENCIL_OPERATION_ON_Z_PASS = 1 << 17,
   RESEND_WRITE_TO_COLOR_BUFFER       = 1 << 18,
   RESEND_SHADER                      = 1 << 19,
+  RESEND_DRAW_COMMANDS               = 1 << 20
 };
 
 } // Anonymous namespace
@@ -223,6 +224,13 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex )
       new (slot) DerivedType( mRenderer, &Render::Renderer::SetGeometry, mGeometry );
     }
 
+    if( mResendFlag & RESEND_DRAW_COMMANDS )
+    {
+      typedef MessageValue2< Render::Renderer, Dali::DevelRenderer::DrawCommand*, uint32_t > DerivedType;
+      uint32_t* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
+      new (slot) DerivedType( mRenderer, &Render::Renderer::SetDrawCommands, mDrawCommands.data(), mDrawCommands.size() );
+    }
+
     if( mResendFlag & RESEND_FACE_CULLING_MODE )
     {
       typedef MessageValue1< Render::Renderer, FaceCullingMode::Type > DerivedType;
@@ -763,6 +771,13 @@ void Renderer::ObservedObjectDestroyed(PropertyOwner& owner)
   }
 }
 
+void Renderer::SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size )
+{
+  mDrawCommands.clear();
+  mDrawCommands.insert( mDrawCommands.end(), pDrawCommands, pDrawCommands+size );
+  mResendFlag |= RESEND_DRAW_COMMANDS;
+}
+
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
index 508b4af..a9c1c1e 100755 (executable)
@@ -432,6 +432,8 @@ public: // From UniformMapDataProvider
    */
   virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const;
 
+  void SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size );
+
 private:
 
   /**
@@ -473,6 +475,8 @@ private:
   bool                         mUniformMapChanged[2];             ///< Records if the uniform map has been altered this frame
   bool                         mPremultipledAlphaEnabled:1;       ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
 
+  std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands;
+
 public:
 
   AnimatableProperty< float >  mOpacity;                          ///< The opacity value
@@ -726,6 +730,17 @@ inline void SetRenderingBehaviorMessage( EventThreadServices& eventThreadService
   new (slot) LocalType( &renderer, &Renderer::SetRenderingBehavior, renderingBehavior );
 }
 
+inline void SetDrawCommandsMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size )
+{
+  typedef MessageValue2< Renderer, Dali::DevelRenderer::DrawCommand*, uint32_t > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+  new (slot) LocalType( &renderer, &Renderer::SetDrawCommands, pDrawCommands, size );
+}
+
+
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
index cf897e9..6df6576 100644 (file)
@@ -65,6 +65,10 @@ Actor& Actor::operator=(const Actor& rhs)
   return *this;
 }
 
+Actor::Actor( Actor&& rhs ) = default;
+
+Actor& Actor::operator=( Actor&& rhs ) = default;
+
 Layer Actor::GetLayer()
 {
   return GetImplementation(*this).GetLayer();
index af2801c..fdc9e9a 100644 (file)
@@ -800,6 +800,23 @@ public:
    */
   Actor& operator=(const Actor& rhs);
 
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the actor to move
+   */
+  Actor( Actor&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the actor to move
+   * @return A reference to this
+   */
+  Actor& operator=( Actor&& rhs );
+
   // Containment
 
   /**
index 816db29..3d26536 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -64,6 +64,10 @@ CustomActor& CustomActor::operator=(const CustomActor& rhs)
   return *this;
 }
 
+CustomActor::CustomActor( CustomActor&& rhs ) = default;
+
+CustomActor& CustomActor::operator=( CustomActor&& rhs ) = default;
+
 CustomActorImpl& CustomActor::GetImplementation()
 {
   Internal::CustomActor& internal = GetImpl(*this);
index 5f31322..8ab1a3a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_CUSTOM_ACTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -115,6 +115,23 @@ public:
    */
   CustomActor& operator=(const CustomActor& rhs);
 
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs The actor to move
+   */
+  CustomActor( CustomActor&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs The actor to move
+   * @return A reference to this
+   */
+  CustomActor& operator=( CustomActor&& rhs );
+
 public: // Not intended for application developers
 
   /**
index 7565b94..38e965d 100644 (file)
@@ -57,6 +57,10 @@ Layer& Layer::operator=(const Layer& rhs)
   return *this;
 }
 
+Layer::Layer( Layer&& rhs ) = default;
+
+Layer& Layer::operator=( Layer&& rhs ) = default;
+
 void Layer::Raise()
 {
   GetImplementation(*this).Raise();
index 3794634..84399f3 100644 (file)
@@ -273,6 +273,23 @@ public:
   Layer& operator=(const Layer& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs The layer to move
+   */
+  Layer( Layer&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs The layer to move
+   * @return A reference to this
+   */
+  Layer& operator=( Layer&& rhs );
+
+  /**
    * @brief Increments the depth of the layer.
    *
    * @SINCE_1_0.0
index bd3ce98..ee344e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,6 +64,10 @@ Animation& Animation::operator=(const Animation& rhs)
   return *this;
 }
 
+Animation::Animation( Animation&& rhs ) = default;
+
+Animation& Animation::operator=( Animation&& rhs ) = default;
+
 void Animation::SetDuration(float durationSeconds)
 {
   GetImplementation(*this).SetDuration(durationSeconds);
index 2fb2606..2fa2db1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ANIMATION_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.
@@ -233,6 +233,23 @@ public:
   Animation& operator=(const Animation& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Animation( Animation&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Animation& operator=( Animation&& rhs );
+
+  /**
    * @brief Sets the duration of an animation.
    *
    * @SINCE_1_0.0
index 6ef76f7..fb5ebaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,6 +64,10 @@ Constraint& Constraint::operator=( const Constraint& rhs )
   return *this;
 }
 
+Constraint::Constraint( Constraint&& rhs ) = default;
+
+Constraint& Constraint::operator=( Constraint&& rhs ) = default;
+
 Constraint Constraint::DownCast( BaseHandle baseHandle )
 {
   return Constraint( dynamic_cast< Dali::Internal::ConstraintBase* >( baseHandle.GetObjectPtr() ) );
index b847a98..170ba8e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_CONSTRAINT_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.
@@ -428,6 +428,23 @@ public:
   Constraint& operator=( const Constraint& rhs );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Constraint( Constraint&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Constraint& operator=( Constraint&& rhs );
+
+  /**
    * @brief Downcasts a handle to Constraint handle.
    *
    * If handle points to a Constraint object, the downcast produces valid handle.
index 34148e9..27d1ee0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -57,6 +57,10 @@ KeyFrames& KeyFrames::operator=(const KeyFrames& rhs)
   return *this;
 }
 
+KeyFrames::KeyFrames( KeyFrames&& rhs ) = default;
+
+KeyFrames& KeyFrames::operator=( KeyFrames&& rhs ) = default;
+
 Property::Type KeyFrames::GetType() const
 {
   return GetImplementation(*this).GetType();
index c38778a..d033dd8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_KEY_FRAMES_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.
@@ -102,6 +102,23 @@ public:
   KeyFrames& operator=(const KeyFrames& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  KeyFrames( KeyFrames&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  KeyFrames& operator=( KeyFrames&& rhs );
+
+  /**
    * @brief Gets the type of the key frame.
    *
    * If no key frames have been added, this returns Property::NONE.
index 8d81f9e..c62a442 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -60,6 +60,10 @@ LinearConstrainer& LinearConstrainer::operator=(const LinearConstrainer& rhs)
   return *this;
 }
 
+LinearConstrainer::LinearConstrainer( LinearConstrainer&& rhs ) = default;
+
+LinearConstrainer& LinearConstrainer::operator=( LinearConstrainer&& rhs ) = default;
+
 void LinearConstrainer::Apply( Dali::Property target, Dali::Property source, const Vector2& range, const Vector2& wrap )
 {
   GetImplementation(*this).Apply( target, source, range, wrap );
index e236837..e5b1834 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_LINEAR_CONSTRAINER_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.
@@ -129,6 +129,23 @@ public:
   LinearConstrainer& operator=(const LinearConstrainer& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  LinearConstrainer( LinearConstrainer&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  LinearConstrainer& operator=( LinearConstrainer&& rhs );
+
+  /**
    * @brief Applies the linear constraint to the target property.
    *
    * @SINCE_1_0.0
index 3dda29c..83159f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,6 +59,10 @@ Path& Path::operator=(const Path& rhs)
   return *this;
 }
 
+Path::Path( Path&& rhs ) = default;
+
+Path& Path::operator=( Path&& rhs ) = default;
+
 void Path::AddPoint(const Vector3& point )
 {
   GetImplementation(*this).AddPoint( point );
index e3e28be..b60254a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PATH_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.
@@ -116,6 +116,23 @@ public:
   Path& operator=(const Path& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Path( Path&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  Path& operator=( Path&& rhs );
+
+  /**
    * @brief Adds an interpolation point.
    *
    * @SINCE_1_0.0
index baad921..648bb4e 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const uint32_t CORE_MAJOR_VERSION = 1;
 const uint32_t CORE_MINOR_VERSION = 9;
-const uint32_t CORE_MICRO_VERSION = 21;
+const uint32_t CORE_MICRO_VERSION = 22;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index ebffdff..606864d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H
-#define DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H
+#ifndef DALI_NATIVE_IMAGE_INTERFACE_H
+#define DALI_NATIVE_IMAGE_INTERFACE_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.
@@ -24,6 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/object/any.h>
 
 namespace Dali
 {
@@ -45,39 +46,39 @@ public:
   class Extension; ///< Forward declare future extension interface
 
   /**
-   * @brief Creates the GL resource for the NativeImage.
+   * @brief Creates the resource for the NativeImage.
    *
    * e.g. For the EglImageKHR extension, this corresponds to calling eglCreateImageKHR().
-   * @SINCE_1_0.0
+   * @SINCE_1_9.23
    * @return false If the initialization fails
-   * @pre There is a GL context for the current thread.
+   * @pre The graphics subsystem has been initialized
    */
-  virtual bool GlExtensionCreate() = 0;
+  virtual bool CreateResource() = 0;
 
   /**
-   * @brief Destroys the GL resource for the NativeImage.
+   * @brief Destroys the resource for the NativeImage.
    *
    * e.g. For the EglImageKHR extension, this corresponds to calling eglDestroyImageKHR().
-   * @SINCE_1_0.0
-   * @pre There is a GL context for the current thread.
+   * @SINCE_1_9.23
+   * @pre The graphics subsystem has been initialized
    */
-  virtual void GlExtensionDestroy() = 0;
+  virtual void DestroyResource() = 0;
 
   /**
    * @brief Uses the NativeImage as a texture for rendering.
    *
    * @SINCE_1_0.0
-   * @return A GL error code
-   * @pre There is a GL context for the current thread.
+   * @return An error code from the graphics subsystem.
+   * @pre The graphics subsystem has been initialized
    */
   virtual uint32_t TargetTexture() = 0;
 
   /**
-   * @brief Called internally for each Bind call for this texture to allow implementation specific operations.
+   * @brief Called internally when the texture is bound in the GPU
    *
    * The correct texture sampler has already been bound before the function gets called.
    * @SINCE_1_0.0
-   * @pre glAbstraction is being used by context in current thread
+   * @pre The graphics subsystem has been initialized
    */
   virtual void PrepareTexture() = 0;
 
@@ -105,6 +106,47 @@ public:
   virtual bool RequiresBlending() const = 0;
 
   /**
+   * @brief Get the texture target for binding native image as texture.
+   *
+   * @SINCE_1_9.23
+   * @return Texture target.
+   */
+  virtual int GetTextureTarget() const = 0;
+
+  /**
+   * @brief Get custom fragment prefix for rendering native image.
+   *
+   * @SINCE_1_9.23
+   * @return Custom fragment prefix code as string.
+   */
+  virtual const char* GetCustomFragmentPrefix() const = 0;
+
+  /**
+   * @brief Get custom sampler type name for rendering native image.
+   *
+   * @SINCE_1_9.23
+   * @return Custom sampler type name.
+   */
+  virtual const char* GetCustomSamplerTypename() const = 0;
+
+  /**
+   * @brief Retrieves the internal native image.
+   *
+   * @SINCE_1_9.23
+   * @return Any object containing the internal native image source
+   */
+  virtual Any GetNativeImageHandle() const = 0;
+
+  /**
+   * @brief Determine if the source for the native image has changed characteristics.
+   *
+   * @SINCE_1_9.23
+   * @return true if the source data has modified any characteristics of the
+   * native image, for example if the size of the buffer has changed.
+   */
+  virtual bool SourceChanged() const = 0;
+
+  /**
    * @brief Retrieves the extension for the interface.
    *
    * @SINCE_1_0.0
@@ -133,11 +175,11 @@ protected:
  * @brief Pointer to Dali::NativeImageInterface.
  * @SINCE_1_0.0
  */
-typedef Dali::IntrusivePtr<NativeImageInterface>  NativeImageInterfacePtr;
+using NativeImageInterfacePtr = Dali::IntrusivePtr<NativeImageInterface>;
 
 /**
  * @}
  */
 } // namespace Dali
 
-#endif // DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H
+#endif // DALI_NATIVE_IMAGE_INTERFACE_H
index b4e7cb3..998dfb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,6 +59,10 @@ PixelData& PixelData::operator=(const PixelData& rhs)
   return *this;
 }
 
+PixelData::PixelData( PixelData&& rhs ) = default;
+
+PixelData& PixelData::operator=( PixelData&& rhs ) = default;
+
 uint32_t PixelData::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
index 13481b4..82401e8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PIXEL_DATA_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.
@@ -110,6 +110,23 @@ public:
   PixelData& operator=(const PixelData& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  PixelData( PixelData&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  PixelData& operator=( PixelData&& rhs );
+
+  /**
    * @brief Gets the width of the buffer in pixels.
    *
    * @SINCE_1_1.43
index 24085ea..8539fa3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -57,6 +57,23 @@ BaseHandle& BaseHandle::operator=(const BaseHandle& rhs)
   return *this;
 }
 
+BaseHandle::BaseHandle( BaseHandle&& rhs )
+: mObjectHandle( rhs.mObjectHandle )
+{
+  rhs.mObjectHandle = nullptr;
+}
+
+BaseHandle& BaseHandle::operator=( BaseHandle&& rhs )
+{
+  if (this != &rhs)
+  {
+    mObjectHandle = rhs.mObjectHandle;
+    rhs.mObjectHandle = nullptr;
+  }
+
+  return *this;
+}
+
 bool BaseHandle::DoAction(const std::string& command, const Property::Map& attributes)
 {
   return GetImplementation(*this).DoAction( command, attributes );
index cca565a..a689502 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_BASE_HANDLE_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.
@@ -111,6 +111,23 @@ public:
   BaseHandle& operator=(const BaseHandle& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  BaseHandle( BaseHandle&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  BaseHandle& operator=( BaseHandle&& rhs );
+
+  /**
    * @brief Connects a void() functor to a specified signal.
    *
    * @SINCE_1_0.0
index 1b48d5c..0844835 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -63,12 +63,15 @@ Handle& Handle::operator=( const Handle& rhs )
   return *this;
 }
 
+Handle::Handle( Handle&& rhs ) = default;
+
+Handle& Handle::operator=( Handle&& rhs ) = default;
+
 Handle Handle::DownCast( BaseHandle handle )
 {
   return Handle( dynamic_cast<Dali::Internal::Object*>(handle.GetObjectPtr()) );
 }
 
-
 bool Handle::Supports( Capability capability ) const
 {
   return GetImplementation(*this).Supports( capability );
index 1e61d6c..02ffd8d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_HANDLE_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.
@@ -129,6 +129,23 @@ public:
   Handle& operator=( const Handle& rhs );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Handle( Handle&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Handle& operator=( Handle&& rhs );
+
+  /**
    * @brief Downcasts to a handle.
    *
    * If not, the returned handle is left uninitialized.
index aea7a2a..9c5af86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -43,6 +43,10 @@ ObjectRegistry& ObjectRegistry::operator=(const ObjectRegistry& rhs)
   return *this;
 }
 
+ObjectRegistry::ObjectRegistry( ObjectRegistry&& rhs ) = default;
+
+ObjectRegistry& ObjectRegistry::operator=( ObjectRegistry&& rhs ) = default;
+
 ObjectRegistry::ObjectCreatedSignalType& ObjectRegistry::ObjectCreatedSignal()
 {
   return GetImplementation(*this).ObjectCreatedSignal();
index 4724b77..29f626d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_OBJECT_REGISTRY_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.
@@ -108,6 +108,23 @@ public:
    */
   ObjectRegistry& operator=(const ObjectRegistry& rhs);
 
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  ObjectRegistry( ObjectRegistry&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  ObjectRegistry& operator=( ObjectRegistry&& rhs );
+
 public: // Signals
 
   /**
index a538a12..7637a6c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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,6 +47,10 @@ PropertyCondition& PropertyCondition::operator=( const PropertyCondition& rhs )
   return *this;
 }
 
+PropertyCondition::PropertyCondition( PropertyCondition&& rhs ) = default;
+
+PropertyCondition& PropertyCondition::operator=( PropertyCondition&& rhs ) = default;
+
 std::size_t PropertyCondition::GetArgumentCount() const
 {
   return GetImplementation(*this).arguments.Count();
index a5ab046..9199370 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PROPERTY_CONDITIONS_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.
@@ -72,6 +72,23 @@ public:
    */
   PropertyCondition& operator=( const PropertyCondition& rhs );
 
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  PropertyCondition( PropertyCondition&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  PropertyCondition& operator=( PropertyCondition&& rhs );
+
 public:
 
   /**
index 81e0538..ff5f275 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,6 +59,10 @@ PropertyNotification& PropertyNotification::operator=(const PropertyNotification
   return *this;
 }
 
+PropertyNotification::PropertyNotification( PropertyNotification&& rhs ) = default;
+
+PropertyNotification& PropertyNotification::operator=( PropertyNotification&& rhs ) = default;
+
 PropertyCondition PropertyNotification::GetCondition()
 {
   return GetImplementation(*this).GetCondition();
index a340049..c0e01c5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PROPERTY_NOTIFICATION_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.
@@ -107,6 +107,23 @@ public:
   PropertyNotification& operator=(const PropertyNotification& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  PropertyNotification( PropertyNotification&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  PropertyNotification& operator=( PropertyNotification&& rhs );
+
+  /**
    * @brief Gets the condition of this notification.
    *
    * @SINCE_1_0.0
index 0578e19..8eceb10 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,6 +45,10 @@ TypeInfo& TypeInfo::operator=(const TypeInfo& rhs)
   return *this;
 }
 
+TypeInfo::TypeInfo( TypeInfo&& rhs ) = default;
+
+TypeInfo& TypeInfo::operator=( TypeInfo&& rhs ) = default;
+
 const std::string& TypeInfo::GetName() const
 {
   return GetImplementation(*this).GetName();
index f2dc401..cbc9aa1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TYPE_INFO_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,6 +122,23 @@ public:
   TypeInfo& operator=(const TypeInfo& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  TypeInfo( TypeInfo&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  TypeInfo& operator=( TypeInfo&& rhs );
+
+  /**
    * @brief Retrieves the type name for this type.
    *
    * @SINCE_1_0.0
index dbe1910..d72c680 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,6 +47,10 @@ TypeRegistry& TypeRegistry::operator=(const TypeRegistry& rhs)
   return *this;
 }
 
+TypeRegistry::TypeRegistry( TypeRegistry&& rhs ) = default;
+
+TypeRegistry& TypeRegistry::operator=( TypeRegistry&& rhs ) = default;
+
 TypeRegistry TypeRegistry::Get()
 {
   return TypeRegistry(Internal::TypeRegistry::Get());
index 4964048..082943c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TYPE_REGISTRY_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.
@@ -135,6 +135,23 @@ public:
   TypeRegistry& operator=(const TypeRegistry& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  TypeRegistry( TypeRegistry&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  TypeRegistry& operator=( TypeRegistry&& rhs );
+
+  /**
    * @brief Gets TypeInfo for a registered type.
    *
    * @SINCE_1_0.0
index cd5fcab..6ae60b1 100644 (file)
@@ -109,6 +109,23 @@ WeakHandleBase& WeakHandleBase::operator=( const WeakHandleBase& rhs )
   return *this;
 }
 
+WeakHandleBase::WeakHandleBase( WeakHandleBase&& rhs )
+: mImpl( rhs.mImpl )
+{
+  rhs.mImpl = nullptr;
+}
+
+WeakHandleBase& WeakHandleBase::operator=( WeakHandleBase&& rhs )
+{
+  if (this != &rhs)
+  {
+    mImpl = rhs.mImpl;
+    rhs.mImpl = nullptr;
+  }
+
+  return *this;
+}
+
 bool WeakHandleBase::operator==( const WeakHandleBase& rhs ) const
 {
   return this->mImpl->mObject == rhs.mImpl->mObject;
@@ -121,7 +138,7 @@ bool WeakHandleBase::operator!=( const WeakHandleBase& rhs ) const
 
 BaseHandle WeakHandleBase::GetBaseHandle() const
 {
-  return BaseHandle( mImpl->mObject );
+  return mImpl ? BaseHandle( mImpl->mObject ) : BaseHandle();
 }
 
 void WeakHandleBase::Reset()
index cb054bc..d7fb0d0 100644 (file)
@@ -81,6 +81,23 @@ public:
   WeakHandleBase& operator=( const WeakHandleBase& rhs );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  WeakHandleBase( WeakHandleBase&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  WeakHandleBase& operator=( WeakHandleBase&& rhs );
+
+  /**
    * @brief Equality operator overload.
    *
    * @SINCE_1_2.60
@@ -162,7 +179,7 @@ public:
   }
 
   /**
-   * @copydoc Dali::WeakHandleBase::operator=()
+   * @copydoc Dali::WeakHandleBase::operator=(const WeakHandleBase& rhs)
    */
   WeakHandle& operator=( const WeakHandle& rhs )
   {
@@ -171,6 +188,16 @@ public:
   }
 
   /**
+   * @copydoc Dali::WeakHandleBase::WeakHandleBase(WeakHandleBase&& rhs)
+   */
+  WeakHandle( WeakHandle&& rhs ) = default;
+
+  /**
+   * @copydoc Dali::WeakHandleBase::operator=(WeakHandleBase&& rhs)
+   */
+  WeakHandle& operator=( WeakHandle&& rhs ) = default;
+
+  /**
    * @copydoc Dali::WeakHandleBase::operator==()
    */
   bool operator==(const WeakHandle& rhs) const
index 555acca..e52e2f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,6 +48,10 @@ RenderTaskList& RenderTaskList::operator=(const RenderTaskList& rhs)
   return *this;
 }
 
+RenderTaskList::RenderTaskList( RenderTaskList&& rhs ) =  default;
+
+RenderTaskList& RenderTaskList::operator=( RenderTaskList&& rhs ) =  default;
+
 RenderTask RenderTaskList::CreateTask()
 {
   return RenderTask( GetImplementation(*this).CreateTask().Get() );
index c27d13c..b4a5d04 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_RENDER_TASK_LIST_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.
@@ -94,6 +94,23 @@ public:
   RenderTaskList& operator=(const RenderTaskList& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  RenderTaskList( RenderTaskList&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  RenderTaskList& operator=( RenderTaskList&& rhs );
+
+  /**
    * @brief Creates a new RenderTask.
    *
    * This will be appended to the list of render-tasks.
index 83d7717..520738f 100644 (file)
@@ -73,6 +73,10 @@ RenderTask& RenderTask::operator=(const RenderTask& rhs)
   return *this;
 }
 
+RenderTask::RenderTask( RenderTask&& rhs ) =  default;
+
+RenderTask& RenderTask::operator=( RenderTask&& rhs ) =  default;
+
 void RenderTask::SetSourceActor( Actor actor )
 {
   // NULL handle is allowed
index 37755fe..5d85da4 100644 (file)
@@ -226,6 +226,23 @@ public:
   RenderTask& operator=(const RenderTask& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  RenderTask( RenderTask&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  RenderTask& operator=( RenderTask&& rhs );
+
+  /**
    * @brief Sets the actors to be rendered.
    * @SINCE_1_0.0
    * @param[in] actor This actor and its children will be rendered.
index f9a2ba3..0badfa9 100644 (file)
@@ -86,6 +86,10 @@ FrameBuffer::FrameBuffer( Internal::FrameBuffer* pointer )
 {
 }
 
+FrameBuffer::FrameBuffer( FrameBuffer&& rhs ) =  default;
+
+FrameBuffer& FrameBuffer::operator=( FrameBuffer&& rhs ) =  default;
+
 void FrameBuffer::AttachColorTexture( Texture& texture )
 {
   AttachColorTexture( texture, 0u, 0u );
index a3fafe2..6c1ced7 100644 (file)
@@ -134,6 +134,23 @@ public:
   FrameBuffer& operator=( const FrameBuffer& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  FrameBuffer( FrameBuffer&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  FrameBuffer& operator=( FrameBuffer&& rhs );
+
+  /**
    * @brief Attach the base LOD of a 2D texture to the framebuffer for color rendering.
    * @note This causes a color attachment to be added.
    * @note Repeated calls to this method add textures as subsequent color attachments.
index a9c7867..2b69e87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use *this file except in compliance with the License.
@@ -54,6 +54,10 @@ Geometry& Geometry::operator=( const Geometry& handle )
   return *this;
 }
 
+Geometry::Geometry( Geometry&& rhs ) =  default;
+
+Geometry& Geometry::operator=( Geometry&& rhs ) =  default;
+
 std::size_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
 {
   DALI_ASSERT_ALWAYS( vertexBuffer && "VertexBuffer is not initialized ");
index d6db70a..a898e56 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GEOMETRY_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.
@@ -114,6 +114,23 @@ public:
   Geometry& operator=( const Geometry& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Geometry( Geometry&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Geometry& operator=( Geometry&& rhs );
+
+  /**
    * @brief Adds a PropertyBuffer to be used as source of geometry vertices.
    *
    * @SINCE_1_1.43
index 75e2b0c..91fdd46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,10 @@ PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle )
   return *this;
 }
 
+PropertyBuffer::PropertyBuffer( PropertyBuffer&& rhs ) =  default;
+
+PropertyBuffer& PropertyBuffer::operator=( PropertyBuffer&& rhs ) =  default;
+
 void PropertyBuffer::SetData( const void* data, std::size_t size )
 {
   GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
index e2680e0..c6037e4 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PROPERTY_BUFFER_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.
@@ -125,6 +125,23 @@ public:
   PropertyBuffer& operator=( const PropertyBuffer& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  PropertyBuffer( PropertyBuffer&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  PropertyBuffer& operator=( PropertyBuffer&& rhs );
+
+  /**
    * @brief Updates the whole buffer information.
    *
    * This function expects a pointer to an array of structures with the same
index 11458e1..14f42ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,10 @@ Renderer& Renderer::operator=( const Renderer& handle )
   return *this;
 }
 
+Renderer::Renderer( Renderer&& rhs ) =  default;
+
+Renderer& Renderer::operator=( Renderer&& rhs ) =  default;
+
 void Renderer::SetGeometry( Geometry& geometry )
 {
   DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
index 89b171f..8ff7f97 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_RENDERER_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.
@@ -478,6 +478,23 @@ public:
   Renderer& operator=( const Renderer& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Renderer( Renderer&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Renderer& operator=( Renderer&& rhs );
+
+  /**
    * @brief Sets the geometry to be used by this renderer.
    *
    * @SINCE_1_1.43
index 4439014..ac57115 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,6 +54,9 @@ Sampler& Sampler::operator=( const Sampler& handle )
   return *this;
 }
 
+Sampler::Sampler( Sampler&& rhs ) =  default;
+
+Sampler& Sampler::operator=( Sampler&& rhs ) =  default;
 
 void Sampler::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
 {
index e83c8b1..cc44ff0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SAMPLER_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.
@@ -94,6 +94,23 @@ public:
 
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Sampler( Sampler&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Sampler& operator=( Sampler&& rhs );
+
+  /**
    * @brief Sets the filter modes for this sampler.
    * Calling this function sets the properties MINIFICATION_FILTER and MAGNIFICATION_FILTER.
    *
index 4a1751d..7b9cfa5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,10 @@ Shader& Shader::operator=( const Shader& handle )
   return *this;
 }
 
+Shader::Shader( Shader&& rhs ) =  default;
+
+Shader& Shader::operator=( Shader&& rhs ) =  default;
+
 Shader::Shader( Internal::Shader* pointer )
 : Handle( pointer )
 {
index 36e9f23..1009a46 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SHADER_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.
@@ -171,6 +171,23 @@ public:
    */
   Shader& operator=( const Shader& handle );
 
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Shader( Shader&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  Shader& operator=( Shader&& rhs );
+
 public:
 
   /**
index cc48b11..fdcb141 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,10 @@ TextureSet& TextureSet::operator=( const TextureSet& handle )
   return *this;
 }
 
+TextureSet::TextureSet( TextureSet&& rhs ) =  default;
+
+TextureSet& TextureSet::operator=( TextureSet&& rhs ) =  default;
+
 void TextureSet::SetTexture( size_t index, Texture texture )
 {
   if( texture )
index 8af0ca6..90c314c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEXTURE_SET_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.
@@ -97,6 +97,23 @@ public:
   TextureSet& operator=( const TextureSet& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  TextureSet( TextureSet&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  TextureSet& operator=( TextureSet&& rhs );
+
+  /**
    * @brief Sets the texture at position "index".
    *
    * @SINCE_1_1.43
index f23a3f2..0a8b80d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use *this file except in compliance with the License.
@@ -62,6 +62,10 @@ Texture& Texture::operator=( const Texture& handle )
   return *this;
 }
 
+Texture::Texture( Texture&& rhs ) =  default;
+
+Texture& Texture::operator=( Texture&& rhs ) =  default;
+
 bool Texture::Upload( PixelData pixelData )
 {
   Internal::PixelData& internalPixelData = GetImplementation( pixelData );
index a043c7d..8668772 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEXTURE_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.
@@ -142,6 +142,23 @@ public:
   Texture& operator=( const Texture& handle );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Texture( Texture&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Texture& operator=( Texture&& rhs );
+
+  /**
    * @brief Uploads data to the texture from a PixelData object.
    *
    * @SINCE_1_1.43
index 933d318..ab146f1 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2
 Summary:    DALi 3D Engine
-Version:    1.9.21
+Version:    1.9.22
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT