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
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
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)
--- /dev/null
+/*
+ * 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;
+}
/*
- * 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.
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);
}
#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.
*
* @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);
/**
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;
}
*/
// EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
*/
// 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>
*/
// EXTERNAL INCLUDES
-#ifdef THORVG_SUPPORT
-#include <thorvg.h>
-#endif
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
*/
// 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>
return mStandaloneUniformExtraInfos;
}
-std::vector<Dali::Graphics::UniformInfo> Reflection::GetSamplers() const
+const std::vector<Dali::Graphics::UniformInfo>& Reflection::GetSamplers() const
{
return mUniformOpaques;
}
*
* @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
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
${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
BidiInfoIndex CreateInfo(const Character* const paragraph,
Length numberOfCharacters,
- bool matchSystemLanguageDirection,
+ bool matchLayoutDirection,
LayoutDirection::Type layoutDirection)
{
// Reserve memory for the paragraph's bidirectional info.
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)
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);
}
*/
BidiInfoIndex CreateInfo(const Character* const paragraph,
Length numberOfCharacters,
- bool matchSystemLanguageDirection,
+ bool matchLayoutDirection,
LayoutDirection::Type layoutDirection);
/**
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
{
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
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
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
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