From: Seoyeon Kim Date: Fri, 27 May 2022 02:12:33 +0000 (+0900) Subject: Merge branch 'devel/master' into tizen X-Git-Tag: accepted/tizen/unified/20220531.143815~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=666559e578423c202a1c444391e1a6bf1cf7e5a5;hp=b7fe991a69ed2f9daae09463deea6bcedc0a19c4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge branch 'devel/master' into tizen Change-Id: I3b4832f2644c224a5398fa4ac196ef2456d78ce0 --- diff --git a/dali/devel-api/adaptor-framework/accessibility-bridge.h b/dali/devel-api/adaptor-framework/accessibility-bridge.h index 21296d3..1b59436 100644 --- a/dali/devel-api/adaptor-framework/accessibility-bridge.h +++ b/dali/devel-api/adaptor-framework/accessibility-bridge.h @@ -132,6 +132,15 @@ struct DALI_ADAPTOR_API Bridge virtual void SetApplicationName(std::string name) = 0; /** + * @brief Sets the name of the GUI toolkit that AT-SPI clients can query. + * + * The default name is "dali". + * + * @param toolkitName The toolkit name + */ + virtual void SetToolkitName(std::string_view toolkitName) = 0; + + /** * @brief Gets object being root of accessibility tree. * * @return handler to accessibility object @@ -357,6 +366,41 @@ struct DALI_ADAPTOR_API Bridge virtual bool IsEnabled() = 0; /** + * @brief Calls socket.Embed(plug) via D-Bus. + * + * @param[in] plug The plug + * @param[in] socket The socket + * + * @return Address returned by the D-Bus call. + * + * @note Remote object pointed to by 'socket' must implement 'org.a11y.atspi.Socket'. + * @see UnembedSocket() + */ + virtual Address EmbedSocket(const Address& plug, const Address& socket) = 0; + + /** + * @brief Calls socket.Embedded(plug) via D-Bus. + * + * The "Embedded" D-Bus method is an ATK extension. + * See 'impl_Embedded' in AT_SPI2_ATK/atk-adaptor/adaptors/socket-adaptor.c for more information. + * + * @param[in] plug The plug + * @param[in] socket The socket + */ + virtual void EmbedAtkSocket(const Address& plug, const Address& socket) = 0; + + /** + * @brief Calls socket.Unmbed(plug) via D-Bus. + * + * @param[in] plug The plug + * @param[in] socket The socket + * + * @note Remote object pointed to by 'socket' must implement 'org.a11y.atspi.Socket'. + * @see EmbedSocket() + */ + virtual void UnembedSocket(const Address& plug, const Address& socket) = 0; + + /** * @brief Returns instance of bridge singleton object. * * @return The current bridge object diff --git a/dali/devel-api/adaptor-framework/accessibility.h b/dali/devel-api/adaptor-framework/accessibility.h index f3576c6..77c7257 100644 --- a/dali/devel-api/adaptor-framework/accessibility.h +++ b/dali/devel-api/adaptor-framework/accessibility.h @@ -30,6 +30,8 @@ namespace Dali { namespace Accessibility { +class Accessible; + /** * @brief Enumeration describing type of object move relative to the screen. Only outgoing moves are signalled to AT-clients. */ @@ -711,22 +713,26 @@ struct DALI_ADAPTOR_API GestureInfo /** * @brief Class representing accessibility relations + * * Class connecting one source object with multiple target objects with usage * of specific relation type. - * @note std::string representing source and targets are string values of Accessibility::Address - * @see Dali::Accessibility::Accessible::Address + * + * A remote target object (i.e. one belonging to a different process) can be + * represented in terms of a ProxyAccessible. + * + * @see Dali::Accessibility::Accessible::Accessible * @see Dali::Accessibility::Accessible::RelationType */ struct DALI_ADAPTOR_API Relation { - Relation(RelationType relationType, std::vector
targets) - : relationType(relationType), - targets(targets) + Relation(RelationType relationType, const std::vector& targets) + : mRelationType(relationType), + mTargets(targets) { } - RelationType relationType; - std::vector
targets; + RelationType mRelationType; + std::vector mTargets; }; } // namespace Accessibility diff --git a/dali/devel-api/adaptor-framework/vector-image-renderer.cpp b/dali/devel-api/adaptor-framework/vector-image-renderer.cpp index bf69063..79fe80c 100644 --- a/dali/devel-api/adaptor-framework/vector-image-renderer.cpp +++ b/dali/devel-api/adaptor-framework/vector-image-renderer.cpp @@ -47,6 +47,11 @@ bool VectorImageRenderer::Load(const Vector& data, float dpi) return GetImplementation(*this).Load(data, dpi); } +bool VectorImageRenderer::IsLoaded() const +{ + return GetImplementation(*this).IsLoaded(); +} + Dali::Devel::PixelBuffer VectorImageRenderer::Rasterize(uint32_t width, uint32_t height) { return GetImplementation(*this).Rasterize(width, height); diff --git a/dali/devel-api/adaptor-framework/vector-image-renderer.h b/dali/devel-api/adaptor-framework/vector-image-renderer.h index f11220d..ab59195 100644 --- a/dali/devel-api/adaptor-framework/vector-image-renderer.h +++ b/dali/devel-api/adaptor-framework/vector-image-renderer.h @@ -86,6 +86,13 @@ public: bool Load(const Vector& data, float dpi); /** + * @brief Query whether the vector image is loaded. + * + * @return True if the image is loaded, false other wise. + */ + bool IsLoaded() const; + + /** * @brief Rasterizes the content to the pixel buffer synchronously. * * @param[in] width The pixel buffer width diff --git a/dali/internal/accessibility/bridge/bridge-accessible.cpp b/dali/internal/accessibility/bridge/bridge-accessible.cpp index 5f71a60..a7ecf8e 100644 --- a/dali/internal/accessibility/bridge/bridge-accessible.cpp +++ b/dali/internal/accessibility/bridge/bridge-accessible.cpp @@ -107,7 +107,7 @@ static bool AcceptObjectCheckRelations(Component* obj) for(const auto& it : relations) { - if(it.relationType == RelationType::CONTROLLED_BY) + if(it.mRelationType == RelationType::CONTROLLED_BY) { return false; } @@ -437,11 +437,11 @@ Component* BridgeAccessible::GetObjectInRelation(Accessible* obj, RelationType r for(auto& relation : obj->GetRelationSet()) { - if(relation.relationType == relationType) + if(relation.mRelationType == relationType) { - for(auto& address : relation.targets) + for(auto& target : relation.mTargets) { - auto component = dynamic_cast(Find(address)); + auto component = dynamic_cast(target); if(component) { return component; @@ -504,9 +504,9 @@ BridgeAccessible::ReadingMaterialType BridgeAccessible::GetReadingMaterial() auto relation = std::find_if(relations.begin(), relations.end(), [relationType](const Dali::Accessibility::Relation& relation) -> bool { - return relation.relationType == relationType; + return relation.mRelationType == relationType; }); - return relations.end() != relation && !relation->targets.empty() ? Find(relation->targets.back()) : nullptr; + return relations.end() != relation && !relation->mTargets.empty() ? relation->mTargets.back() : nullptr; }; auto labellingObject = findObjectByRelationType(RelationType::LABELLED_BY); @@ -1061,7 +1061,7 @@ DBus::ValueOrError> BridgeAccessible::Ge for(auto& it : relations) { - ret.emplace_back(Relation{static_cast(it.relationType), it.targets}); + ret.emplace_back(Relation{static_cast(it.mRelationType), it.mTargets}); } return ret; diff --git a/dali/internal/accessibility/bridge/bridge-accessible.h b/dali/internal/accessibility/bridge/bridge-accessible.h index 219c530..0a3299c 100644 --- a/dali/internal/accessibility/bridge/bridge-accessible.h +++ b/dali/internal/accessibility/bridge/bridge-accessible.h @@ -91,7 +91,7 @@ public: Dali::Accessibility::Accessible* // describedByObject >; - using Relation = std::tuple>; + using Relation = std::tuple>; /** * @copydoc Dali::Accessibility::Accessible::GetChildCount() diff --git a/dali/internal/accessibility/bridge/bridge-base.h b/dali/internal/accessibility/bridge/bridge-base.h index bf2a22c..2449842 100644 --- a/dali/internal/accessibility/bridge/bridge-base.h +++ b/dali/internal/accessibility/bridge/bridge-base.h @@ -41,6 +41,7 @@ public: Dali::Accessibility::ProxyAccessible mParent; std::vector mChildren; std::string mName; + std::string mToolkitName{"dali"}; std::string GetName() const override { @@ -148,7 +149,7 @@ public: std::string GetToolkitName() const override { - return {"dali"}; + return mToolkitName; } std::string GetVersion() const override @@ -484,6 +485,14 @@ public: mApplication.mName = std::move(name); } + /** + * @copydoc Dali::Accessibility::Bridge::SetToolkitName() + */ + void SetToolkitName(std::string_view toolkitName) override + { + mApplication.mToolkitName = std::string{toolkitName}; + } + protected: mutable ApplicationAccessible mApplication; std::vector mDefaultLabels; diff --git a/dali/internal/accessibility/bridge/bridge-impl.cpp b/dali/internal/accessibility/bridge/bridge-impl.cpp index c48240c..551a89a 100644 --- a/dali/internal/accessibility/bridge/bridge-impl.cpp +++ b/dali/internal/accessibility/bridge/bridge-impl.cpp @@ -227,7 +227,9 @@ public: mData->mHighlightActor = {}; mDisabledSignal.Emit(); + UnembedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"}); } + mHighlightedActor = {}; mHighlightClearAction = {}; BridgeAccessible::ForceDown(); @@ -351,17 +353,8 @@ public: } }); - auto proxy = DBus::DBusClient{AtspiDbusNameRegistry, AtspiDbusPathRoot, Accessible::GetInterfaceName(AtspiInterface::SOCKET), mConnectionPtr}; - Address root{"", "root"}; - auto res = proxy.method("Embed").call(root); - if(!res) - { - LOG() << "Call to Embed failed: " << res.getError().message; - } - assert(res); - - mApplication.mParent.SetAddress(std::move(std::get<0>(res))); - + auto parentAddress = EmbedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"}); + mApplication.mParent.SetAddress(std::move(parentAddress)); mEnabledSignal.Emit(); return ForceUpResult::JUST_STARTED; @@ -693,6 +686,40 @@ public: { return mIsEnabled; } + + Address EmbedSocket(const Address& plug, const Address& socket) override + { + auto client = CreateSocketClient(socket); + auto reply = client.method("Embed").call(plug); + + if(!reply) + { + DALI_LOG_ERROR("Failed to embed socket %s: %s", socket.ToString().c_str(), reply.getError().message.c_str()); + return {}; + } + + return std::get<0>(reply.getValues()); + } + + void EmbedAtkSocket(const Address& plug, const Address& socket) override + { + auto client = CreateSocketClient(socket); + + client.method("Embedded").call(ATSPI_PREFIX_PATH + plug.GetPath()); + } + + void UnembedSocket(const Address& plug, const Address& socket) override + { + auto client = CreateSocketClient(socket); + + client.method("Unembed").call(plug); + } + +private: + DBus::DBusClient CreateSocketClient(const Address& socket) + { + return {socket.GetBus(), ATSPI_PREFIX_PATH + socket.GetPath(), Accessible::GetInterfaceName(AtspiInterface::SOCKET), mConnectionPtr}; + } }; // BridgeImpl namespace // unnamed namespace diff --git a/dali/internal/accessibility/bridge/dummy-atspi.h b/dali/internal/accessibility/bridge/dummy-atspi.h index 4fd0678..911b9da 100644 --- a/dali/internal/accessibility/bridge/dummy-atspi.h +++ b/dali/internal/accessibility/bridge/dummy-atspi.h @@ -63,6 +63,10 @@ struct DummyBridge : Dali::Accessibility::Bridge { } + void SetToolkitName(std::string_view toolkitName) override + { + } + Accessibility::Accessible* GetApplication() const override { return nullptr; @@ -176,6 +180,19 @@ struct DummyBridge : Dali::Accessibility::Bridge { return false; } + + Address EmbedSocket(const Address& plug, const Address& socket) override + { + return {}; + } + + void EmbedAtkSocket(const Address& plug, const Address& socket) override + { + } + + void UnembedSocket(const Address& plug, const Address& socket) override + { + } }; } // namespace Dali::Accessibility diff --git a/dali/internal/graphics/common/egl-image-extensions.h b/dali/internal/graphics/common/egl-image-extensions.h index b68f218..5ff8d2c 100644 --- a/dali/internal/graphics/common/egl-image-extensions.h +++ b/dali/internal/graphics/common/egl-image-extensions.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_EGL_IMAGE_EXTENSIONS_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -76,6 +76,9 @@ public: // EGLImageKHR extension support void InitializeEglImageKHR(); private: + struct Impl; + Impl* mImpl{nullptr}; + EglImplementation* mEglImplementation; bool mImageKHRInitialized; ///< Flag for whether extended KHR functions loaded diff --git a/dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp b/dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp index 9beaccc..cf79bdb 100644 --- a/dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp +++ b/dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -25,6 +25,10 @@ #include +#include +#include +#include + #include // INTERNAL INCLUDES @@ -41,6 +45,10 @@ namespace PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHRProc = 0; PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHRProc = 0; PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOESProc = 0; + +const std::string EGL_TIZEN_IMAGE_NATIVE_SURFACE = "EGL_TIZEN_image_native_surface"; +const std::string EGL_EXT_IMAGE_DMA_BUF_IMPORT = "EGL_EXT_image_dma_buf_import"; + } // unnamed namespace namespace Dali @@ -49,8 +57,15 @@ namespace Internal { namespace Adaptor { +struct EglImageExtensions::Impl +{ + bool mIsTizenImageNativeSurfaceSupported{false}; + bool mIsExtImageDmaBufImportSupported{false}; +}; + EglImageExtensions::EglImageExtensions(EglImplementation* eglImpl) -: mEglImplementation(eglImpl), +: mImpl(new Impl()), + mEglImplementation(eglImpl), mImageKHRInitialized(false), mImageKHRInitializeFailed(false) { @@ -59,6 +74,7 @@ EglImageExtensions::EglImageExtensions(EglImplementation* eglImpl) EglImageExtensions::~EglImageExtensions() { + delete mImpl; } void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) @@ -73,16 +89,55 @@ void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer) return NULL; } + EGLImageKHR eglImage = EGL_NO_IMAGE_KHR; + // Use the EGL image extension - const EGLint attribs[] = + if(mImpl->mIsTizenImageNativeSurfaceSupported) + { + // If EGL_TIZEN_image_native_surface is supported + const EGLint attribs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; + + eglImage = eglCreateImageKHRProc(mEglImplementation->GetDisplay(), + EGL_NO_CONTEXT, + EGL_NATIVE_SURFACE_TIZEN, + clientBuffer, + attribs); + } + else if(mImpl->mIsExtImageDmaBufImportSupported) + { + // Else then use EGL_EXT_image_dma_buf_import + tbm_surface_info_s info; + tbm_surface_h tbmSurface = reinterpret_cast(clientBuffer); + + if(tbm_surface_get_info(tbmSurface, &info) != TBM_SURFACE_ERROR_NONE) { - EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; + return NULL; + } + + // We support only 1 plane + tbm_bo tbmBo = tbm_surface_internal_get_bo(tbmSurface, tbm_surface_internal_get_plane_bo_idx(tbmSurface, 0)); - EGLImageKHR eglImage = eglCreateImageKHRProc(mEglImplementation->GetDisplay(), - EGL_NO_CONTEXT, - EGL_NATIVE_SURFACE_TIZEN, - clientBuffer, - attribs); + // clang-format off + const EGLint attribs[] = {EGL_WIDTH, static_cast(info.width), + EGL_HEIGHT, static_cast(info.height), + EGL_LINUX_DRM_FOURCC_EXT, static_cast(info.format), + EGL_DMA_BUF_PLANE0_FD_EXT, static_cast(reinterpret_cast(tbm_bo_get_handle(tbmBo, TBM_DEVICE_3D).ptr)), + EGL_DMA_BUF_PLANE0_OFFSET_EXT, static_cast(info.planes[0].offset), + EGL_DMA_BUF_PLANE0_PITCH_EXT, static_cast(info.planes[0].stride), + EGL_NONE}; + // clang-format on + + eglImage = eglCreateImageKHRProc(mEglImplementation->GetDisplay(), + EGL_NO_CONTEXT, + EGL_LINUX_DMA_BUF_EXT, + nullptr, + attribs); + } + else + { + DALI_LOG_ERROR("Not supported\n"); + return EGL_NO_IMAGE_KHR; + } if(EGL_NO_IMAGE_KHR == eglImage) { @@ -220,6 +275,20 @@ void EglImageExtensions::InitializeEglImageKHR() { mImageKHRInitializeFailed = true; } + + std::string extensionStr = eglQueryString(mEglImplementation->GetDisplay(), EGL_EXTENSIONS); + + auto found = extensionStr.find(EGL_TIZEN_IMAGE_NATIVE_SURFACE); + if(found != std::string::npos) + { + mImpl->mIsTizenImageNativeSurfaceSupported = true; + } + + found = extensionStr.find(EGL_EXT_IMAGE_DMA_BUF_IMPORT); + if(found != std::string::npos) + { + mImpl->mIsExtImageDmaBufImportSupported = true; + } } } // namespace Adaptor diff --git a/dali/internal/imaging/common/alpha-mask.cpp b/dali/internal/imaging/common/alpha-mask.cpp index 9abdfec..276751a 100644 --- a/dali/internal/imaging/common/alpha-mask.cpp +++ b/dali/internal/imaging/common/alpha-mask.cpp @@ -18,7 +18,7 @@ #include #include #include -#include // For ImageDimensions +#include // For ImageDimensions and MultiplyAndNormalizeColor namespace Dali { @@ -85,7 +85,7 @@ void ApplyMaskToAlphaChannel(PixelBuffer& buffer, const PixelBuffer& mask) for(const Channel& channel : validChannelList) { auto color = ReadChannel(destBuffer + destOffset, destPixelFormat, channel); - WriteChannel(destBuffer + destOffset, destPixelFormat, channel, color * srcAlpha / 255); + WriteChannel(destBuffer + destOffset, destPixelFormat, channel, Platform::MultiplyAndNormalizeColor(color, srcAlpha)); } } else @@ -112,10 +112,10 @@ void ApplyMaskToAlphaChannel(PixelBuffer& buffer, const PixelBuffer& mask) for(unsigned int col = 0; col < buffer.GetWidth(); ++col) { - unsigned char srcAlpha = srcBuffer[srcOffset + srcAlphaByteOffset] & srcAlphaMask; - unsigned char destAlpha = destBuffer[destOffset + destAlphaByteOffset] & destAlphaMask; + uint8_t srcAlpha = srcBuffer[srcOffset + srcAlphaByteOffset] & srcAlphaMask; + uint8_t destAlpha = destBuffer[destOffset + destAlphaByteOffset] & destAlphaMask; - destAlpha = (static_cast(destAlpha) * static_cast(srcAlpha)) / 255; + destAlpha = Platform::MultiplyAndNormalizeColor(srcAlpha, destAlpha); destBuffer[destOffset + destAlphaByteOffset] &= ~destAlphaMask; destBuffer[destOffset + destAlphaByteOffset] |= (destAlpha & destAlphaMask); @@ -184,7 +184,7 @@ PixelBufferPtr CreateNewMaskedBuffer(const PixelBuffer& buffer, const PixelBuffe if(hasAlpha) { destAlpha = ConvertAlphaChannelToA8(oldBuffer, srcColorOffset, srcColorPixelFormat); - destAlpha = (static_cast(destAlpha) * static_cast(srcAlpha)) / 255; + destAlpha = Platform::MultiplyAndNormalizeColor(srcAlpha, destAlpha); } else { diff --git a/dali/internal/imaging/common/image-operations.h b/dali/internal/imaging/common/image-operations.h index fd330a0..57d1255 100644 --- a/dali/internal/imaging/common/image-operations.h +++ b/dali/internal/imaging/common/image-operations.h @@ -694,6 +694,19 @@ inline unsigned int BilinearFilter1Component(unsigned int tl, unsigned int tr, u return rounded; } +/** + * @brief Fast multiply & divide by 255. It wiil be useful when we applying alpha value in color + * + * @param x The value between [0..255] + * @param y The value between [0..255] + * @return (x*y)/255 + */ +inline uint8_t MultiplyAndNormalizeColor(const uint8_t& x, const uint8_t& y) noexcept +{ + const uint32_t xy = static_cast(x) * y; + return ((xy << 15) + (xy << 7) + xy) >> 23; +} + /**@}*/ } /* namespace Platform */ diff --git a/dali/internal/imaging/common/loader-png.cpp b/dali/internal/imaging/common/loader-png.cpp index ae63822..c9a5866 100644 --- a/dali/internal/imaging/common/loader-png.cpp +++ b/dali/internal/imaging/common/loader-png.cpp @@ -371,7 +371,7 @@ extern "C" void WriteData(png_structp png_ptr, png_bytep data, png_size_t length if(encoded_img) { const Vector::SizeType bufferSize = encoded_img->Count(); - encoded_img->Resize(bufferSize + length); //< Can throw OOM. + encoded_img->ResizeUninitialized(bufferSize + length); //< Can throw OOM. unsigned char* const bufferBack = encoded_img->Begin() + bufferSize; memcpy(bufferBack, data, length); } diff --git a/dali/internal/imaging/common/loader-webp.cpp b/dali/internal/imaging/common/loader-webp.cpp index 3749127..25a24d6 100644 --- a/dali/internal/imaging/common/loader-webp.cpp +++ b/dali/internal/imaging/common/loader-webp.cpp @@ -55,7 +55,7 @@ bool LoadBitmapFromWebp(const Dali::ImageLoader::Input& input, Dali::Devel::Pixe if(webPLoading) { Dali::Devel::PixelBuffer pixelBuffer = webPLoading.LoadFrame(FIRST_FRAME_INDEX); - if(pixelBuffer && webPLoading.HasLoadingSucceeded()) + if(pixelBuffer) { bitmap = pixelBuffer; return true; diff --git a/dali/internal/imaging/common/pixel-buffer-impl.cpp b/dali/internal/imaging/common/pixel-buffer-impl.cpp index f2594ac..533db68 100644 --- a/dali/internal/imaging/common/pixel-buffer-impl.cpp +++ b/dali/internal/imaging/common/pixel-buffer-impl.cpp @@ -486,7 +486,7 @@ void PixelBuffer::MultiplyColorByAlpha() for(const Channel& channel : validChannelList) { auto color = ReadChannel(&pixel[x], mPixelFormat, channel); - WriteChannel(&pixel[x], mPixelFormat, channel, color * alpha / 255); + WriteChannel(&pixel[x], mPixelFormat, channel, Platform::MultiplyAndNormalizeColor(color, alpha)); } } else diff --git a/dali/internal/imaging/common/webp-loading.cpp b/dali/internal/imaging/common/webp-loading.cpp index a5b8dab..61baf2a 100644 --- a/dali/internal/imaging/common/webp-loading.cpp +++ b/dali/internal/imaging/common/webp-loading.cpp @@ -237,6 +237,8 @@ public: free((void*)mBuffer); mBuffer = nullptr; } + + mLoadSucceeded = false; } // Moveable but not copyable diff --git a/dali/internal/vector-image/common/vector-image-renderer-impl.cpp b/dali/internal/vector-image/common/vector-image-renderer-impl.cpp index deec3c4..feb8b5a 100644 --- a/dali/internal/vector-image/common/vector-image-renderer-impl.cpp +++ b/dali/internal/vector-image/common/vector-image-renderer-impl.cpp @@ -110,7 +110,7 @@ void VectorImageRenderer::Initialize() mSwCanvas->mempool(tvg::SwCanvas::MempoolPolicy::Individual); mSwCanvas->reserve(1); //has one picture #else - mRasterizer = nsvgCreateRasterizer(); + mRasterizer = nsvgCreateRasterizer(); #endif } @@ -132,6 +132,10 @@ bool VectorImageRenderer::Load(const Vector& data, float dpi) return false; } } + else + { + return true; + } tvg::Result ret = mPicture->load(reinterpret_cast(data.Begin()), data.Size(), true); @@ -170,6 +174,11 @@ bool VectorImageRenderer::Load(const Vector& data, float dpi) return true; #else + if(mParsedImage) + { + return true; + } + mParsedImage = nsvgParse(reinterpret_cast(data.Begin()), UNITS, dpi); if(!mParsedImage || !mParsedImage->shapes) { @@ -184,6 +193,15 @@ bool VectorImageRenderer::Load(const Vector& data, float dpi) #endif } +bool VectorImageRenderer::IsLoaded() const +{ +#ifdef THORVG_SUPPORT + return mPicture ? true : false; +#else + return mParsedImage ? true : false; +#endif +} + Dali::Devel::PixelBuffer VectorImageRenderer::Rasterize(uint32_t width, uint32_t height) { if(width == 0) diff --git a/dali/internal/vector-image/common/vector-image-renderer-impl.h b/dali/internal/vector-image/common/vector-image-renderer-impl.h index ccc9301..19ae0c1 100644 --- a/dali/internal/vector-image/common/vector-image-renderer-impl.h +++ b/dali/internal/vector-image/common/vector-image-renderer-impl.h @@ -62,6 +62,11 @@ public: bool Load(const Vector& data, float dpi); /** + * @copydoc Dali::VectorImageRenderer::IsLoaded() + */ + bool IsLoaded() const; + + /** * @copydoc Dali::VectorImageRenderer::Rasterize() */ Dali::Devel::PixelBuffer Rasterize(uint32_t width, uint32_t height); 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 d09451c..9bc72f5 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 @@ -1030,6 +1030,8 @@ void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event) mWindowPositionSize.height = newHeight; DALI_LOG_RELEASE_INFO("Update position & resize signal by server, current angle [%d] x[%d] y[%d] w[%d] h[%d]\n", mWindowRotationAngle, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height); + ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height); + Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize); DALI_LOG_RELEASE_INFO("emit signal to update window's position and size, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height); mUpdatePositionSizeSignal.Emit(newPositionSize); diff --git a/dali/public-api/dali-adaptor-version.cpp b/dali/public-api/dali-adaptor-version.cpp index aeea3d8..81e1fcf 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 = 1; -const unsigned int ADAPTOR_MICRO_VERSION = 21; +const unsigned int ADAPTOR_MICRO_VERSION = 23; const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 4304e73..1266b9a 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -17,7 +17,7 @@ Name: dali2-adaptor Summary: The DALi Tizen Adaptor -Version: 2.1.21 +Version: 2.1.23 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT