*.creator.user
/docs/generated/*
/build/tizen/doc
+/build/tizen-cmake/doc
/build/tizen/.cov
/build/desktop
/packaging/home*
../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
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
- --coverage
+ --coverage -ldl
)
INSTALL(PROGRAMS ${EXEC_NAME}
SET(TC_SOURCES
utc-Dali-Actor.cpp
+ utc-Dali-AddOn.cpp
utc-Dali-AlphaFunction.cpp
utc-Dali-AngleAxis.cpp
utc-Dali-Animation.cpp
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
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 )
--- /dev/null
+/*
+ * 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();
+ }
+ }
+}
+
+}
+}
+
--- /dev/null
+#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
#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>
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);
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
// 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
{
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);
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
--- /dev/null
+/*
+ * 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 );
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)
{
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;
+}
--- /dev/null
+/*
+ * 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;
+}
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;
/*
- * 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.
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;
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;
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;
}
///////////////////////////////////////////////////////////////////////////////
+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
///////////////////////////////////////////////////////////////////////////////
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;
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;
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;
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()");
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)
{
/*
- * 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.
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()");
/*
- * 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.
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;
+}
/*
- * 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.
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;
+}
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;
/*
- * 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.
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
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 );
}
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;
+}
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)
{
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;
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
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;
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;
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 );
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;
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;
+}
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;
#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;
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;
+}
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;
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;
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;
+}
* @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
--- /dev/null
+#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
--- /dev/null
+#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
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
${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
${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
${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
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
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
)
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}
+++ /dev/null
-#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
--- /dev/null
+/*
+ * 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
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
{
namespace Rendering
{
+
+
/**
* @brief Enumeration for the rendering behavior
*/
--- /dev/null
+/*
+ * 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;
+}
+}
+}
--- /dev/null
+#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
# 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
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
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
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
break;
}
+ case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
+ {
+ value = mCaptureAllTouchAfterStart;
+ break;
+ }
+
default:
{
// Must be a scene-graph only property
#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.
*/
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
/**
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
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()
{
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() );
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 );
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.
if ( primaryPointState == PointState::UP )
{
- mLastPrimaryHitActor.SetActor( NULL );
- mLastConsumedActor.SetActor( NULL );
+ mLastPrimaryHitActor.SetActor( nullptr );
+ mLastConsumedActor.SetActor( nullptr );
+ mCapturingTouchActor.SetActor( nullptr );
mLastRenderTask.Reset();
}
else
}
else
{
- mLastPrimaryHitActor.SetActor( NULL );
- mLastConsumedActor.SetActor( NULL );
+ mLastPrimaryHitActor.SetActor( nullptr );
+ mLastConsumedActor.SetActor( nullptr );
+ mCapturingTouchActor.SetActor( nullptr );
mLastRenderTask.Reset();
}
}
#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.
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
};
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
*/
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
/**
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
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.
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);
+ }
}
}
}
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 )
{
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 )
context.CullFace( mFaceCullingMode );
}
- //Set blending mode
- SetBlending( context, blend );
-
// Take the program into use so we can send uniforms to it
program->Use();
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;
}
}
*/
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
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
bool mUpdated:1;
+ std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands; // Devel stuff
};
} // namespace SceneGraph
#include <math.h> //floor, log2
// INTERNAL INCLUDES
-#include <dali/devel-api/images/native-image-interface-extension.h>
+
namespace Dali
{
if( mNativeImage )
{
- mNativeImage->GlExtensionDestroy();
+ mNativeImage->DestroyResource();
}
}
}
{
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 );
if( mNativeImage->TargetTexture() != 0u )
{
context.DeleteTextures( 1, &mId );
- mNativeImage->GlExtensionDestroy();
+ mNativeImage->DestroyResource();
mId = 0u;
}
}
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;
}
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 );
}
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
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;
}
}
+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
*/
virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const;
+ void SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size );
+
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
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
return *this;
}
+Actor::Actor( Actor&& rhs ) = default;
+
+Actor& Actor::operator=( Actor&& rhs ) = default;
+
Layer Actor::GetLayer()
{
return GetImplementation(*this).GetLayer();
*/
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
/**
/*
- * 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.
return *this;
}
+CustomActor::CustomActor( CustomActor&& rhs ) = default;
+
+CustomActor& CustomActor::operator=( CustomActor&& rhs ) = default;
+
CustomActorImpl& CustomActor::GetImplementation()
{
Internal::CustomActor& internal = GetImpl(*this);
#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.
*/
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
/**
return *this;
}
+Layer::Layer( Layer&& rhs ) = default;
+
+Layer& Layer::operator=( Layer&& rhs ) = default;
+
void Layer::Raise()
{
GetImplementation(*this).Raise();
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
/*
- * 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.
return *this;
}
+Animation::Animation( Animation&& rhs ) = default;
+
+Animation& Animation::operator=( Animation&& rhs ) = default;
+
void Animation::SetDuration(float durationSeconds)
{
GetImplementation(*this).SetDuration(durationSeconds);
#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.
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
/*
- * 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.
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() ) );
#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.
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.
/*
- * 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.
return *this;
}
+KeyFrames::KeyFrames( KeyFrames&& rhs ) = default;
+
+KeyFrames& KeyFrames::operator=( KeyFrames&& rhs ) = default;
+
Property::Type KeyFrames::GetType() const
{
return GetImplementation(*this).GetType();
#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.
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.
/*
- * 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.
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 );
#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.
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
/*
- * 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.
return *this;
}
+Path::Path( Path&& rhs ) = default;
+
+Path& Path::operator=( Path&& rhs ) = default;
+
void Path::AddPoint(const Vector3& point )
{
GetImplementation(*this).AddPoint( point );
#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.
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
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
-#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.
// INTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/object/any.h>
namespace Dali
{
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;
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
* @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
/*
- * 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.
return *this;
}
+PixelData::PixelData( PixelData&& rhs ) = default;
+
+PixelData& PixelData::operator=( PixelData&& rhs ) = default;
+
uint32_t PixelData::GetWidth() const
{
return GetImplementation(*this).GetWidth();
#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.
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
/*
- * 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.
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 );
#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.
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
/*
- * 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.
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 );
#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.
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.
/*
- * 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.
return *this;
}
+ObjectRegistry::ObjectRegistry( ObjectRegistry&& rhs ) = default;
+
+ObjectRegistry& ObjectRegistry::operator=( ObjectRegistry&& rhs ) = default;
+
ObjectRegistry::ObjectCreatedSignalType& ObjectRegistry::ObjectCreatedSignal()
{
return GetImplementation(*this).ObjectCreatedSignal();
#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.
*/
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
/**
/*
- * 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.
return *this;
}
+PropertyCondition::PropertyCondition( PropertyCondition&& rhs ) = default;
+
+PropertyCondition& PropertyCondition::operator=( PropertyCondition&& rhs ) = default;
+
std::size_t PropertyCondition::GetArgumentCount() const
{
return GetImplementation(*this).arguments.Count();
#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.
*/
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:
/**
/*
- * 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.
return *this;
}
+PropertyNotification::PropertyNotification( PropertyNotification&& rhs ) = default;
+
+PropertyNotification& PropertyNotification::operator=( PropertyNotification&& rhs ) = default;
+
PropertyCondition PropertyNotification::GetCondition()
{
return GetImplementation(*this).GetCondition();
#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.
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
/*
- * 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.
return *this;
}
+TypeInfo::TypeInfo( TypeInfo&& rhs ) = default;
+
+TypeInfo& TypeInfo::operator=( TypeInfo&& rhs ) = default;
+
const std::string& TypeInfo::GetName() const
{
return GetImplementation(*this).GetName();
#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.
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
/*
- * 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.
return *this;
}
+TypeRegistry::TypeRegistry( TypeRegistry&& rhs ) = default;
+
+TypeRegistry& TypeRegistry::operator=( TypeRegistry&& rhs ) = default;
+
TypeRegistry TypeRegistry::Get()
{
return TypeRegistry(Internal::TypeRegistry::Get());
#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.
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
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;
BaseHandle WeakHandleBase::GetBaseHandle() const
{
- return BaseHandle( mImpl->mObject );
+ return mImpl ? BaseHandle( mImpl->mObject ) : BaseHandle();
}
void WeakHandleBase::Reset()
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
}
/**
- * @copydoc Dali::WeakHandleBase::operator=()
+ * @copydoc Dali::WeakHandleBase::operator=(const WeakHandleBase& rhs)
*/
WeakHandle& operator=( const WeakHandle& rhs )
{
}
/**
+ * @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
/*
- * 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.
return *this;
}
+RenderTaskList::RenderTaskList( RenderTaskList&& rhs ) = default;
+
+RenderTaskList& RenderTaskList::operator=( RenderTaskList&& rhs ) = default;
+
RenderTask RenderTaskList::CreateTask()
{
return RenderTask( GetImplementation(*this).CreateTask().Get() );
#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.
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.
return *this;
}
+RenderTask::RenderTask( RenderTask&& rhs ) = default;
+
+RenderTask& RenderTask::operator=( RenderTask&& rhs ) = default;
+
void RenderTask::SetSourceActor( Actor actor )
{
// NULL handle is allowed
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.
{
}
+FrameBuffer::FrameBuffer( FrameBuffer&& rhs ) = default;
+
+FrameBuffer& FrameBuffer::operator=( FrameBuffer&& rhs ) = default;
+
void FrameBuffer::AttachColorTexture( Texture& texture )
{
AttachColorTexture( texture, 0u, 0u );
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.
/*
- * 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.
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 ");
#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.
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
/*
- * 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.
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
#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.
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
/*
- * 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.
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" );
#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.
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
/*
- * 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.
return *this;
}
+Sampler::Sampler( Sampler&& rhs ) = default;
+
+Sampler& Sampler::operator=( Sampler&& rhs ) = default;
void Sampler::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
{
#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.
/**
+ * @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.
*
/*
- * 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.
return *this;
}
+Shader::Shader( Shader&& rhs ) = default;
+
+Shader& Shader::operator=( Shader&& rhs ) = default;
+
Shader::Shader( Internal::Shader* pointer )
: Handle( pointer )
{
#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.
*/
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:
/**
/*
- * 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.
return *this;
}
+TextureSet::TextureSet( TextureSet&& rhs ) = default;
+
+TextureSet& TextureSet::operator=( TextureSet&& rhs ) = default;
+
void TextureSet::SetTexture( size_t index, Texture texture )
{
if( texture )
#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.
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
/*
- * 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.
return *this;
}
+Texture::Texture( Texture&& rhs ) = default;
+
+Texture& Texture::operator=( Texture&& rhs ) = default;
+
bool Texture::Upload( PixelData pixelData )
{
Internal::PixelData& internalPixelData = GetImplementation( pixelData );
#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.
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
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