Merge "Replace Signal with std::function." into devel/master
authorJIYUN YANG <ji.yang@samsung.com>
Thu, 15 Jul 2021 09:45:18 +0000 (09:45 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 15 Jul 2021 09:45:18 +0000 (09:45 +0000)
23 files changed:
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-reflection.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-reflection.h
automated-tests/src/dali-adaptor/utc-Dali-EncodedImageBuffer.cpp [new file with mode: 0644]
dali/devel-api/text-abstraction/bidirectional-support.cpp
dali/devel-api/text-abstraction/bidirectional-support.h
dali/internal/accessibility/bridge/bridge-text.cpp
dali/internal/canvas-renderer/common/drawable-impl.h
dali/internal/canvas-renderer/common/shape-impl.h
dali/internal/canvas-renderer/generic/drawable-impl-generic.h
dali/internal/canvas-renderer/generic/shape-impl-generic.h
dali/internal/graphics/gles-impl/gles-graphics-reflection.cpp
dali/internal/graphics/gles-impl/gles-graphics-reflection.h
dali/internal/imaging/common/encoded-image-buffer-impl.cpp [new file with mode: 0644]
dali/internal/imaging/common/encoded-image-buffer-impl.h [new file with mode: 0644]
dali/internal/imaging/file.list
dali/internal/text/text-abstraction/bidirectional-support-impl.cpp
dali/internal/text/text-abstraction/bidirectional-support-impl.h
dali/public-api/adaptor-framework/encoded-image-buffer.cpp [new file with mode: 0644]
dali/public-api/adaptor-framework/encoded-image-buffer.h [new file with mode: 0644]
dali/public-api/dali-adaptor-version.cpp
dali/public-api/file.list
packaging/dali-adaptor.spec

index 4b3f4b4..dc7415b 100644 (file)
@@ -6,6 +6,7 @@ SET(RPM_NAME "core-${PKG_NAME}-tests")
 SET(CAPI_LIB "dali-adaptor")
 SET(TC_SOURCES
     utc-Dali-Application.cpp
+    utc-Dali-EncodedImageBuffer.cpp
     utc-Dali-FileLoader.cpp
     utc-Dali-GifLoading.cpp
     utc-Dali-ImageLoading.cpp
index d59f29f..8493992 100644 (file)
@@ -240,9 +240,10 @@ bool TestGraphicsReflection::GetNamedUniform(const std::string& name, Dali::Grap
   return true;
 }
 
-std::vector<Dali::Graphics::UniformInfo> TestGraphicsReflection::GetSamplers() const
+const std::vector<Dali::Graphics::UniformInfo>& TestGraphicsReflection::GetSamplers() const
 {
-  return std::vector<Dali::Graphics::UniformInfo>{};
+  static std::vector<Dali::Graphics::UniformInfo> samplers{};
+  return samplers;
 }
 
 Graphics::ShaderLanguage TestGraphicsReflection::GetLanguage() const
index 7af052e..2147cae 100644 (file)
@@ -28,22 +28,22 @@ class TestGraphicsReflection : public Graphics::Reflection
 public:
   TestGraphicsReflection(TestGlAbstraction& gl, Property::Array& vertexFormats, const Graphics::ProgramCreateInfo& createInfo, std::vector<UniformData>& customUniforms);
 
-  uint32_t                                   GetVertexAttributeLocation(const std::string& name) const override;
-  Dali::Graphics::VertexInputAttributeFormat GetVertexAttributeFormat(uint32_t location) const override;
-  std::string                                GetVertexAttributeName(uint32_t location) const override;
-  std::vector<uint32_t>                      GetVertexAttributeLocations() const override;
-  uint32_t                                   GetUniformBlockCount() const override;
-  uint32_t                                   GetUniformBlockBinding(uint32_t index) const override;
-  uint32_t                                   GetUniformBlockSize(uint32_t index) const override;
-  bool                                       GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
-  std::vector<uint32_t>                      GetUniformBlockLocations() const override;
-  std::string                                GetUniformBlockName(uint32_t blockIndex) const override;
-  uint32_t                                   GetUniformBlockMemberCount(uint32_t blockIndex) const override;
-  std::string                                GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
-  uint32_t                                   GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
-  bool                                       GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
-  std::vector<Dali::Graphics::UniformInfo>   GetSamplers() const override;
-  Graphics::ShaderLanguage                   GetLanguage() const override;
+  uint32_t                                        GetVertexAttributeLocation(const std::string& name) const override;
+  Dali::Graphics::VertexInputAttributeFormat      GetVertexAttributeFormat(uint32_t location) const override;
+  std::string                                     GetVertexAttributeName(uint32_t location) const override;
+  std::vector<uint32_t>                           GetVertexAttributeLocations() const override;
+  uint32_t                                        GetUniformBlockCount() const override;
+  uint32_t                                        GetUniformBlockBinding(uint32_t index) const override;
+  uint32_t                                        GetUniformBlockSize(uint32_t index) const override;
+  bool                                            GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
+  std::vector<uint32_t>                           GetUniformBlockLocations() const override;
+  std::string                                     GetUniformBlockName(uint32_t blockIndex) const override;
+  uint32_t                                        GetUniformBlockMemberCount(uint32_t blockIndex) const override;
+  std::string                                     GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
+  uint32_t                                        GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
+  bool                                            GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
+  const std::vector<Dali::Graphics::UniformInfo>& GetSamplers() const override;
+  Graphics::ShaderLanguage                        GetLanguage() const override;
 
 public: // Test methods
   void SetAttributes(std::vector<std::string> locations)
diff --git a/automated-tests/src/dali-adaptor/utc-Dali-EncodedImageBuffer.cpp b/automated-tests/src/dali-adaptor/utc-Dali-EncodedImageBuffer.cpp
new file mode 100644 (file)
index 0000000..8bb9086
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2021 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 <stdlib.h>
+#include <unistd.h>
+#include <dali/dali.h>
+#include <dali-test-suite-utils.h>
+#include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
+
+using namespace Dali;
+
+namespace
+{
+EncodedImageBuffer::RawBufferType tinybuffer()
+{
+  EncodedImageBuffer::RawBufferType buffer;
+  buffer.PushBack(0x11);
+  buffer.PushBack(0x22);
+  buffer.PushBack(0x33);
+  return buffer;
+}
+
+} // anonymous namespace
+
+void dali_encoded_image_buffer_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_encoded_image_buffer_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliEncodedImageBufferNew(void)
+{
+  // invoke default handle constructor
+  EncodedImageBuffer buffer;
+
+  DALI_TEST_CHECK(!buffer);
+
+  // initialise handle
+  buffer = EncodedImageBuffer::New(tinybuffer());
+
+  DALI_TEST_CHECK(buffer);
+  END_TEST;
+}
+
+int UtcDaliEncodedImageBufferCopyConstructor(void)
+{
+  EncodedImageBuffer buffer = EncodedImageBuffer::New(tinybuffer());
+  EncodedImageBuffer bufferCopy(buffer);
+
+  DALI_TEST_EQUALS( (bool)bufferCopy, true, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliEncodedImageBufferAssignmentOperator(void)
+{
+  EncodedImageBuffer buffer = EncodedImageBuffer::New(tinybuffer());
+
+  EncodedImageBuffer buffer2;
+  DALI_TEST_EQUALS( (bool)buffer2, false, TEST_LOCATION );
+
+  buffer2 = buffer;
+  DALI_TEST_EQUALS( (bool)buffer2, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliEncodedImageBufferGetRawBuffer(void)
+{
+  EncodedImageBuffer::RawBufferType originBuffer = tinybuffer();
+
+  EncodedImageBuffer buffer = EncodedImageBuffer::New(originBuffer);
+
+  EncodedImageBuffer::RawBufferType getBuffer = buffer.GetRawBuffer();
+
+  // compare value between originBuffer and getBuffer
+  DALI_TEST_EQUALS(originBuffer.Count(), getBuffer.Count(), TEST_LOCATION);
+
+  EncodedImageBuffer::RawBufferType::Iterator iter = originBuffer.Begin();
+  EncodedImageBuffer::RawBufferType::Iterator jter = getBuffer.Begin();
+  for(; iter != originBuffer.End(); ++iter, ++jter)
+  {
+    DALI_TEST_EQUALS(*iter, *jter, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
index f7e3e2f..4d7279c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -45,12 +45,12 @@ BidirectionalSupport BidirectionalSupport::Get()
 
 BidiInfoIndex BidirectionalSupport::CreateInfo(const Character* const paragraph,
                                                Length                 numberOfCharacters,
-                                               bool                   matchSystemLanguageDirection,
+                                               bool                   matchLayoutDirection,
                                                LayoutDirection::Type  layoutDirection)
 {
   return GetImplementation(*this).CreateInfo(paragraph,
                                              numberOfCharacters,
-                                             matchSystemLanguageDirection,
+                                             matchLayoutDirection,
                                              layoutDirection);
 }
 
index ac4b9da..d76a2bd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PLATFORM_TEXT_ABSTRACTION_BIDIRECTIONAL_SUPPORT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -77,13 +77,13 @@ public:
    *
    * @param[in] paragraph Pointer to the first character of the paragraph coded in UTF32.
    * @param[in] numberOfCharacters The number of characters of the paragraph.
-   * @param[in] matchSystemLanguageDirection Whether match for system language direction or not.
-   * @param[in] layoutDirection The direction of the system language.
+   * @param[in] matchLayoutDirection Whether match for layout direction or not.
+   * @param[in] layoutDirection The direction of the layout direction.
    * @return An index of an object inside a table storing the bidirectional data.
    */
   BidiInfoIndex CreateInfo(const Character* const paragraph,
                            Length                 numberOfCharacters,
-                           bool                   matchSystemLanguageDirection,
+                           bool                   matchLayoutDirection,
                            LayoutDirection::Type  layoutDirection);
 
   /**
index 9ca694c..c1d7b6b 100644 (file)
@@ -48,7 +48,7 @@ Text* BridgeText::FindSelf() const
   auto textObject = dynamic_cast<Text*>(self);
   if(!textObject)
   {
-    throw std::domain_error{"object " + textObject->GetAddress().ToString() + " doesn't have Text interface"};
+    throw std::domain_error{"Object doesn't have Text interface"};
   }
   return textObject;
 }
index be5d5aa..d4439ed 100644 (file)
@@ -19,9 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
index f3d2ba1..c230a6f 100644 (file)
@@ -19,9 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/signals/connection-tracker.h>
 
index 8fd4c2f..41558a0 100644 (file)
@@ -19,9 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
index e7ceeab..5f8acb5 100644 (file)
@@ -19,9 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/signals/connection-tracker.h>
 
index 26c4352..05a803d 100644 (file)
@@ -558,7 +558,7 @@ const std::vector<Reflection::UniformExtraInfo>& Reflection::GetStandaloneUnifor
   return mStandaloneUniformExtraInfos;
 }
 
-std::vector<Dali::Graphics::UniformInfo> Reflection::GetSamplers() const
+const std::vector<Dali::Graphics::UniformInfo>& Reflection::GetSamplers() const
 {
   return mUniformOpaques;
 }
index 3a4a781..06cfba1 100644 (file)
@@ -186,7 +186,7 @@ public:
    *
    * @return A vector of the sampler uniforms
    */
-  [[nodiscard]] std::vector<Dali::Graphics::UniformInfo> GetSamplers() const override;
+  const std::vector<Dali::Graphics::UniformInfo>& GetSamplers() const override;
 
   // Language
 
diff --git a/dali/internal/imaging/common/encoded-image-buffer-impl.cpp b/dali/internal/imaging/common/encoded-image-buffer-impl.cpp
new file mode 100644 (file)
index 0000000..1967bcb
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// CLASS HEADER
+#include "encoded-image-buffer-impl.h"
+
+namespace Dali
+{
+namespace Internal
+{
+
+EncodedImageBuffer::EncodedImageBuffer(const RawBufferType& buffer)
+: mBuffer(buffer)
+{
+}
+
+EncodedImageBuffer::~EncodedImageBuffer()
+{
+}
+
+IntrusivePtr<EncodedImageBuffer> EncodedImageBuffer::New(const RawBufferType& buffer)
+{
+  IntrusivePtr<EncodedImageBuffer> internal = new EncodedImageBuffer(buffer);
+
+  return internal;
+}
+
+const EncodedImageBuffer::RawBufferType& EncodedImageBuffer::GetRawBuffer() const
+{
+  return mBuffer;
+}
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/imaging/common/encoded-image-buffer-impl.h b/dali/internal/imaging/common/encoded-image-buffer-impl.h
new file mode 100644 (file)
index 0000000..2ea471f
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef DALI_ENCODED_IMAGE_BUFFER_IMPL_H
+#define DALI_ENCODED_IMAGE_BUFFER_IMPL_H
+
+/*
+ * Copyright (c) 2021 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.
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/common/dali-vector.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
+
+namespace Dali
+{
+namespace Internal
+{
+class EncodedImageBuffer : public BaseObject
+{
+public:
+  using RawBufferType = Dali::EncodedImageBuffer::RawBufferType;
+
+  /**
+   * Constructor
+   * @param [in] buffer The raw buffer of image.
+   */
+  EncodedImageBuffer(const RawBufferType& buffer);
+
+  /**
+   * @copydoc Dali::EncodedImageBuffer::New
+   */
+  static IntrusivePtr<EncodedImageBuffer> New(const RawBufferType& buffer);
+
+  /**
+   * @copydoc Dali::EncodedImageBuffer::GetRawBuffer
+   */
+  const RawBufferType& GetRawBuffer() const;
+
+protected:
+  /**
+   * Destructor
+   */
+  ~EncodedImageBuffer();
+
+private:
+  // Undefined
+  EncodedImageBuffer(const EncodedImageBuffer& imageBuffer);
+
+  // Undefined
+  EncodedImageBuffer& operator=(const EncodedImageBuffer& imageBuffer);
+
+private:
+  Dali::Vector<uint8_t> mBuffer;
+};
+
+} // namespace Internal
+
+inline const Internal::EncodedImageBuffer& GetImplementation(const Dali::EncodedImageBuffer& encodedImageBuffer)
+{
+  DALI_ASSERT_ALWAYS(encodedImageBuffer && "EncodedImageBuffer handle is empty");
+
+  const BaseObject& handle = encodedImageBuffer.GetBaseObject();
+
+  return static_cast<const Internal::EncodedImageBuffer&>(handle);
+}
+
+inline Internal::EncodedImageBuffer& GetImplementation(Dali::EncodedImageBuffer& encodedImageBuffer)
+{
+  DALI_ASSERT_ALWAYS(encodedImageBuffer && "EncodedImageBuffer handle is empty");
+
+  BaseObject& handle = encodedImageBuffer.GetBaseObject();
+
+  return static_cast<Internal::EncodedImageBuffer&>(handle);
+}
+
+} // namespace Dali
+
+#endif // DALI_ENCODED_IMAGE_BUFFER_IMPL_H
index 4dcda76..137fa5c 100644 (file)
@@ -4,6 +4,7 @@ SET( adaptor_imaging_common_src_files
     ${adaptor_imaging_dir}/common/native-bitmap-buffer-impl.cpp
     ${adaptor_imaging_dir}/common/pixel-buffer-impl.cpp
     ${adaptor_imaging_dir}/common/alpha-mask.cpp
+    ${adaptor_imaging_dir}/common/encoded-image-buffer-impl.cpp
     ${adaptor_imaging_dir}/common/gaussian-blur.cpp
     ${adaptor_imaging_dir}/common/http-utils.cpp
     ${adaptor_imaging_dir}/common/image-loader.cpp
index e6b9cd8..a451de9 100644 (file)
@@ -125,7 +125,7 @@ struct BidirectionalSupport::Plugin
 
   BidiInfoIndex CreateInfo(const Character* const paragraph,
                            Length                 numberOfCharacters,
-                           bool                   matchSystemLanguageDirection,
+                           bool                   matchLayoutDirection,
                            LayoutDirection::Type  layoutDirection)
   {
     // Reserve memory for the paragraph's bidirectional info.
@@ -150,7 +150,7 @@ struct BidirectionalSupport::Plugin
     fribidi_get_bidi_types(paragraph, numberOfCharacters, bidirectionalInfo->characterTypes);
 
     // Retrieve the paragraph's direction.
-    bidirectionalInfo->paragraphDirection = matchSystemLanguageDirection == true ? (layoutDirection == LayoutDirection::RIGHT_TO_LEFT ? FRIBIDI_PAR_RTL : FRIBIDI_PAR_LTR) : (fribidi_get_par_direction(bidirectionalInfo->characterTypes, numberOfCharacters));
+    bidirectionalInfo->paragraphDirection = matchLayoutDirection == true ? (layoutDirection == LayoutDirection::RIGHT_TO_LEFT ? FRIBIDI_PAR_RTL : FRIBIDI_PAR_LTR) : (fribidi_get_par_direction(bidirectionalInfo->characterTypes, numberOfCharacters));
 
     // Retrieve the embedding levels.
     if(fribidi_get_par_embedding_levels(bidirectionalInfo->characterTypes, numberOfCharacters, &bidirectionalInfo->paragraphDirection, bidirectionalInfo->embeddedLevels) == 0)
@@ -391,14 +391,14 @@ TextAbstraction::BidirectionalSupport BidirectionalSupport::Get()
 
 BidiInfoIndex BidirectionalSupport::CreateInfo(const Character* const      paragraph,
                                                Length                      numberOfCharacters,
-                                               bool                        matchSystemLanguageDirection,
+                                               bool                        matchLayoutDirection,
                                                Dali::LayoutDirection::Type layoutDirection)
 {
   CreatePlugin();
 
   return mPlugin->CreateInfo(paragraph,
                              numberOfCharacters,
-                             matchSystemLanguageDirection,
+                             matchLayoutDirection,
                              layoutDirection);
 }
 
index 03c7faa..e290f4f 100644 (file)
@@ -57,7 +57,7 @@ public:
    */
   BidiInfoIndex CreateInfo(const Character* const paragraph,
                            Length                 numberOfCharacters,
-                           bool                   matchSystemLanguageDirection,
+                           bool                   matchLayoutDirection,
                            LayoutDirection::Type  layoutDirection);
 
   /**
diff --git a/dali/public-api/adaptor-framework/encoded-image-buffer.cpp b/dali/public-api/adaptor-framework/encoded-image-buffer.cpp
new file mode 100644 (file)
index 0000000..ddad181
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// CLASS HEADER
+#include "encoded-image-buffer.h"
+
+// INTERNAL INCLUDES
+#include <dali/internal/imaging/common/encoded-image-buffer-impl.h>
+
+namespace Dali
+{
+EncodedImageBuffer::EncodedImageBuffer()
+{
+}
+
+EncodedImageBuffer::~EncodedImageBuffer()
+{
+}
+
+EncodedImageBuffer::EncodedImageBuffer(Internal::EncodedImageBuffer* internal)
+: BaseHandle(internal)
+{
+}
+
+EncodedImageBuffer::EncodedImageBuffer(const EncodedImageBuffer& handle)
+: BaseHandle(handle)
+{
+}
+
+const EncodedImageBuffer::RawBufferType& EncodedImageBuffer::GetRawBuffer() const
+{
+  return GetImplementation(*this).GetRawBuffer();
+}
+
+EncodedImageBuffer& EncodedImageBuffer::operator=(const EncodedImageBuffer& handle)
+{
+  BaseHandle::operator=(handle);
+  return *this;
+}
+
+EncodedImageBuffer EncodedImageBuffer::New(const RawBufferType& buffer)
+{
+  IntrusivePtr<Internal::EncodedImageBuffer> internal = Internal::EncodedImageBuffer::New(buffer);
+  return EncodedImageBuffer(internal.Get());
+}
+
+} // namespace Dali
diff --git a/dali/public-api/adaptor-framework/encoded-image-buffer.h b/dali/public-api/adaptor-framework/encoded-image-buffer.h
new file mode 100644 (file)
index 0000000..2a0da34
--- /dev/null
@@ -0,0 +1,96 @@
+#ifndef DALI_ENCODED_IMAGE_BUFFER_H
+#define DALI_ENCODED_IMAGE_BUFFER_H
+/*
+ * Copyright (c) 2021 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/common/dali-vector.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
+namespace Dali
+{
+namespace Internal DALI_INTERNAL
+{
+class EncodedImageBuffer;
+}
+
+/**
+ * @brief EncodedImageBuffer contains the large encoded raw buffer informations.
+ *
+ * We can upload this buffer by generated url.
+ * The images are loaded by a worker thread to avoid blocking the main event thread.
+ * @note cannot change raw buffer after make handle.
+ * @note only regular image upload support now.
+ */
+class DALI_ADAPTOR_API EncodedImageBuffer : public BaseHandle
+{
+public:
+  using RawBufferType = Dali::Vector<uint8_t>;
+
+public:
+  /**
+   * @brief Create a new EncodedImageBuffer.
+   *
+   * @param [in] buffer The encoded raw buffer
+   * @return A handle to a new EncodedImageBuffer.
+   */
+  static EncodedImageBuffer New(const RawBufferType& buffer);
+
+  /**
+   * @brief Create an empty handle.
+   *
+   * Calling member functions of an empty handle is not allowed.
+   */
+  EncodedImageBuffer();
+
+  /**
+   * @brief Destructor.
+   */
+  ~EncodedImageBuffer();
+
+  /**
+   * @brief This copy constructor is required for (smart) pointer semantics.
+   *
+   * @param [in] handle A reference to the copied handle
+   */
+  EncodedImageBuffer(const EncodedImageBuffer& handle);
+
+  /**
+   * @brief This assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the copied handle
+   * @return A reference to this
+   */
+  EncodedImageBuffer& operator=(const EncodedImageBuffer& handle);
+
+  /**
+   * @brief Get raw buffer data
+   * @note this method return const value. Mean, you cannot change raw buffer
+   * @return A RawBufferType this buffer have
+   */
+  const RawBufferType& GetRawBuffer() const;
+
+public: // Not intended for developer use
+  explicit DALI_INTERNAL EncodedImageBuffer(Internal::EncodedImageBuffer* impl);
+};
+
+} // namespace Dali
+
+#endif // DALI_ENCODED_IMAGE_BUFFER_H
index 9f85bfc..c148cfb 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 0;
-const unsigned int ADAPTOR_MICRO_VERSION = 33;
+const unsigned int ADAPTOR_MICRO_VERSION = 34;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 4453a21..cd52e1f 100644 (file)
@@ -2,6 +2,7 @@
 
 SET( adaptor_public_api_src_files
   ${adaptor_public_api_dir}/adaptor-framework/application.cpp
+  ${adaptor_public_api_dir}/adaptor-framework/encoded-image-buffer.cpp
   ${adaptor_public_api_dir}/adaptor-framework/key.cpp
   ${adaptor_public_api_dir}/adaptor-framework/window.cpp
   ${adaptor_public_api_dir}/adaptor-framework/timer.cpp
@@ -24,6 +25,7 @@ SET( public_api_header_files
 SET( public_api_adaptor_framework_header_files
   ${adaptor_public_api_dir}/adaptor-framework/application.h
   ${adaptor_public_api_dir}/adaptor-framework/device-status.h
+  ${adaptor_public_api_dir}/adaptor-framework/encoded-image-buffer.h
   ${adaptor_public_api_dir}/adaptor-framework/input-method.h
   ${adaptor_public_api_dir}/adaptor-framework/key.h
   ${adaptor_public_api_dir}/adaptor-framework/key-grab.h
index b13a928..aaa1e62 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.0.33
+Version:    2.0.34
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT