Merge branch 'devel/master' into tizen
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 27 May 2022 02:12:33 +0000 (11:12 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 27 May 2022 02:12:33 +0000 (11:12 +0900)
Change-Id: I3b4832f2644c224a5398fa4ac196ef2456d78ce0

22 files changed:
dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/accessibility.h
dali/devel-api/adaptor-framework/vector-image-renderer.cpp
dali/devel-api/adaptor-framework/vector-image-renderer.h
dali/internal/accessibility/bridge/bridge-accessible.cpp
dali/internal/accessibility/bridge/bridge-accessible.h
dali/internal/accessibility/bridge/bridge-base.h
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/accessibility/bridge/dummy-atspi.h
dali/internal/graphics/common/egl-image-extensions.h
dali/internal/graphics/tizen/egl-image-extensions-tizen.cpp
dali/internal/imaging/common/alpha-mask.cpp
dali/internal/imaging/common/image-operations.h
dali/internal/imaging/common/loader-png.cpp
dali/internal/imaging/common/loader-webp.cpp
dali/internal/imaging/common/pixel-buffer-impl.cpp
dali/internal/imaging/common/webp-loading.cpp
dali/internal/vector-image/common/vector-image-renderer-impl.cpp
dali/internal/vector-image/common/vector-image-renderer-impl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 21296d3..1b59436 100644 (file)
@@ -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
index f3576c6..77c7257 100644 (file)
@@ -30,6 +30,8 @@ namespace Dali
 {\r
 namespace Accessibility\r
 {\r
+class Accessible;\r
+\r
 /**\r
  * @brief Enumeration describing type of object move relative to the screen. Only outgoing moves are signalled to AT-clients.\r
  */\r
@@ -711,22 +713,26 @@ struct DALI_ADAPTOR_API GestureInfo
 \r
 /**\r
  * @brief Class representing accessibility relations\r
+ *\r
  * Class connecting one source object with multiple target objects with usage\r
  * of specific relation type.\r
- * @note std::string representing source and targets are string values of Accessibility::Address\r
- * @see Dali::Accessibility::Accessible::Address\r
+ *\r
+ * A remote target object (i.e. one belonging to a different process) can be\r
+ * represented in terms of a ProxyAccessible.\r
+ *\r
+ * @see Dali::Accessibility::Accessible::Accessible\r
  * @see Dali::Accessibility::Accessible::RelationType\r
  */\r
 struct DALI_ADAPTOR_API Relation\r
 {\r
-  Relation(RelationType relationType, std::vector<Address> targets)\r
-  : relationType(relationType),\r
-    targets(targets)\r
+  Relation(RelationType relationType, const std::vector<Accessible*>& targets)\r
+  : mRelationType(relationType),\r
+    mTargets(targets)\r
   {\r
   }\r
 \r
-  RelationType         relationType;\r
-  std::vector<Address> targets;\r
+  RelationType             mRelationType;\r
+  std::vector<Accessible*> mTargets;\r
 };\r
 \r
 } // namespace Accessibility\r
index bf69063..79fe80c 100644 (file)
@@ -47,6 +47,11 @@ bool VectorImageRenderer::Load(const Vector<uint8_t>& 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);
index f11220d..ab59195 100644 (file)
@@ -86,6 +86,13 @@ public:
   bool Load(const Vector<uint8_t>& 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
index 5f71a60..a7ecf8e 100644 (file)
@@ -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<Component*>(Find(address));
+        auto component = dynamic_cast<Component*>(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<std::vector<BridgeAccessible::Relation>> BridgeAccessible::Ge
 
   for(auto& it : relations)
   {
-    ret.emplace_back(Relation{static_cast<uint32_t>(it.relationType), it.targets});
+    ret.emplace_back(Relation{static_cast<uint32_t>(it.mRelationType), it.mTargets});
   }
 
   return ret;
index 219c530..0a3299c 100644 (file)
@@ -91,7 +91,7 @@ public:
     Dali::Accessibility::Accessible*  // describedByObject
     >;
 
-  using Relation = std::tuple<uint32_t, std::vector<Dali::Accessibility::Address>>;
+  using Relation = std::tuple<uint32_t, std::vector<Dali::Accessibility::Accessible*>>;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetChildCount()
index bf2a22c..2449842 100644 (file)
@@ -41,6 +41,7 @@ public:
   Dali::Accessibility::ProxyAccessible          mParent;
   std::vector<Dali::Accessibility::Accessible*> 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<Dali::Accessibility::Accessible*> mDefaultLabels;
index c48240c..551a89a 100644 (file)
@@ -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<Address(Address)>("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<Address(Address)>("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<void(std::string)>("Embedded").call(ATSPI_PREFIX_PATH + plug.GetPath());
+  }
+
+  void UnembedSocket(const Address& plug, const Address& socket) override
+  {
+    auto client = CreateSocketClient(socket);
+
+    client.method<void(Address)>("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
index 4fd0678..911b9da 100644 (file)
@@ -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
index b68f218..5ff8d2c 100644 (file)
@@ -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
index 9beaccc..cf79bdb 100644 (file)
@@ -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.
 
 #include <EGL/eglext.h>
 
+#include <tbm_bufmgr.h>
+#include <tbm_surface.h>
+#include <tbm_surface_internal.h>
+
 #include <dali/integration-api/debug.h>
 
 // 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<tbm_surface_h>(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<EGLint>(info.width),
+                              EGL_HEIGHT, static_cast<EGLint>(info.height),
+                              EGL_LINUX_DRM_FOURCC_EXT, static_cast<EGLint>(info.format),
+                              EGL_DMA_BUF_PLANE0_FD_EXT, static_cast<EGLint>(reinterpret_cast<size_t>(tbm_bo_get_handle(tbmBo, TBM_DEVICE_3D).ptr)),
+                              EGL_DMA_BUF_PLANE0_OFFSET_EXT, static_cast<EGLint>(info.planes[0].offset),
+                              EGL_DMA_BUF_PLANE0_PITCH_EXT, static_cast<EGLint>(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
index 9abdfec..276751a 100644 (file)
@@ -18,7 +18,7 @@
 #include <dali/internal/imaging/common/image-operations.h>
 #include <dali/internal/imaging/common/pixel-buffer-impl.h>
 #include <dali/internal/imaging/common/pixel-manipulation.h>
-#include <dali/public-api/images/image-operations.h> // For ImageDimensions
+#include <dali/public-api/images/image-operations.h> // 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<std::uint16_t>(destAlpha) * static_cast<std::uint16_t>(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<std::uint16_t>(destAlpha) * static_cast<std::uint16_t>(srcAlpha)) / 255;
+        destAlpha = Platform::MultiplyAndNormalizeColor(srcAlpha, destAlpha);
       }
       else
       {
index fd330a0..57d1255 100644 (file)
@@ -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<const uint32_t>(x) * y;
+  return ((xy << 15) + (xy << 7) + xy) >> 23;
+}
+
 /**@}*/
 
 } /* namespace Platform */
index ae63822..c9a5866 100644 (file)
@@ -371,7 +371,7 @@ extern "C" void WriteData(png_structp png_ptr, png_bytep data, png_size_t length
     if(encoded_img)
     {
       const Vector<unsigned char>::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);
     }
index 3749127..25a24d6 100644 (file)
@@ -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;
index f2594ac..533db68 100644 (file)
@@ -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
index a5b8dab..61baf2a 100644 (file)
@@ -237,6 +237,8 @@ public:
       free((void*)mBuffer);
       mBuffer = nullptr;
     }
+
+    mLoadSucceeded = false;
   }
 
   // Moveable but not copyable
index deec3c4..feb8b5a 100644 (file)
@@ -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<uint8_t>& data, float dpi)
       return false;
     }
   }
+  else
+  {
+    return true;
+  }
 
   tvg::Result ret = mPicture->load(reinterpret_cast<char*>(data.Begin()), data.Size(), true);
 
@@ -170,6 +174,11 @@ bool VectorImageRenderer::Load(const Vector<uint8_t>& data, float dpi)
 
   return true;
 #else
+  if(mParsedImage)
+  {
+    return true;
+  }
+
   mParsedImage = nsvgParse(reinterpret_cast<char*>(data.Begin()), UNITS, dpi);
   if(!mParsedImage || !mParsedImage->shapes)
   {
@@ -184,6 +193,15 @@ bool VectorImageRenderer::Load(const Vector<uint8_t>& 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)
index ccc9301..19ae0c1 100644 (file)
@@ -62,6 +62,11 @@ public:
   bool Load(const Vector<uint8_t>& data, float dpi);
 
   /**
+   * @copydoc Dali::VectorImageRenderer::IsLoaded()
+   */
+  bool IsLoaded() const;
+
+  /**
    * @copydoc Dali::VectorImageRenderer::Rasterize()
    */
   Dali::Devel::PixelBuffer Rasterize(uint32_t width, uint32_t height);
index d09451c..9bc72f5 100644 (file)
@@ -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);
index aeea3d8..81e1fcf 100644 (file)
@@ -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
index 4304e73..1266b9a 100644 (file)
@@ -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