diff options
author | David Steele <david.steele@samsung.com> | 2024-08-09 12:10:05 +0100 |
---|---|---|
committer | David Steele <david.steele@samsung.com> | 2024-08-09 12:10:05 +0100 |
commit | f5fa2a0aff0ebc5a1b718d03cd1341c8f344c441 (patch) | |
tree | 193a08525e5f6dcc29ead539a3d7ca750f970194 /dali | |
parent | 4202bb6872f6e30f2f6624c7c1583d7384296674 (diff) | |
parent | 24653b03f0d479d9fa37b6f9a4dc2c1fc3c642ec (diff) | |
download | dali-adaptor-f5fa2a0aff0ebc5a1b718d03cd1341c8f344c441.tar.gz dali-adaptor-f5fa2a0aff0ebc5a1b718d03cd1341c8f344c441.tar.bz2 dali-adaptor-f5fa2a0aff0ebc5a1b718d03cd1341c8f344c441.zip |
[dali_2.3.36] Merge branch 'devel/master'
Change-Id: I582143693535317d8a55463e8c5b9e128fd72153
Diffstat (limited to 'dali')
24 files changed, 163 insertions, 7 deletions
diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index cb0644e6d..2b96c929d 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -304,6 +304,11 @@ const HoverEvent& GetLastHoverEvent(Window window) return GetImplementation(window).GetLastHoverEvent(); } +GestureState GetLastPanGestureState(Window window) +{ + return GetImplementation(window).GetLastPanGestureState(); +} + bool PointerConstraintsLock(Window window) { return GetImplementation(window).PointerConstraintsLock(); @@ -384,6 +389,11 @@ bool IsAlwaysOnTop(Window window) return GetImplementation(window).IsAlwaysOnTop(); } +Any GetNativeBuffer(Window window) +{ + return GetImplementation(window).GetNativeBuffer(); +} + InterceptKeyEventSignalType& InterceptKeyEventSignal(Window window) { return GetImplementation(window).InterceptKeyEventSignal(); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 51de5ee06..39b75aec9 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include <memory> +#include <dali/public-api/events/gesture-enumerations.h> // INTERNAL INCLUDES #include <dali/devel-api/adaptor-framework/mouse-in-out-event.h> @@ -552,6 +553,14 @@ DALI_ADAPTOR_API const TouchEvent& GetLastTouchEvent(Window window); DALI_ADAPTOR_API const HoverEvent& GetLastHoverEvent(Window window); /** + * @brief Gets the last pan gesture state the window gets. + * + * @param[in] window The window instance. + * @return The last pan gesture state the window gets. + */ +DALI_ADAPTOR_API GestureState GetLastPanGestureState(Window window); + +/** * @brief Sets the pointer constraints lock. * * @param[in] window The window instance. @@ -690,6 +699,14 @@ DALI_ADAPTOR_API void SetAlwaysOnTop(Window window, bool alwaysOnTop); DALI_ADAPTOR_API bool IsAlwaysOnTop(Window window); /** + * @brief Gets the native buffer of the window. + * + * When users call this function, it wraps the actual type used by the underlying window system. + * @return The native buffer of the Window or an empty handle + */ +DALI_ADAPTOR_API Any GetNativeBuffer(Window window); + +/** * @brief The user would connect to this signal to intercept a KeyEvent at window. * * Intercepts KeyEvents in the window before dispatching KeyEvents to the control. diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index e96747dc0..8465ecdbf 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -419,6 +419,17 @@ const Dali::HoverEvent& SceneHolder::GetLastHoverEvent() const return mLastHoverEvent; } +Dali::GestureState SceneHolder::GetLastPanGestureState() +{ + if(DALI_UNLIKELY(!mAdaptorStarted)) + { + DALI_LOG_ERROR("Adaptor is stopped, or not be started yet. Ignore this GetLastPanGestureState.\n"); + return Dali::GestureState::CLEAR; + } + + return mScene.GetLastPanGestureState(); +} + void SceneHolder::FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent) { if(DALI_UNLIKELY(!mAdaptorStarted)) diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 031a7f54a..0ce626c5d 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -29,6 +29,7 @@ #include <dali/public-api/common/intrusive-ptr.h> #include <dali/public-api/events/hover-event.h> #include <dali/public-api/events/touch-event.h> +#include <dali/public-api/events/gesture-enumerations.h> #include <dali/public-api/math/uint-16-pair.h> #include <dali/public-api/object/base-object.h> #include <atomic> @@ -202,6 +203,13 @@ public: const Dali::HoverEvent& GetLastHoverEvent() const; /** + * @brief Gets the last pan gesture state + * + * @return Dali::GestureState + */ + Dali::GestureState GetLastPanGestureState(); + + /** * @copydoc Dali::Integration::SceneHolder::FeedWheelEvent */ void FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent); diff --git a/dali/integration-api/adaptor-framework/shader-precompiler.cpp b/dali/integration-api/adaptor-framework/shader-precompiler.cpp index 7b3da3a9f..1323ff48a 100644 --- a/dali/integration-api/adaptor-framework/shader-precompiler.cpp +++ b/dali/integration-api/adaptor-framework/shader-precompiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 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. @@ -19,11 +19,17 @@ // EXTERNAL INCLUDES #include <dali/integration-api/debug.h> +#include <dali/integration-api/trace.h> + +namespace +{ +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false); +} namespace Dali { std::unique_ptr<ShaderPreCompiler> ShaderPreCompiler::mInstance = nullptr; -std::once_flag ShaderPreCompiler::mOnceFlag; +std::once_flag ShaderPreCompiler::mOnceFlag; ShaderPreCompiler::ShaderPreCompiler() : mRawShaderList(), @@ -34,8 +40,7 @@ ShaderPreCompiler::ShaderPreCompiler() ShaderPreCompiler& ShaderPreCompiler::Get() { - std::call_once(mOnceFlag, []() - { mInstance.reset(new ShaderPreCompiler); }); + std::call_once(mOnceFlag, []() { mInstance.reset(new ShaderPreCompiler); }); return *(mInstance.get()); } @@ -54,7 +59,8 @@ void ShaderPreCompiler::GetPreCompileShaderList(std::vector<RawShaderData>& shad void ShaderPreCompiler::SavePreCompileShaderList(std::vector<RawShaderData>& shaderList) { mRawShaderList = shaderList; - mPrecompiled = true; + mPrecompiled = true; + DALI_LOG_RELEASE_INFO("Precompile shader list is saved! Precompile available now\n"); Awake(); } @@ -84,13 +90,15 @@ void ShaderPreCompiler::Wait() } } + DALI_TRACE_BEGIN(gTraceFilter, "DALI_SHADER_PRECOMPILE_WAIT"); mConditionalWait.Wait(lock); + DALI_TRACE_END(gTraceFilter, "DALI_SHADER_PRECOMPILE_WAIT"); } void ShaderPreCompiler::Awake() { ConditionalWait::ScopedLock lock(mConditionalWait); - Dali::Mutex::ScopedLock mutexLock(mMutex); + Dali::Mutex::ScopedLock mutexLock(mMutex); mNeedsSleep = false; mConditionalWait.Notify(lock); } diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 85d5cb986..70691014b 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -592,6 +592,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() ShaderPreCompiler::Get().Wait(); if(ShaderPreCompiler::Get().IsEnable()) { + TRACE_UPDATE_RENDER_BEGIN("DALI_PRECOMPILE_SHADER"); std::vector<RawShaderData> precompiledShaderList; ShaderPreCompiler::Get().GetPreCompileShaderList(precompiledShaderList); DALI_LOG_RELEASE_INFO("ShaderPreCompiler[ENABLE], list size:%d \n", precompiledShaderList.size()); @@ -613,6 +614,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() } DALI_LOG_RELEASE_INFO("ShaderPreCompiler[ENABLE], shader count :%d \n", numberOfPrecompiledShader); } + TRACE_UPDATE_RENDER_END("DALI_PRECOMPILE_SHADER"); } else { @@ -1092,6 +1094,7 @@ void CombinedUpdateRenderController::CancelPreCompile() { mIsPreCompileCancelled = TRUE; ShaderPreCompiler::Get().Awake(); + DALI_LOG_RELEASE_INFO("CancelPreCompile()\n"); } } diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index a537e1e8c..0d7937f94 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -516,6 +516,11 @@ bool WindowBaseAndroid::IsAlwaysOnTop() return false; } +Any WindowBaseAndroid::GetNativeBuffer() const +{ + return 0; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index 3463e3e7a..e5f8e91a6 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -539,6 +539,11 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + private: /** * Second stage initialization diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 0d87a7ec9..720c91e1f 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -593,6 +593,12 @@ public: */ virtual bool IsAlwaysOnTop() = 0; + /** + * @brief Get native buffer of window. + * @return The native window buffer handle + */ + virtual Any GetNativeBuffer() const = 0; + // Signals /** diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 55e478867..867abc6d0 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -574,6 +574,10 @@ void Window::Show() if(!mIconified) { Dali::Window handle(this); + + // mScene should be shown here because Scene::IsVisible need to be returned true in the Window::VisibilityChangedSignal + mScene.Show(); + mVisibilityChangedSignal.Emit(handle, true); Dali::Accessibility::Bridge::GetCurrentBridge()->WindowShown(handle); @@ -595,6 +599,10 @@ void Window::Hide() if(!mIconified) { Dali::Window handle(this); + + // mScene should be hidden here because Scene::IsVisible need to be returned false in the Window::VisibilityChangedSignal + mScene.Hide(); + mVisibilityChangedSignal.Emit(handle, false); Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(handle); @@ -946,6 +954,8 @@ void Window::OnIconifyChanged(bool iconified) if(mVisible) { + mScene.Hide(); + mVisibilityChangedSignal.Emit(handle, false); bridge->WindowHidden(handle); @@ -966,6 +976,8 @@ void Window::OnIconifyChanged(bool iconified) if(mVisible) { + mScene.Show(); + mVisibilityChangedSignal.Emit(handle, true); bridge->WindowShown(handle); @@ -1600,6 +1612,10 @@ bool Window::IsAlwaysOnTop() return mWindowBase->IsAlwaysOnTop(); } +Dali::Any Window::GetNativeBuffer() const +{ + return mWindowBase->GetNativeBuffer(); +} } // namespace Adaptor diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index e8c294ee4..8bd92ce08 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -602,6 +602,11 @@ public: // Dali::Internal::Adaptor::SceneHolder */ bool IsAlwaysOnTop(); + /** + * @copydoc Dali::DevelWindow::GetNativeBuffer() + */ + Dali::Any GetNativeBuffer() const; + private: /** * @brief Enumeration for orietation mode. diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index d01c21321..4fd0d4b91 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -473,6 +473,12 @@ public: */ void SetWindowFrontBufferMode(bool enable) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + + private: // Undefined WindowBaseCocoa(const WindowBaseCocoa&) = delete; diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index a9b72ab6b..e6cf591a9 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -824,6 +824,11 @@ bool WindowBaseCocoa::IsAlwaysOnTop() return false; } +Any WindowBaseCocoa::GetNativeBuffer() const +{ + return 0; +} + } // namespace Dali::Internal::Adaptor @implementation CocoaView diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index d2263909f..e2139bf08 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -2238,6 +2238,11 @@ void WindowBaseEcoreWl::SetWindowFrontBufferMode(bool enable) { } +Any WindowBaseEcoreWl::GetNativeWindow() +{ + return mEglWindow; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index cdea92932..54729b2dd 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -575,6 +575,11 @@ public: */ void SetWindowFrontBufferMode(bool enable) override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + private: /** * Second stage initialization diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index deb8ff62c..87f4083f4 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -3700,6 +3700,12 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop() return ret; } +Any WindowBaseEcoreWl2::GetNativeBuffer() const +{ + DALI_LOG_RELEASE_INFO("Get wl_egl_window, ecore_window: [%p], wl_egl_window [%p]\n", mEcoreWindow, mEglWindow); + return mEglWindow; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index a9817a628..bc3b10e3e 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -682,6 +682,11 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + private: /** * Second stage initialization diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 222526536..282e85f11 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -1110,6 +1110,11 @@ bool WindowBaseEcoreX::IsAlwaysOnTop() return false; } +Any WindowBaseEcoreX::GetNativeBuffer() const +{ + return 0; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index a2982aad3..ecf678438 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -544,6 +544,11 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + private: /** * Second stage initialization diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index a5be4e85c..6dd43985d 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -744,6 +744,11 @@ bool WindowBaseWin::IsAlwaysOnTop() return false; } +Any WindowBaseWin::GetNativeBuffer() const +{ + return 0; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index d5664dbf3..ef82697e8 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -526,6 +526,11 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() override; + private: /** * Second stage initialization diff --git a/dali/internal/window-system/x11/window-base-x.cpp b/dali/internal/window-system/x11/window-base-x.cpp index 217d6e88a..616b8cefc 100644 --- a/dali/internal/window-system/x11/window-base-x.cpp +++ b/dali/internal/window-system/x11/window-base-x.cpp @@ -1044,6 +1044,11 @@ bool WindowBaseX::IsAlwaysOnTop() return false; } +Any WindowBaseX::GetNativeBuffer() +{ + return 0; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/x11/window-base-x.h b/dali/internal/window-system/x11/window-base-x.h index fe814a4e9..9c98f7c85 100644 --- a/dali/internal/window-system/x11/window-base-x.h +++ b/dali/internal/window-system/x11/window-base-x.h @@ -549,6 +549,11 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() + */ + Any GetNativeBuffer() const override; + private: /** * Second stage initialization diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index 8de1c15d3..2e60cabb4 100644 --- a/dali/public-api/dali-adaptor-version.cpp +++ b/dali/public-api/dali-adaptor-version.cpp @@ -27,7 +27,7 @@ namespace Dali { const unsigned int ADAPTOR_MAJOR_VERSION = 2; const unsigned int ADAPTOR_MINOR_VERSION = 3; -const unsigned int ADAPTOR_MICRO_VERSION = 35; +const unsigned int ADAPTOR_MICRO_VERSION = 36; const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED |