From: greynaga Date: Fri, 1 Mar 2019 14:35:42 +0000 (+0000) Subject: [dali_1.4.9] Merge branch 'devel/master' X-Git-Tag: dali_1.9.8~5^2~57 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=e57ac623d829edc5470e4ede8beff556a13035e1;hp=ff5648f97fac481394ea81164e947f19e2a0e50a [dali_1.4.9] Merge branch 'devel/master' Change-Id: I52380bbda6882169dda7e601c4c3168e99584baa --- diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index 093f4fb..5e2e9ed 100755 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -63,6 +63,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp + ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp dali-toolkit-test-utils/toolkit-text-utils.cpp diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp old mode 100644 new mode 100755 index 35105d1..66e2682 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp @@ -586,10 +586,10 @@ int UtcDaliTextViewModelElideText02(void) float positions01[] = { 0.f, 8.f, 16.f, 26.f, 33.f, 41.f, 45.f, 54.f, 64.0f }; Size textSize02( 80.f, 100.f ); - float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 9.0f }; + float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 23.0f }; Size textSize03( 80.f, 100.f ); - float positions03[] = { 78.f, 73.f, 70.f, 65.f, 57.f, 55.f, 51.f, 50.f, 45.f, 35.f, 32.f, 24.f, 7.f }; + float positions03[] = { 78.f, 73.f, 70.f, 65.f, 57.f, 55.f, 51.f, 50.f, 45.f, 35.f, 32.f, 24.f, 21.f }; Size textSize04( 80.f, 10.f ); float positions04[] = { 2.f }; diff --git a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt index 2366711..bc765c7 100644 --- a/automated-tests/src/dali-toolkit-styling/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-styling/CMakeLists.txt @@ -46,6 +46,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp + ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt index a5fde09..6f50e82 100644 --- a/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-third-party/CMakeLists.txt @@ -39,6 +39,7 @@ LIST(APPEND TC_SOURCES ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp + ../dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit/CMakeLists.txt b/automated-tests/src/dali-toolkit/CMakeLists.txt index 1ef55f9..678a4ae 100755 --- a/automated-tests/src/dali-toolkit/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit/CMakeLists.txt @@ -118,6 +118,7 @@ LIST(APPEND TC_SOURCES dali-toolkit-test-utils/test-gl-sync-abstraction.cpp dali-toolkit-test-utils/test-platform-abstraction.cpp dali-toolkit-test-utils/test-render-controller.cpp + dali-toolkit-test-utils/test-render-surface.cpp dali-toolkit-test-utils/test-trace-call-stack.cpp dali-toolkit-test-utils/test-native-image.cpp ) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp index c953f50..1562d27 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * 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. @@ -54,8 +54,6 @@ void TestApplication::Initialize() Integration::StencilBufferAvailable::TRUE ); mCore->ContextCreated(); - mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); - mCore->SetDpi( mDpi.x, mDpi.y ); Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage); Dali::Integration::Log::InstallLogFunction(logFunction); @@ -65,12 +63,22 @@ void TestApplication::Initialize() Dali::Integration::Trace::LogContext( true, "Test" ); + mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) ); + mScene = Dali::Integration::Scene::New( Vector2( static_cast( mSurfaceWidth ), static_cast( mSurfaceHeight ) ) ); + mScene.SetSurface( *mRenderSurface ); + + mScene.SetDpi( Vector2( static_cast( mDpi.x ), static_cast( mDpi.y ) ) ); + + mCore->SurfaceResized( mRenderSurface ); + mCore->SceneCreated(); + mCore->Initialize(); } TestApplication::~TestApplication() { Dali::Integration::Log::UninstallLogFunction(); + delete mRenderSurface; delete mCore; } @@ -149,19 +157,6 @@ void TestApplication::SendNotification() mCore->ProcessEvents(); } -void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height ) -{ - mSurfaceWidth = width; - mSurfaceHeight = height; - - mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight ); -} - -void TestApplication::SetTopMargin( uint32_t margin ) -{ - mCore->SetTopMargin( margin ); -} - void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location ) { if( GetUpdateStatus() == 0 && diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h index d1e042d..fc2929c 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h @@ -2,7 +2,7 @@ #define __DALI_TEST_APPLICATION_H__ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * 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. @@ -24,9 +24,11 @@ #include "test-gl-sync-abstraction.h" #include "test-gl-abstraction.h" #include "test-render-controller.h" +#include "test-render-surface.h" #include #include #include +#include namespace Dali { @@ -69,8 +71,6 @@ public: TestGestureManager& GetGestureManager(); void ProcessEvent(const Integration::Event& event); void SendNotification(); - void SetSurfaceWidth( uint32_t width, unsigned height ); - void SetTopMargin( uint32_t margin ); bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL ); uint32_t GetUpdateStatus(); bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL ); @@ -83,6 +83,11 @@ public: mLoggingEnabled = enabled; } + Integration::Scene GetScene() const + { + return mScene; + } + private: void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL ); @@ -92,11 +97,13 @@ protected: TestGlAbstraction mGlAbstraction; TestGlSyncAbstraction mGlSyncAbstraction; TestGestureManager mGestureManager; + TestRenderSurface* mRenderSurface; Integration::UpdateStatus mStatus; Integration::RenderStatus mRenderStatus; Integration::Core* mCore; + Dali::Integration::Scene mScene; uint32_t mSurfaceWidth; uint32_t mSurfaceHeight; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp new file mode 100644 index 0000000..332d77e --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "test-render-surface.h" + +namespace Dali +{ + +TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize ) +: mPositionSize( positionSize ), + mBackgroundColor() +{ +} + +TestRenderSurface::~TestRenderSurface() +{ +} + +Dali::PositionSize TestRenderSurface::GetPositionSize() const +{ + return mPositionSize; +}; + +void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) +{ + dpiHorizontal = dpiVertical = 96; +}; + +void TestRenderSurface::InitializeGraphics() +{ +} + +void TestRenderSurface::CreateSurface() +{ +} + +void TestRenderSurface::DestroySurface() +{ +} + +bool TestRenderSurface::ReplaceGraphicsSurface() +{ + return false; +} + +void TestRenderSurface::MoveResize( Dali::PositionSize positionSize ) +{ + mPositionSize = positionSize; +} + +void TestRenderSurface::StartRender() +{ +} + +bool TestRenderSurface::PreRender( bool resizingSurface ) +{ + return true; +} + +void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) +{ +} + +void TestRenderSurface::StopRender() +{ +} + +void TestRenderSurface::ReleaseLock() +{ +} + +Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType() +{ + return WINDOW_RENDER_SURFACE; +} + +void TestRenderSurface::MakeContextCurrent() +{ +} + +Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired() +{ + return Integration::DepthBufferAvailable::TRUE; +} + +Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired() +{ + return Integration::StencilBufferAvailable::TRUE; +} + +void TestRenderSurface::SetBackgroundColor( Vector4 color ) +{ + mBackgroundColor = color; +} + +Vector4 TestRenderSurface::GetBackgroundColor() +{ + return mBackgroundColor; +} + +} // Namespace dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h new file mode 100644 index 0000000..fba89c2 --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-surface.h @@ -0,0 +1,155 @@ +#ifndef TEST_REENDER_SURFACE_H +#define TEST_REENDER_SURFACE_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +/** + * Concrete implementation of the RenderSurface class. + */ +class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface +{ +public: + + /** + * @copydoc Dali::Integration::RenderSurface::RenderSurface + */ + TestRenderSurface( Dali::PositionSize positionSize ); + + /** + * @copydoc Dali::Integration::RenderSurface::~RenderSurface + */ + virtual ~TestRenderSurface(); + + /** + * @copydoc Dali::Integration::RenderSurface::GetPositionSize + */ + virtual Dali::PositionSize GetPositionSize() const; + + /** + * @copydoc Dali::Integration::RenderSurface::GetDpi + */ + virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ); + + /** + * @copydoc Dali::Integration::RenderSurface::InitializeGraphics + */ + virtual void InitializeGraphics(); + + /** + * @copydoc Dali::Integration::RenderSurface::CreateSurface + */ + virtual void CreateSurface(); + + /** + * @copydoc Dali::Integration::RenderSurface::DestroySurface + */ + virtual void DestroySurface(); + + /** + * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface + */ + virtual bool ReplaceGraphicsSurface(); + + /** + * @copydoc Dali::Integration::RenderSurface::MoveResize + */ + virtual void MoveResize( Dali::PositionSize positionSize ); + + /** + * @copydoc Dali::Integration::RenderSurface::StartRender + */ + virtual void StartRender(); + + /** + * @copydoc Dali::Integration::RenderSurface::PreRender + */ + virtual bool PreRender( bool resizingSurface ); + + /** + * @copydoc Dali::Integration::RenderSurface::PostRender + */ + virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ); + + /** + * @copydoc Dali::Integration::RenderSurface::StopRender + */ + virtual void StopRender(); + + /** + * @copydoc Dali::Integration::RenderSurface::ReleaseLock + */ + virtual void ReleaseLock(); + + /** + * @copydoc Dali::Integration::RenderSurface::GetSurfaceType + */ + virtual Dali::Integration::RenderSurface::Type GetSurfaceType(); + + /** + * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent + */ + virtual void MakeContextCurrent(); + + /** + * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired + */ + virtual Integration::DepthBufferAvailable GetDepthBufferRequired(); + + /** + * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired + */ + virtual Integration::StencilBufferAvailable GetStencilBufferRequired(); + + /** + * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor + */ + virtual void SetBackgroundColor( Vector4 color ); + + /** + * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor + */ + virtual Vector4 GetBackgroundColor(); + +private: + + /** + * @brief Undefined copy constructor. RenderSurface cannot be copied + */ + TestRenderSurface( const TestRenderSurface& rhs ); + + /** + * @brief Undefined assignment operator. RenderSurface cannot be copied + */ + TestRenderSurface& operator=( const TestRenderSurface& rhs ); + +private: + + Dali::PositionSize mPositionSize; + Vector4 mBackgroundColor; ///< The background color of the surface +}; + +} // Dali + +#endif diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp index 8cd215b1..a4b0d87 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp @@ -88,7 +88,6 @@ public: bool HandleActionReadFromTopEvent(); bool HandleActionReadFromNextEvent(); bool HandleActionZoomEvent(); - bool HandleActionReadIndicatorInformationEvent(); bool HandleActionReadPauseResumeEvent(); bool HandleActionStartStopEvent(); @@ -385,15 +384,6 @@ bool AccessibilityAdaptor::HandleActionZoomEvent() return false; } -bool AccessibilityAdaptor::HandleActionReadIndicatorInformationEvent() -{ - if( mActionHandler ) - { - return mActionHandler->AccessibilityActionReadIndicatorInformation(); - } - return false; -} - bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent() { if( mActionHandler ) @@ -590,11 +580,6 @@ bool AccessibilityAdaptor::HandleActionZoomEvent() return Internal::Adaptor::GetImplementation(*this).HandleActionZoomEvent(); } -bool AccessibilityAdaptor::HandleActionReadIndicatorInformationEvent() -{ - return Internal::Adaptor::GetImplementation(*this).HandleActionReadIndicatorInformationEvent(); -} - bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent() { return Internal::Adaptor::GetImplementation(*this).HandleActionReadPauseResumeEvent(); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h index ee60af1..902167c 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h @@ -18,7 +18,7 @@ * */ -#include +#include namespace Dali { @@ -45,40 +45,6 @@ class GlAbstraction; } // namespace Integration -class TestRenderSurface : public RenderSurface -{ -public: - virtual PositionSize GetPositionSize() const { PositionSize size; return size; } - - virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; } - - virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) {}; - - virtual void CreateSurface() {} - - virtual void DestroySurface() {} - - virtual bool ReplaceGraphicsSurface() { return false; } - - virtual void MoveResize( Dali::PositionSize positionSize ) {} - - virtual void SetViewMode( ViewMode viewMode ) {} - - virtual void StartRender() {} - - virtual bool PreRender( bool resizingSurface ) { return false; } - - virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {} - - virtual void StopRender() {} - - virtual void ReleaseLock() {} - - virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {} - - virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; } -}; - namespace Internal { namespace Adaptor @@ -92,7 +58,7 @@ public: ~Adaptor(); public: - static Dali::RenderSurface& GetSurface(); + static Dali::RenderSurfaceInterface& GetSurface(); static Dali::Adaptor::AdaptorSignalType& AdaptorSignal(); static bool mAvailable; static Vector mCallbacks; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp index dcf0560..5d6cf4e 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace Dali { @@ -42,9 +43,9 @@ Dali::Adaptor& Adaptor::Get() return *adaptor; } -Dali::RenderSurface& Adaptor::GetSurface() +Dali::RenderSurfaceInterface& Adaptor::GetSurface() { - Dali::RenderSurface *renderSurface = new Dali::TestRenderSurface; + Dali::RenderSurfaceInterface* renderSurface = reinterpret_cast ( new Dali::TestRenderSurface( Dali::PositionSize( 0, 0, 480, 800 ) ) ); return *renderSurface; } @@ -67,12 +68,12 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration ) return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface ) { return Internal::Adaptor::Adaptor::Get(); } -Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration ) +Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration ) { return Internal::Adaptor::Adaptor::Get(); } @@ -129,7 +130,7 @@ void Adaptor::RemoveIdle( CallbackBase* callback ) } } -void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface ) +void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ) { } @@ -143,7 +144,7 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal() return Internal::Adaptor::Adaptor::AdaptorSignal(); } -RenderSurface& Adaptor::GetSurface() +Dali::RenderSurfaceInterface& Adaptor::GetSurface() { return Internal::Adaptor::Adaptor::GetSurface(); } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp index 23200c0..2044f1e 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp @@ -2131,30 +2131,6 @@ int UtcDaliAccessibilityManagerActionZoomSignalN(void) END_TEST; } -int UtcDaliAccessibilityManagerActionReadIndicatorInformationSignalP(void) -{ - ToolkitTestApplication application; - tet_infoline( " UtcDaliAccessibilityManagerActionReadIndicatorInformationSignalP" ); - - AccessibilityManagerSignalHandler callback; - - Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get(); - Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true ); - accAdaptor.HandleActionEnableEvent(); - - AccessibilityManager manager = AccessibilityManager::Get(); - DALI_TEST_CHECK( manager ); - - manager.ActionReadIndicatorInformationSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback ); - - Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get(); - accessibilityAdaptor.HandleActionReadIndicatorInformationEvent(); - - DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION ); - - END_TEST; -} - int UtcDaliAccessibilityManagerActionReadIndicatorInformationSignalN(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp index 8e1673e..0921d61 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp @@ -51,6 +51,15 @@ void utc_dali_toolkit_control_wrapper_cleanup(void) namespace { bool gOnRelayout = false; + +static bool gKeyInputFocusCallBackCalled; + +static void TestKeyInputFocusCallback( Control control ) +{ + tet_infoline(" TestKeyInputFocusCallback"); + + gKeyInputFocusCallBackCalled = true; +} } // namespace /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -810,3 +819,23 @@ int UtcDaliControlWrapperAnimateVisual(void) END_TEST; } + +int UtcDaliControlWrapperEmitKeyFocusSignal(void) +{ + ToolkitTestApplication application; + + Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT ); + ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl ); + + gKeyInputFocusCallBackCalled = false; + controlWrapper.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback); + + application.SendNotification(); + application.Render(); + + controlWrapperImpl->EmitKeyInputFocusSignal( true ); + + DALI_TEST_CHECK( gKeyInputFocusCallBackCalled ); + + END_TEST; +} \ No newline at end of file diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index 7d1ea16..20686c6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -353,7 +354,7 @@ int UtcDaliImageViewSetGetProperty03(void) Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); bool enable; DALI_TEST_CHECK( value.Get( enable ) ); - DALI_TEST_CHECK( !enable ); + DALI_TEST_CHECK( enable ); // pre-multiplied alpha blending imageView.SetProperty( Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA, true ); @@ -376,6 +377,205 @@ int UtcDaliImageViewSetGetProperty03(void) END_TEST; } +int UtcDaliImageViewPreMultipliedAlphaPng(void) +{ + ToolkitTestApplication application; + + // Set up trace debug + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable( true ); + + Property::Map imageMap; + imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA; + imageMap[ ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache + + ImageView imageView1 = ImageView::New(); + imageView1.SetProperty( ImageView::Property::IMAGE, imageMap ); + + Stage::GetCurrent().Add( imageView1 ); + + Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + bool enable; + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( enable ); // Default value is true + + // loading started, this waits for the loader thread for max 30 seconds + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( enable ); // Keep true + + // conventional alpha blending + Renderer renderer1 = imageView1.GetRendererAt( 0 ); + value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( enable ); + + int srcFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB ); + int destFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); + int srcFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); + int destFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated. + textureTrace.Reset(); + + // Disable pre-multiplied alpha blending + imageView1.SetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA, false ); + + // Reload the image + Property::Map attributes; + DevelControl::DoAction( imageView1, ImageView::Property::IMAGE, DevelImageVisual::Action::RELOAD, attributes ); + + // loading started, this waits for the loader thread for max 30 seconds + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); + + // conventional alpha blending + value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); + + srcFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB ); + destFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); + srcFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); + destFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated. + textureTrace.Reset(); + + // Make a new ImageView using the same image + ImageView imageView2 = ImageView::New(); + imageView2.SetProperty( ImageView::Property::IMAGE, imageMap ); + + Stage::GetCurrent().Add( imageView2 ); + + application.SendNotification(); + application.Render(); + + Renderer renderer2 = imageView2.GetRendererAt( 0 ); + value = renderer2.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( enable ); + + srcFactorRgb = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB ); + destFactorRgb = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); + srcFactorAlpha = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); + destFactorAlpha = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION ); // The cached texture should be used. + + END_TEST; +} + +int UtcDaliImageViewPreMultipliedAlphaJpg(void) +{ + ToolkitTestApplication application; + + // Set up trace debug + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable( true ); + + Property::Map imageMap; + imageMap[ ImageVisual::Property::URL ] = gImage_600_RGB; + imageMap[ ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache + + ImageView imageView1 = ImageView::New(); + imageView1.SetProperty( ImageView::Property::IMAGE, imageMap ); + + Stage::GetCurrent().Add( imageView1 ); + + Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + bool enable; + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( enable ); // Default value is true + + // loading started, this waits for the loader thread for max 30 seconds + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); // Should be false after loading + + // conventional alpha blending + Renderer renderer1 = imageView1.GetRendererAt( 0 ); + value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); + + int srcFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB ); + int destFactorRgb = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); + int srcFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); + int destFactorAlpha = renderer1.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated. + textureTrace.Reset(); + + ImageView imageView2 = ImageView::New(); + imageView2.SetProperty( ImageView::Property::IMAGE, imageMap ); + + // Disable pre-multiplied alpha blending + imageView2.SetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA, false ); + + Stage::GetCurrent().Add( imageView2 ); + + application.SendNotification(); + application.Render(); + + value = imageView2.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); + + // conventional alpha blending + Renderer renderer2 = imageView2.GetRendererAt( 0 ); + value = renderer2.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); + DALI_TEST_CHECK( value.Get( enable ) ); + DALI_TEST_CHECK( !enable ); + + srcFactorRgb = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB ); + destFactorRgb = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); + srcFactorAlpha = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); + destFactorAlpha = renderer2.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION ); // The cached texture should be used. + + END_TEST; +} + int UtcDaliImageViewPixelArea(void) { // Test pixel area property diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp index a527eac..438a496 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp @@ -217,6 +217,7 @@ void CleanupTest() int UtcDaliScrollViewPagePathEffectSetup(void) { + ToolkitTestApplication application; tet_infoline(" UtcDaliScrollViewPagePathEffectSetup"); ScrollViewPagePathEffect effect; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 4e259e1..aee2e2f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -3294,7 +3294,7 @@ int UtcDaliVisualPremultipliedAlpha(void) VisualFactory factory = VisualFactory::Get(); - // image visual, test default value ( false ) + // image visual, test default value ( true ) { Visual::Base imageVisual = factory.CreateVisual( Property::Map() @@ -3307,7 +3307,7 @@ int UtcDaliVisualPremultipliedAlpha(void) // test values DALI_TEST_CHECK( value ); - DALI_TEST_EQUALS( value->Get(), false, TEST_LOCATION ); + DALI_TEST_EQUALS( value->Get(), true, TEST_LOCATION ); } // image visual, override premultiplied @@ -3316,7 +3316,7 @@ int UtcDaliVisualPremultipliedAlpha(void) Property::Map() .Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE ) .Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ) - .Add( Visual::Property::PREMULTIPLIED_ALPHA, true ) ); + .Add( Visual::Property::PREMULTIPLIED_ALPHA, false ) ); Dali::Property::Map visualMap; imageVisual.CreatePropertyMap( visualMap ); @@ -3324,7 +3324,7 @@ int UtcDaliVisualPremultipliedAlpha(void) // test values DALI_TEST_CHECK( value ); - DALI_TEST_EQUALS( value->Get(), true, TEST_LOCATION); + DALI_TEST_EQUALS( value->Get(), false, TEST_LOCATION); } // svg visual ( premultiplied alpha by default is true ) diff --git a/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp b/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp index 37def2b..1a2ec4b 100755 --- a/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp +++ b/dali-toolkit/devel-api/controls/control-wrapper-impl.cpp @@ -185,6 +185,11 @@ Dali::TypeInfo ControlWrapper::GetTypeInfo() return DevelCustomActor::GetTypeInfo(Self()); } +void ControlWrapper::EmitKeyInputFocusSignal( bool focusGained ) +{ + Control::EmitKeyInputFocusSignal( focusGained ); +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp index 8880b31..aee1bc0 100644 --- a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp +++ b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp @@ -1240,19 +1240,6 @@ bool AccessibilityManager::AccessibilityActionZoom() return ret; } -bool AccessibilityManager::AccessibilityActionReadIndicatorInformation() -{ - Dali::Toolkit::AccessibilityManager handle( this ); - if( !mActionReadIndicatorInformationSignal.Empty() ) - { - mActionReadIndicatorInformationSignal.Emit( handle ); - } - - // TODO: Read the information in the indicator - - return mIsAccessibilityTtsEnabled; -} - bool AccessibilityManager::AccessibilityActionReadPauseResume() { Dali::Toolkit::AccessibilityManager handle( this ); diff --git a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h index 69e924a..f794170 100644 --- a/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h +++ b/dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h @@ -654,12 +654,6 @@ private: virtual bool AccessibilityActionZoom(); /** - * Perform the accessibility action to read the information in the indicator (by two fingers triple tap). - * @return whether the accessibility action is performed or not. - */ - virtual bool AccessibilityActionReadIndicatorInformation(); - - /** * Perform the accessibility action to pause/resume the current read out (by two fingers single tap). * @return whether the accessibility action is performed or not. */ diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp index 6fbabb1..66c6d89 100755 --- a/dali-toolkit/internal/text/logical-model-impl.cpp +++ b/dali-toolkit/internal/text/logical-model-impl.cpp @@ -38,7 +38,7 @@ void FreeFontFamilyNames( Vector& fontDescriptionRuns ) it != endIt; ++it ) { - delete (*it).familyName; + delete[] (*it).familyName; } fontDescriptionRuns.Clear(); diff --git a/dali-toolkit/internal/text/rendering/view-model.cpp b/dali-toolkit/internal/text/rendering/view-model.cpp index 9be8215..0a977f3 100755 --- a/dali-toolkit/internal/text/rendering/view-model.cpp +++ b/dali-toolkit/internal/text/rendering/view-model.cpp @@ -332,12 +332,6 @@ void ViewModel::ElideGlyphs() glyphInfo = ellipsisGlyph; // Change the 'x' and 'y' position of the ellipsis glyph. - - if( position.x > firstPenX ) - { - position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; - } - position.x += ellipsisGlyph.xBearing; position.y = penY - ellipsisGlyph.yBearing; diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index fad510b..77d06b7 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -187,6 +187,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, mLoading( false ), mOrientationCorrection( true ) { + EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() ); } ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image ) @@ -211,6 +212,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFac mLoading( false ), mOrientationCorrection( true ) { + EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() ); } ImageVisual::~ImageVisual() @@ -683,7 +685,7 @@ void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& t atlasUploadObserver = this; } - auto preMultiplyOnLoad = mFactoryCache.GetPreMultiplyOnLoad() && !mImpl->mCustomShader + auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 6ae1d8e..e1b162c 100755 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -291,7 +291,7 @@ void NPatchVisual::LoadImages() { if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocalResource() ) { - bool preMultiplyOnLoad = mFactoryCache.GetPreMultiplyOnLoad() && !mImpl->mCustomShader ? true : false; + bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false; mId = mLoader.Load( mImageUrl.GetUrl(), mBorder, preMultiplyOnLoad ); @@ -434,6 +434,7 @@ NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache ) mBorder(), mAuxiliaryImageAlpha( 0.0f ) { + EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() ); } NPatchVisual::~NPatchVisual() diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index 5e9910d..3a32ddc 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -344,7 +344,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( { // First check if the requested Texture is cached. const TextureHash textureHash = GenerateHash( url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, - maskTextureId, preMultiplyOnLoad ); + maskTextureId ); TextureManager::TextureId textureId = INVALID_TEXTURE_ID; @@ -978,8 +978,7 @@ TextureManager::TextureHash TextureManager::GenerateHash( const FittingMode::Type fittingMode, const Dali::SamplingMode::Type samplingMode, const UseAtlas useAtlas, - TextureId maskTextureId, - TextureManager::MultiplyOnLoad preMultiplyOnLoad) + TextureId maskTextureId ) { std::string hashTarget( url ); const size_t urlLength = hashTarget.length(); @@ -1039,22 +1038,6 @@ TextureManager::TextureHash TextureManager::GenerateHash( } } - auto premultipliedIndex = hashTarget.length(); - hashTarget.resize( premultipliedIndex + 1 ); - switch( preMultiplyOnLoad ) - { - case TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD: - { - hashTarget[ premultipliedIndex ] = 't'; - break; - } - case TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY: - { - hashTarget[ premultipliedIndex ] = 'f'; - break; - } - } - return Dali::CalculateHash( hashTarget ); } @@ -1079,21 +1062,24 @@ int TextureManager::FindCachedTexture( { // We have a match, now we check all the original parameters in case of a hash collision. TextureInfo& textureInfo( mTextureInfoContainer[i] ); - auto multiplyOnLoad = textureInfo.preMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD : - TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; if( ( url == textureInfo.url.GetUrl() ) && ( useAtlas == textureInfo.useAtlas ) && ( maskTextureId == textureInfo.maskTextureId ) && ( size == textureInfo.desiredSize ) && - ( preMultiplyOnLoad == multiplyOnLoad ) && ( ( size.GetWidth() == 0 && size.GetHeight() == 0 ) || ( fittingMode == textureInfo.fittingMode && samplingMode == textureInfo.samplingMode ) ) ) { - // The found Texture is a match. - cacheIndex = i; - break; + // 1. If preMultiplyOnLoad is MULTIPLY_ON_LOAD, then textureInfo.preMultiplyOnLoad should be true. The premultiplication result can be different. + // 2. If preMultiplyOnLoad is LOAD_WITHOUT_MULTIPLY, then textureInfo.preMultiplied should be false. + if( ( preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD && textureInfo.preMultiplyOnLoad ) + || ( preMultiplyOnLoad == TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY && !textureInfo.preMultiplied ) ) + { + // The found Texture is a match. + cacheIndex = i; + break; + } } } } diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.h b/dali-toolkit/internal/visuals/texture-manager-impl.h index 502cf11..c64b781 100755 --- a/dali-toolkit/internal/visuals/texture-manager-impl.h +++ b/dali-toolkit/internal/visuals/texture-manager-impl.h @@ -665,8 +665,8 @@ private: TextureHash GenerateHash( const std::string& url, const ImageDimensions size, const FittingMode::Type fittingMode, const Dali::SamplingMode::Type samplingMode, const UseAtlas useAtlas, - TextureId maskTextureId, - MultiplyOnLoad preMultiplyOnLoad); + TextureId maskTextureId ); + /** * @brief Looks up a cached texture by its hash. * If found, the given parameters are used to check there is no hash-collision. diff --git a/dali-toolkit/public-api/accessibility-manager/accessibility-manager.cpp b/dali-toolkit/public-api/accessibility-manager/accessibility-manager.cpp index 79ab14d..e0d7b9a 100644 --- a/dali-toolkit/public-api/accessibility-manager/accessibility-manager.cpp +++ b/dali-toolkit/public-api/accessibility-manager/accessibility-manager.cpp @@ -19,6 +19,7 @@ #include // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -323,6 +324,8 @@ AccessibilityManager::AccessibilityActionSignalType& AccessibilityManager::Actio AccessibilityManager::AccessibilityActionSignalType& AccessibilityManager::ActionReadIndicatorInformationSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ActionReadIndicatorInformationSignal is deprecated and will be removed from next release.\n" ); + return GetImpl(*this).ActionReadIndicatorInformationSignal(); } diff --git a/dali-toolkit/public-api/accessibility-manager/accessibility-manager.h b/dali-toolkit/public-api/accessibility-manager/accessibility-manager.h index e3903e3..a8b2f8e 100755 --- a/dali-toolkit/public-api/accessibility-manager/accessibility-manager.h +++ b/dali-toolkit/public-api/accessibility-manager/accessibility-manager.h @@ -763,6 +763,7 @@ public: AccessibilityActionSignalType& ActionZoomSignal(); /** + * @DEPRECATED_1_4.9 * @brief This is emitted when accessibility action is received to read the information * in the indicator (by two fingers triple tap). * diff --git a/dali-toolkit/public-api/dali-toolkit-version.cpp b/dali-toolkit/public-api/dali-toolkit-version.cpp index 5fb7031..51b0eb9 100644 --- a/dali-toolkit/public-api/dali-toolkit-version.cpp +++ b/dali-toolkit/public-api/dali-toolkit-version.cpp @@ -31,7 +31,7 @@ namespace Toolkit const unsigned int TOOLKIT_MAJOR_VERSION = 1; const unsigned int TOOLKIT_MINOR_VERSION = 4; -const unsigned int TOOLKIT_MICRO_VERSION = 8; +const unsigned int TOOLKIT_MICRO_VERSION = 9; const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index f474f51..4df6e91 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -1,6 +1,6 @@ Name: dali-toolkit Summary: Dali 3D engine Toolkit -Version: 1.4.8 +Version: 1.4.9 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT