From: Shinwoo Kim Date: Fri, 6 Aug 2021 00:41:17 +0000 (+0000) Subject: Merge "[AT-SPI] enhance SHOWING state decision logic" into devel/master X-Git-Tag: dali_2.0.39~7 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=069b358a1eef7132e4ac380ad5b040f378c9568b;hp=22e4cff18fd079527c93d76f1d4f784b25731e12 Merge "[AT-SPI] enhance SHOWING state decision logic" into devel/master --- diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h index 0cfdcc0..fb67a4b 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h @@ -31,9 +31,9 @@ class TestRenderSurface : public Dali::RenderSurfaceInterface { public: - TestRenderSurface( PositionSize positionSize ) {}; + TestRenderSurface( PositionSize positionSize ) : mPositionSize(positionSize) {}; - PositionSize GetPositionSize() const override { PositionSize size; return size; }; + PositionSize GetPositionSize() const override { return mPositionSize; }; virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; } @@ -45,7 +45,7 @@ public: bool ReplaceGraphicsSurface() override { return false; }; - void MoveResize( Dali::PositionSize positionSize ) override {}; + void MoveResize( Dali::PositionSize positionSize ) override { mPositionSize = positionSize; }; void StartRender() override {}; @@ -76,6 +76,9 @@ public: void SetBackgroundColor( Vector4 color ) {}; Vector4 GetBackgroundColor() { return Color::WHITE; }; + +private: + PositionSize mPositionSize; }; namespace Internal @@ -120,7 +123,7 @@ public: Dali::RenderSurfaceInterface& GetRenderSurface(); -private: +protected: TestRenderSurface mRenderSurface; Integration::Scene mScene; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window-impl.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window-impl.h index f443251..a61569f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window-impl.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window-impl.h @@ -29,7 +29,8 @@ namespace Dali { -typedef Dali::Rect PositionSize; +using PositionSize = Dali::Rect; +using WindowPosition = Uint16Pair; namespace Internal { @@ -43,6 +44,12 @@ public: Window( const PositionSize& positionSize ); virtual ~Window() = default; static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent); + + WindowPosition GetPosition() const; + PositionSize GetPositionSize() const; + + void SetPositionSize(PositionSize positionSize); + FocusChangeSignalType mFocusChangeSignal; ResizeSignalType mResizeSignal; int mRotationAngle; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp index 9ab5021..cfdee85 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp @@ -57,6 +57,27 @@ Window* Window::New(const PositionSize& positionSize, const std::string& name, c return new Window( positionSize ); } +WindowPosition Window::GetPosition() const +{ + PositionSize positionSize = mRenderSurface.GetPositionSize(); + + return WindowPosition(positionSize.x, positionSize.y); +} + +PositionSize Window::GetPositionSize() const +{ + return mRenderSurface.GetPositionSize(); +} + +void Window::SetPositionSize(PositionSize positionSize) +{ + mRenderSurface.MoveResize(positionSize); + + Uint16Pair newSize(positionSize.width, positionSize.height); + Dali::Window handle(this); + mResizeSignal.Emit(handle, newSize); +} + } // Adaptor } // Internal @@ -204,8 +225,7 @@ Window DownCast( BaseHandle handle ) void SetPositionSize(Window window, PositionSize positionSize) { - Uint16Pair newSize(positionSize.width, positionSize.height); - GetImplementation( window ).mResizeSignal.Emit(window,newSize); + GetImplementation( window ).SetPositionSize(positionSize); } int GetPhysicalOrientation(Window window) diff --git a/build/tizen/docs-internal/dali-internal.doxy.in b/build/tizen/docs-internal/dali-internal.doxy.in index 5364753..7cf973a 100644 --- a/build/tizen/docs-internal/dali-internal.doxy.in +++ b/build/tizen/docs-internal/dali-internal.doxy.in @@ -2290,14 +2290,11 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = DALI_TOOLKIT_API \ +PREDEFINED = DALI_CORE_API \ + DALI_ADAPTOR_API \ + DALI_TOOLKIT_API \ + DALI_SCENE_LOADER_API \ DALI_INTERNAL \ - __attribute__ \ - ((visibility \ - "(default )))" \ - __attribute__ \ - ((visibility \ - "(hidden )))" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/build/tizen/docs/dali.doxy.in b/build/tizen/docs/dali.doxy.in index 8ef9112..27a21bc 100644 --- a/build/tizen/docs/dali.doxy.in +++ b/build/tizen/docs/dali.doxy.in @@ -2272,12 +2272,6 @@ PREDEFINED = DALI_CORE_API \ DALI_TOOLKIT_API \ DALI_SCENE_LOADER_API \ DALI_INTERNAL \ - __attribute__ \ - ((visibility \ - "(default )))" \ - __attribute__ \ - ((visibility \ - "(hidden )))" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/dali-toolkit/devel-api/focus-manager/focus-finder.cpp b/dali-toolkit/devel-api/focus-manager/focus-finder.cpp index 952c261..a7324b8 100644 --- a/dali-toolkit/devel-api/focus-manager/focus-finder.cpp +++ b/dali-toolkit/devel-api/focus-manager/focus-finder.cpp @@ -37,6 +37,8 @@ namespace FocusFinder { namespace { +static constexpr float FULLY_TRANSPARENT(0.01f); ///< Alpha values must rise above this, before an object is considered to be visible. + static int MajorAxisDistanceRaw(Dali::Toolkit::Control::KeyboardFocus::Direction direction, Dali::Rect source, Dali::Rect dest) { switch(direction) @@ -127,17 +129,15 @@ static int MinorAxisDistance(Dali::Toolkit::Control::KeyboardFocus::Direction di case Dali::Toolkit::Control::KeyboardFocus::RIGHT: { // the distance between the center verticals - return std::abs( - (((source.top + source.bottom) * 0.5f) - - (((dest.top + dest.bottom) * 0.5f)))); + return std::abs((source.top + (source.bottom - source.top) * 0.5f) - + (dest.top + (dest.bottom - dest.top) * 0.5f)); } case Dali::Toolkit::Control::KeyboardFocus::UP: case Dali::Toolkit::Control::KeyboardFocus::DOWN: { // the distance between the center horizontals - return std::abs( - (((source.left + source.right) * 0.5f) - - (((dest.left + dest.right) * 0.5f)))); + return std::abs((source.left + (source.right - source.left) * 0.5f) - + (dest.left + (dest.right - dest.left) * 0.5f)); } default: { @@ -188,19 +188,19 @@ static bool IsCandidate(Dali::Rect srcRect, Dali::Rect destRect, D { case Dali::Toolkit::Control::KeyboardFocus::LEFT: { - return (srcRect.right > destRect.right || srcRect.left >= destRect.right) && srcRect.left > destRect.left; + return (srcRect.right > destRect.right || srcRect.left >= destRect.right); } case Dali::Toolkit::Control::KeyboardFocus::RIGHT: { - return (srcRect.left < destRect.left || srcRect.right <= destRect.left) && srcRect.right < destRect.right; + return (srcRect.left < destRect.left || srcRect.right <= destRect.left); } case Dali::Toolkit::Control::KeyboardFocus::UP: { - return (srcRect.bottom > destRect.bottom || srcRect.top >= destRect.bottom) && srcRect.top > destRect.top; + return (srcRect.bottom > destRect.bottom || srcRect.top >= destRect.bottom); } case Dali::Toolkit::Control::KeyboardFocus::DOWN: { - return (srcRect.top < destRect.top || srcRect.bottom <= destRect.top) && srcRect.bottom < destRect.bottom; + return (srcRect.top < destRect.top || srcRect.bottom <= destRect.top); } default: { @@ -340,6 +340,14 @@ bool IsBetterCandidate(Toolkit::Control::KeyboardFocus::Direction direction, Rec MinorAxisDistance(direction, focusedRect, bestCandidateRect))); } +bool IsFocusable(Actor& actor) +{ + return (actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) && + actor.GetProperty(Actor::Property::VISIBLE) && + actor.GetProperty(Actor::Property::SENSITIVE) && + actor.GetProperty(Actor::Property::WORLD_COLOR).a > FULLY_TRANSPARENT); +} + Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect& focusedRect, Rect& bestCandidateRect, Toolkit::Control::KeyboardFocus::Direction direction) { Actor nearestActor; @@ -350,7 +358,7 @@ Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect& focusedRect, for(auto i = 0u; i < childCount; ++i) { Dali::Actor child = actor.GetChildAt(i); - if(child && child != focusedActor && child.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE)) + if(child && child != focusedActor && IsFocusable(child)) { Rect candidateRect = DevelActor::CalculateScreenExtents(child); diff --git a/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp b/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp index ea10924..64639b5 100644 --- a/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp +++ b/dali-toolkit/internal/image-loader/async-image-loader-impl.cpp @@ -21,9 +21,6 @@ // EXTERNAL INCLUDES #include -// INTERNAL INCLUDES -#include - namespace Dali { namespace Toolkit @@ -74,24 +71,24 @@ uint32_t AsyncImageLoader::Load(const VisualUrl& url, mLoadThread.Start(); mIsLoadThreadStarted = true; } - if(url.IsBufferResource()) - { - auto visualFactory = Toolkit::VisualFactory::Get(); - if(visualFactory) - { - // Get EncodedImageBuffer from texturemanager - // and make new LoadingTask with buffer - auto& textureManager = GetImplementation(visualFactory).GetTextureManager(); + mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); - const EncodedImageBuffer& encodedBuffer = textureManager.GetEncodedImageBuffer(url.GetUrl()); + return mLoadTaskId; +} - mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); - } - } - else +uint32_t AsyncImageLoader::LoadEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad) +{ + if(!mIsLoadThreadStarted) { - mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); + mLoadThread.Start(); + mIsLoadThreadStarted = true; } + mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedImageBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad)); return mLoadTaskId; } diff --git a/dali-toolkit/internal/image-loader/async-image-loader-impl.h b/dali-toolkit/internal/image-loader/async-image-loader-impl.h index 2227711..39e4690 100644 --- a/dali-toolkit/internal/image-loader/async-image-loader-impl.h +++ b/dali-toolkit/internal/image-loader/async-image-loader-impl.h @@ -62,6 +62,23 @@ public: DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad); /** + * @brief Starts an image loading task by encoded image buffer. + * @param[in] encodedImageBuffer The encoded buffer of the image to load + * @param[in] dimensions The width and height to fit the loaded image to + * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter + * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size + * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header + * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha. + * @return The loading task id + */ + uint32_t LoadEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection, + DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad); + + /** * @brief Starts an mask applying task. * @param[in] pixelBuffer of the to be masked image * @param[in] maskPixelBuffer of the mask image diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index dbb1230..c6fc0c2 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -1419,8 +1419,16 @@ void TextureManager::AsyncLoadingHelper::Load(TextureId DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad) { mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId)); - auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad); - mLoadingInfoContainer.back().loadId = id; + if(DALI_UNLIKELY(url.IsBufferResource())) + { + auto id = GetImplementation(mLoader).LoadEncodedImageBuffer(mTextureManager.GetEncodedImageBuffer(url.GetUrl()), desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad); + mLoadingInfoContainer.back().loadId = id; + } + else + { + auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad); + mLoadingInfoContainer.back().loadId = id; + } } void TextureManager::AsyncLoadingHelper::ApplyMask(TextureId textureId, diff --git a/packaging/dali-toolkit.spec b/packaging/dali-toolkit.spec index 632815e..0a4cd44 100644 --- a/packaging/dali-toolkit.spec +++ b/packaging/dali-toolkit.spec @@ -100,12 +100,6 @@ Requires: %{dali2_scene_loader} = %{version}-%{release} %description -n %{dali2_scene_loader}-devel Development components for dali-scene-loader. -############################## -# Preparation -############################## -%prep -%setup -q - %define dali_data_rw_dir %TZ_SYS_SHARE/dali/ %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/ @@ -116,6 +110,16 @@ Development components for dali-scene-loader. %define dali_xml_file_dir %TZ_SYS_RO_PACKAGES +############################## +# Preparation +############################## +%prep +%setup -q + +############################## +# Build +############################## +%build # PO { cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po @@ -126,10 +130,6 @@ do done } &> /dev/null -############################## -# Build -############################## -%build PREFIX="/usr" CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections " LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "