dali-test-suite-utils/test-render-controller.cpp
dali-test-suite-utils/test-trace-call-stack.cpp
dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
+ dali-test-suite-utils/adaptor-environment-variable.cpp
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
--- /dev/null
+/*
+ * 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.
+ * 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 "adaptor-environment-variable.h"
+
+// EXTERNAL INCLUDE
+#include <map>
+
+namespace Dali
+{
+namespace EnvironmentVariable
+{
+namespace
+{
+std::map<std::string, std::string> gEnvironmentVariables;
+} // namespace
+
+const char* GetEnvironmentVariable(const char* variable)
+{
+ auto value = gEnvironmentVariables.find(variable);
+ if(value != gEnvironmentVariables.end())
+ {
+ return value->second.c_str();
+ }
+ return nullptr;
+}
+
+void SetTestEnvironmentVariable(const char* variable, const char* value)
+{
+ gEnvironmentVariables[variable] = value;
+}
+
+} // namespace EnvironmentVariable
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_ADAPTOR_ENVIRONMENT_VARIABLE_H
+#define DALI_ADAPTOR_ENVIRONMENT_VARIABLE_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
+#define DALI_ENVIRONMENT_VARIABLE_H
+
+#include <cstddef>
+
+namespace Dali
+{
+namespace EnvironmentVariable
+{
+const char* GetEnvironmentVariable(const char* variable);
+
+void SetTestEnvironmentVariable(const char* variable, const char* value);
+
+} // namespace EnvironmentVariable
+
+} // namespace Dali
+
+#endif // DALI_ADAPTOR_ENVIRONMENT_VARIABLE_H
#define DALI_TEST_COMPARE_TYPES_H
/*
- * Copyright (c) 2020 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.
(extents1.bottom == extents2.bottom);
}
-template<>
-inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
-{
- Property::Type type = q1.GetType();
- if(type != q2.GetType())
- {
- return false;
- }
-
- bool result = false;
- switch(type)
- {
- case Property::BOOLEAN:
- {
- bool a, b;
- q1.Get(a);
- q2.Get(b);
- result = a == b;
- break;
- }
- case Property::INTEGER:
- {
- int a, b;
- q1.Get(a);
- q2.Get(b);
- result = a == b;
- break;
- }
- case Property::FLOAT:
- {
- float a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<float>(a, b, epsilon);
- break;
- }
- case Property::VECTOR2:
- {
- Vector2 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector2>(a, b, epsilon);
- break;
- }
- case Property::VECTOR3:
- {
- Vector3 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector3>(a, b, epsilon);
- break;
- }
- case Property::RECTANGLE:
- case Property::VECTOR4:
- {
- Vector4 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector4>(a, b, epsilon);
- break;
- }
- case Property::ROTATION:
- {
- Quaternion a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Quaternion>(a, b, epsilon);
- break;
- }
- case Property::STRING:
- {
- std::string a, b;
- q1.Get(a);
- q2.Get(b);
- result = (a.compare(b) == 0);
- break;
- }
- case Property::MATRIX:
- case Property::MATRIX3:
- case Property::ARRAY:
- case Property::MAP:
- {
- //TODO: Implement this?
- DALI_ASSERT_ALWAYS(0 && "Not implemented");
- result = false;
- break;
- }
- case Property::EXTENTS:
- {
- Extents a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Extents>(a, b, epsilon);
- break;
- }
- case Property::NONE:
- {
- result = false;
- break;
- }
- }
-
- return result;
-}
-
#endif
*
*/
+#include <adaptor-environment-variable.h>
#include <dali-test-img-utils.h>
#include <dali-test-suite-utils.h>
// resolution: 2000*2560, pixel format: RGB888
const char* IMAGE_LARGE_EXIF3_RGB = TEST_RESOURCE_DIR "/f-large-exif-3.jpg";
-// resolution: 2048*2048, pixel format: RGB888, YUV420
-const char* IMAGE_LARGE_2048_YUV_420 = TEST_RESOURCE_DIR "/lake_front.jpg";
+// resolution: 128*128, pixel format: RGB888, YUV411
+const char* IMAGE_128_YUV_411 = TEST_RESOURCE_DIR "/gallery-small-1-yuv411.jpg";
+// resolution: 128*128, pixel format: RGB888, YUV420
+const char* IMAGE_128_YUV_420 = TEST_RESOURCE_DIR "/gallery-small-1-yuv420.jpg";
+// resolution: 128*128, pixel format: RGB888, YUV422
+const char* IMAGE_128_YUV_422 = TEST_RESOURCE_DIR "/gallery-small-1-yuv422.jpg";
+// resolution: 128*128, pixel format: RGB888, YUV440
+const char* IMAGE_128_YUV_440 = TEST_RESOURCE_DIR "/gallery-small-1-yuv440.jpg";
+// resolution: 128*128, pixel format: RGB888, YUV444
+const char* IMAGE_128_YUV_444 = TEST_RESOURCE_DIR "/gallery-small-1-yuv444.jpg";
// resolution: 55*64, pixel format: RGB888
const char* IMAGE_WIDTH_ODD_EXIF1_RGB = TEST_RESOURCE_DIR "/f-odd-exif-1.jpg";
int UtcDaliLoadImagePlanesFromFileP(void)
{
+ EnvironmentVariable::SetTestEnvironmentVariable("DALI_ENABLE_DECODE_JPEG_TO_YUV_444", "1");
+ EnvironmentVariable::SetTestEnvironmentVariable("DALI_ENABLE_DECODE_JPEG_TO_YUV_422", "1");
+ EnvironmentVariable::SetTestEnvironmentVariable("DALI_ENABLE_DECODE_JPEG_TO_YUV_420", "1");
+ EnvironmentVariable::SetTestEnvironmentVariable("DALI_ENABLE_DECODE_JPEG_TO_YUV_440", "1");
+ EnvironmentVariable::SetTestEnvironmentVariable("DALI_ENABLE_DECODE_JPEG_TO_YUV_411", "1");
+
std::vector<Devel::PixelBuffer> pixelBuffers;
- Dali::LoadImagePlanesFromFile(IMAGE_LARGE_2048_YUV_420, pixelBuffers);
+ // yuv 411 format
+ Dali::LoadImagePlanesFromFile(IMAGE_128_YUV_411, pixelBuffers);
+ DALI_TEST_EQUALS(pixelBuffers.size(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::L8, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetWidth(), 32u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetPixelFormat(), Pixel::CHROMINANCE_U, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetWidth(), 32u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetPixelFormat(), Pixel::CHROMINANCE_V, TEST_LOCATION);
+
+ pixelBuffers.clear();
+
+ // yuv 420 format
+ Dali::LoadImagePlanesFromFile(IMAGE_128_YUV_420, pixelBuffers);
+ DALI_TEST_EQUALS(pixelBuffers.size(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::L8, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetWidth(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetPixelFormat(), Pixel::CHROMINANCE_U, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetWidth(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetPixelFormat(), Pixel::CHROMINANCE_V, TEST_LOCATION);
+
+ pixelBuffers.clear();
+
+ // yuv 422 format
+ Dali::LoadImagePlanesFromFile(IMAGE_128_YUV_422, pixelBuffers);
DALI_TEST_EQUALS(pixelBuffers.size(), 3, TEST_LOCATION);
- DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 2048u, TEST_LOCATION);
- DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 2048u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::L8, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetWidth(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetHeight(), 128u, TEST_LOCATION);
DALI_TEST_EQUALS(pixelBuffers[1].GetPixelFormat(), Pixel::CHROMINANCE_U, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetWidth(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetPixelFormat(), Pixel::CHROMINANCE_V, TEST_LOCATION);
+
+ pixelBuffers.clear();
+
+ // yuv 440 format
+ Dali::LoadImagePlanesFromFile(IMAGE_128_YUV_440, pixelBuffers);
+ DALI_TEST_EQUALS(pixelBuffers.size(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::L8, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetPixelFormat(), Pixel::CHROMINANCE_U, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetHeight(), 64u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetPixelFormat(), Pixel::CHROMINANCE_V, TEST_LOCATION);
+
+ pixelBuffers.clear();
+
+ // yuv 444 format
+ Dali::LoadImagePlanesFromFile(IMAGE_128_YUV_444, pixelBuffers);
+ DALI_TEST_EQUALS(pixelBuffers.size(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::L8, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetHeight(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[1].GetPixelFormat(), Pixel::CHROMINANCE_U, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetWidth(), 128u, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelBuffers[2].GetHeight(), 128u, TEST_LOCATION);
DALI_TEST_EQUALS(pixelBuffers[2].GetPixelFormat(), Pixel::CHROMINANCE_V, TEST_LOCATION);
pixelBuffers.clear();
pixelBuffers.clear();
- // Test notsupported chrominace subsampling case
- Dali::LoadImagePlanesFromFile(IMAGE_128_RGB, pixelBuffers);
- DALI_TEST_EQUALS(pixelBuffers.size(), 1, TEST_LOCATION);
- DALI_TEST_EQUALS(pixelBuffers[0].GetWidth(), 128u, TEST_LOCATION);
- DALI_TEST_EQUALS(pixelBuffers[0].GetHeight(), 128u, TEST_LOCATION);
- DALI_TEST_EQUALS(pixelBuffers[0].GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
-
END_TEST;
}
SET( tizenadaptorintegrationapidir ${INCLUDE_DIR}/dali/integration-api/adaptor-framework )
SET( tizenadaptorframeworkpublicapidir ${tizenadaptorpublicapidir}/adaptor-framework )
SET( tizenadaptorframeworkdevelapidir ${tizenadaptordevelapidir}/adaptor-framework )
+SET( tizencanvasrendererdevelapidir ${tizenadaptorframeworkdevelapidir}/canvas-renderer )
+SET( tizenwebenginedevelapidir ${tizenadaptorframeworkdevelapidir}/web-engine )
SET( tizenatspiinterfacesdevelapidir ${tizenadaptordevelapidir}/atspi-interfaces )
SET( tizentextabstractiondevelapidir ${tizenadaptordevelapidir}/text-abstraction )
SET( tizenadaptordaliheaderdir ${INCLUDE_DIR}/dali )
INSTALL( FILES ${adaptor_integration_api_header_files} DESTINATION ${tizenadaptorintegrationapidir} )
INSTALL( FILES ${public_api_adaptor_framework_header_files} DESTINATION ${tizenadaptorframeworkpublicapidir} )
INSTALL( FILES ${devel_api_adaptor_framework_header_files} DESTINATION ${tizenadaptorframeworkdevelapidir} )
+INSTALL( FILES ${devel_api_adaptor_framework_canvas_renderer_header_files} DESTINATION ${tizencanvasrendererdevelapidir} )
+INSTALL( FILES ${devel_api_adaptor_framework_web_engine_header_files} DESTINATION ${tizenwebenginedevelapidir} )
INSTALL( FILES ${devel_api_atspi_interfaces_header_files} DESTINATION ${tizenatspiinterfacesdevelapidir} )
INSTALL( FILES ${text_abstraction_header_files} DESTINATION ${tizentextabstractiondevelapidir} )
namespace Accessibility
{
class Accessible;
+class ProxyAccessible;
/**
* @brief Base class for different accessibility bridges.
virtual void UnembedSocket(const Address& plug, const Address& socket) = 0;
/**
+ * @brief Calls socket.SetOffset(x, y) via D-Bus.
+ *
+ * The "SetOffset" D-Bus method is a DALi extension. It can be used to inform a DALi widget about
+ * its position on the screen.
+ *
+ * @param[in] socket The socket
+ * @param[in] x Horizontal offset
+ * @param[in] y Vertical offset
+ *
+ * @note Remote object pointed to by 'socket' must implement 'org.a11y.atspi.Socket'.
+ * @see EmbedSocket()
+ * @see SetExtentsOffset()
+ */
+ virtual void SetSocketOffset(ProxyAccessible* socket, std::int32_t x, std::int32_t y) = 0;
+
+ /**
+ * @brief Sets the global extents offset.
+ *
+ * This offset will be added during serialization of GetExtents() return value to D-Bus.
+ * Local calls to GetExtents() are unaffected.
+ *
+ * @param[in] x Horizontal offset
+ * @param[in] y Vertical offset
+ *
+ * @see SetSocketOffset()
+ * @see Dali::Accessibility::Component::GetExtents()
+ */
+ virtual void SetExtentsOffset(std::int32_t x, std::int32_t y) = 0;
+
+ /**
+ * @brief Sets the preferred bus name.
+ *
+ * If the Bridge is enabled, it will immediately release the previous name and request the new one.
+ *
+ * Otherwise, the Bridge will request this name on AT-SPI activation (and release it on deactivation).
+ * It is up to the caller to determine whether a given name will be available in the system.
+ *
+ * @param preferredBusName The preferred bus name
+ */
+ virtual void SetPreferredBusName(std::string_view preferredBusName) = 0;
+
+ /**
* @brief Returns instance of bridge singleton object.
*
* @return The current bridge object
*/
static void EnableAutoInit();
+ /**
+ * @brief Encodes a widget ID as a usable bus name.
+ *
+ * @param widgetInstanceId The instance ID of a widget
+ * @return std::string Encoded bus name
+ *
+ * @see SetPreferredBusName
+ */
+ static std::string MakeBusNameForWidget(std::string_view widgetInstanceId);
+
static Signal<void()>& EnabledSignal()
{
return mEnabledSignal;
Bridge* mBridge = nullptr;
Actor mHighlightActor;
Actor mCurrentlyHighlightedActor;
+ std::pair<std::int32_t, std::int32_t> mExtentsOffset{0, 0};
};
std::shared_ptr<Data> mData;
friend class Accessible;
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#define DALI_CANVAS_RENDERER_DRAWABLE_GROUP_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#define DALI_CANVAS_RENDERER_DRAWABLE_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#define DALI_CANVAS_RENDERER_GRADIENT_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/linear-gradient-factory.h>
#define DALI_CANVAS_RENDERER_LINEAR_GRADIENT_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
-* 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#define DALI_CANVAS_RENDERER_PICTURE_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/radial-gradient-factory.h>
#define DALI_CANVAS_RENDERER_RADIAL_GRADIENT_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
-* 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#define DALI_CANVAS_RENDERER_SHAPE_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.
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
// INTERNAL INCLUDES
#include <dali/internal/canvas-renderer/common/canvas-renderer-factory.h>
#define DALI_CANVAS_RENDERER_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.
#define DALI_VECTOR_ANIMATION_RENDERER_PLUGIN_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.
virtual bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const = 0;
/**
- * @brief Ignores a rendered frame which is not shown yet.
+ * @brief Invalidates the rendered buffer.
+ * @note The upload completed signal will be emitted again.
*/
- virtual void IgnoreRenderedFrame() = 0;
+ virtual void InvalidateBuffer() = 0;
/**
* @brief Connect to this signal to be notified when the texture upload is completed.
/*
- * 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.
return GetImplementation(*this).GetMarkerInfo(marker, startFrame, endFrame);
}
-void VectorAnimationRenderer::IgnoreRenderedFrame()
+void VectorAnimationRenderer::InvalidateBuffer()
{
- GetImplementation(*this).IgnoreRenderedFrame();
+ GetImplementation(*this).InvalidateBuffer();
}
VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
#define DALI_VECTOR_ANIMATION_RENDERER_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.
bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
/**
- * @brief Ignores a rendered frame which is not shown yet.
+ * @brief Invalidates the rendered buffer.
+ * @note The upload completed signal will be emitted again.
*/
- void IgnoreRenderedFrame();
+ void InvalidateBuffer();
public: // Signals
/**
#define DALI_WEB_ENGINE_BACK_FORWARD_LIST_ITEM_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.
#define DALI_WEB_ENGINE_BACK_FORWARD_LIST_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.
*/
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list-item.h>
// EXTERNAL INCLUDES
#include <string>
#define DALI_WEB_ENGINE_CERTIFICATE_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.
#define DALI_WEB_ENGINE_CONSOLE_MESSAGE_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.
#define DALI_WEB_ENGINE_CONTEXT_MENU_ITEM_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.
#define DALI_WEB_ENGINE_CONTEXT_MENU_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
#include <dali/public-api/math/vector2.h>
#include <memory>
#include <string>
#define DALI_WEB_ENGINE_CONTEXT_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.
#include <vector>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
-#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-security-origin.h>
namespace Dali
{
#define DALI_WEB_ENGINE_COOKIE_MANAGER_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.
#define DALI_WEB_ENGINE_FORM_REPOST_DECISION_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.
#define DALI_WEB_ENGINE_FRAME_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.
#define DALI_WEB_ENGINE_HIT_TEST_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.
#define DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_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.
#define DALI_WEB_ENGINE_LOAD_ERROR_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.
#define DALI_WEB_ENGINE_PLUGIN_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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
#include <dali/devel-api/common/bitwise-enum.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#define DALI_WEB_ENGINE_POLICY_DECISION_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.
#define DALI_WEB_ENGINE_SECURITY_ORIGIN_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.
#define DALI_WEB_ENGINE_SETTINGS_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.
/*
- * 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.
*/
// CLASSHEADER
-#include <dali/devel-api/adaptor-framework/web-engine.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
-#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
-#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
-#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
#include <dali/internal/web-engine/common/web-engine-impl.h>
// EXTERNAL INCLUDES
#define DALI_WEB_ENGINE_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.
//INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
virtual void Unembed(Address plug) = 0;
/**
+ * @brief Set the offset (position information).
+ *
+ * @param[in] x Horizontal offset
+ * @param[in] y Vertical offset
+ */
+ virtual void SetOffset(std::int32_t x, std::int32_t y) = 0;
+
+ /**
* @brief Downcasts an Accessible to a Socket.
*
* @param obj The Accessible
SET( devel_api_src_files
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-drawable.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-picture.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-shape.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-gradient.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine.cpp
${adaptor_devel_api_dir}/adaptor-framework/accessibility.cpp
${adaptor_devel_api_dir}/adaptor-framework/actor-accessible.cpp
${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.cpp
${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp
${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.cpp
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-drawable.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-picture.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-drawable-group.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-shape.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-gradient.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-linear-gradient.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-radial-gradient.cpp
${adaptor_devel_api_dir}/adaptor-framework/capture-devel.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp
${adaptor_devel_api_dir}/adaptor-framework/video-player.cpp
${adaptor_devel_api_dir}/adaptor-framework/virtual-keyboard.cpp
${adaptor_devel_api_dir}/adaptor-framework/thread-settings.cpp
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine.cpp
${adaptor_devel_api_dir}/adaptor-framework/window-devel.cpp
${adaptor_devel_api_dir}/adaptor-framework/gl-window.cpp
${adaptor_devel_api_dir}/adaptor-framework/offscreen-application.cpp
${adaptor_devel_api_dir}/adaptor-framework/application-devel.h
${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-drawable.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-shape.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-drawable-group.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-gradient.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-linear-gradient.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-radial-gradient.h
- ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer-picture.h
${adaptor_devel_api_dir}/adaptor-framework/capture-devel.h
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h
${adaptor_devel_api_dir}/adaptor-framework/clipboard.h
${adaptor_devel_api_dir}/adaptor-framework/vector-image-renderer.h
${adaptor_devel_api_dir}/adaptor-framework/video-player.h
${adaptor_devel_api_dir}/adaptor-framework/video-player-plugin.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-back-forward-list-item.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-certificate.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-console-message.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context-menu.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-context-menu-item.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-cookie-manager.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-form-repost-decision.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-frame.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-http-auth-handler.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-load-error.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-hit-test.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-plugin.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-policy-decision.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-request-interceptor.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-security-origin.h
- ${adaptor_devel_api_dir}/adaptor-framework/web-engine-settings.h
${adaptor_devel_api_dir}/adaptor-framework/key-extension-plugin.h
${adaptor_devel_api_dir}/adaptor-framework/virtual-keyboard.h
${adaptor_devel_api_dir}/adaptor-framework/physical-keyboard.h
)
+SET( devel_api_adaptor_framework_canvas_renderer_header_files
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-shape.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h
+ ${adaptor_devel_api_dir}/adaptor-framework/canvas-renderer/canvas-renderer-picture.h
+)
+
+
+SET( devel_api_adaptor_framework_web_engine_header_files
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-back-forward-list.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-back-forward-list-item.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-certificate.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-console-message.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-context.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-context-menu.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-context-menu-item.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-cookie-manager.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-form-repost-decision.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-frame.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-http-auth-handler.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-load-error.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-hit-test.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-plugin.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-policy-decision.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-request-interceptor.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-security-origin.h
+ ${adaptor_devel_api_dir}/adaptor-framework/web-engine/web-engine-settings.h
+)
+
+
SET( devel_api_atspi_interfaces_header_files
${adaptor_devel_api_dir}/atspi-interfaces/accessible.h
${adaptor_devel_api_dir}/atspi-interfaces/action.h
GetImplementation(*this).GetSystemFonts(systemFonts);
}
-void FontClient::GetDescription(FontId id, FontDescription& fontDescription)
+void FontClient::GetDescription(FontId fontId, FontDescription& fontDescription)
{
- GetImplementation(*this).GetDescription(id, fontDescription);
+ GetImplementation(*this).GetDescription(fontId, fontDescription);
}
-PointSize26Dot6 FontClient::GetPointSize(FontId id)
+PointSize26Dot6 FontClient::GetPointSize(FontId fontId)
{
- return GetImplementation(*this).GetPointSize(id);
+ return GetImplementation(*this).GetPointSize(fontId);
}
bool FontClient::IsCharacterSupportedByFont(FontId fontId, Character character)
*/
static void DecompressScanline(const GlyphBufferData& inBufferData, uint8_t* outBuffer, uint32_t& offset);
- uint8_t* buffer; ///< The glyph's bitmap buffer data.
- uint32_t width; ///< The width of the bitmap.
- uint32_t height; ///< The height of the bitmap.
- int outlineOffsetX; ///< The additional horizontal offset to be added for the glyph's position for outline.
- int outlineOffsetY; ///< The additional vertical offset to be added for the glyph's position for outline.
- Pixel::Format format; ///< The pixel's format of the bitmap.
- CompressionType compressionType : 3; ///< The type of buffer compression.
- bool isColorEmoji : 1; ///< Whether the glyph is an emoji.
- bool isColorBitmap : 1; ///< Whether the glyph is a color bitmap.
- bool isBufferOwned : 1; ///< Whether the glyph's bitmap buffer data owned by this class or not. Becareful when you use non-owned buffer data.
+ uint8_t* buffer; ///< The glyph's bitmap buffer data.
+ uint32_t width; ///< The width of the bitmap.
+ uint32_t height; ///< The height of the bitmap.
+ int outlineOffsetX; ///< The additional horizontal offset to be added for the glyph's position for outline.
+ int outlineOffsetY; ///< The additional vertical offset to be added for the glyph's position for outline.
+ Pixel::Format format; ///< The pixel's format of the bitmap.
+ CompressionType compressionType; ///< The type of buffer compression.
+ bool isColorEmoji : 1; ///< Whether the glyph is an emoji.
+ bool isColorBitmap : 1; ///< Whether the glyph is a color bitmap.
+ bool isBufferOwned : 1; ///< Whether the glyph's bitmap buffer data owned by this class or not. Becareful when you use non-owned buffer data.
};
/**
void GetSystemFonts(FontList& systemFonts);
/**
- * @brief Retrieves the font description of a given font @p id.
+ * @brief Retrieves the font description of a given font @p fontId.
*
- * @param[in] id The font identifier.
+ * @param[in] fontId The font identifier.
* @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
*/
- void GetDescription(FontId id, FontDescription& fontDescription);
+ void GetDescription(FontId fontId, FontDescription& fontDescription);
/**
- * @brief Retrieves the font point size of a given font @p id.
+ * @brief Retrieves the font point size of a given font @p fontId.
*
- * @param[in] id The font identifier.
+ * @param[in] fontId The font identifier.
*
* @return The point size in 26.6 fractional points.
*/
- PointSize26Dot6 GetPointSize(FontId id);
+ PointSize26Dot6 GetPointSize(FontId fontId);
/**
* @brief Whether the given @p character is supported by the font.
#define DALI_INTERNAL_ATSPI_ACCESSIBILITY_COMMON_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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
-#include <dali/internal/accessibility/bridge/dbus-locators.h>
-#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/dbus/dbus-locators.h>
+#include <dali/internal/accessibility/bridge/dbus/dbus.h>
#include <dali/public-api/dali-adaptor-common.h>
// DBus names
return std::string(GET_NAVIGABLE_AT_POINT_MAX_RECURSION_DEPTH - maxRecursionDepth, ' ');
}
-static bool IsDeputy(Accessible* obj)
-{
- //TODO: add deputy
- return false;
-}
-
-static Accessible* GetProxyInParent(Accessible* obj)
-{
- if(!obj)
- {
- return nullptr;
- }
-
- auto children = obj->GetChildren();
- for(auto& child : children)
- {
- if(child->IsProxy())
- {
- return child;
- }
- }
- return nullptr;
-}
static bool IsRoleAcceptableWhenNavigatingNextPrev(Accessible* obj)
{
return false;
}
-static Accessible* GetDeputyOfProxyInParent(Accessible* obj)
-{
- return nullptr;
-}
-
static std::vector<Component*> GetScrollableParents(Accessible* accessible)
{
std::vector<Component*> scrollableParents;
Accessible* deputy = nullptr;
auto accessible = FindSelf();
auto cType = static_cast<CoordinateType>(coordinateType);
+
+ x -= mData->mExtentsOffset.first;
+ y -= mData->mExtentsOffset.second;
+
LOG() << "GetNavigableAtPoint: " << x << ", " << y << " type: " << coordinateType;
auto component = CalculateNavigableAccessibleAtPoint(accessible, {x, y}, cType, GET_NAVIGABLE_AT_POINT_MAX_RECURSION_DEPTH);
bool recurse = false;
{
return nullptr;
}
+ else if(parent->IsProxy())
+ {
+ return parent;
+ }
auto children = GetValidChildren(parent->GetChildren(), start);
SortChildrenFromTopLeft(children);
if(searchMode == BridgeAccessible::NeighborSearchMode::RECURSE_TO_OUTSIDE)
{
- // This only works if we navigate backward, and it is not possible to
- // find in embedded process. In this case the deputy should be used */
- return GetDeputyOfProxyInParent(start);
+ searchMode = BridgeAccessible::NeighborSearchMode::CONTINUE_AFTER_FAILED_RECURSION;
}
Accessible* node = start ? start : root;
}
Accessible* nextRelatedInDirection = !forceNext ? GetObjectInRelation(node, forward ? RelationType::FLOWS_TO : RelationType::FLOWS_FROM) : nullptr;
- // forceNext means that the searchMode is NEIGHBOR_SEARCH_MODE_CONTINUE_AFTER_FAILED_RECURSING
- // in this case the node is elm_layout which is parent of proxy object.
- // There is an access object working for the proxy object, and the access
- // object could have relation information. This relation information should
- // be checked first before using the elm_layout as a node.
- if(forceNext && forward)
- {
- auto deputy = GetDeputyOfProxyInParent(node);
- nextRelatedInDirection = GetObjectInRelation(deputy, RelationType::FLOWS_TO);
- }
-
if(nextRelatedInDirection && start && start->GetStates()[State::DEFUNCT])
{
nextRelatedInDirection = NULL;
unsigned char wantCycleDetection = 0;
if(nextRelatedInDirection)
{
- // Check whether nextRelatedInDirection is deputy object or not
- Accessible* parent;
- if(!forward)
- {
- // If the prev object is deputy, then go to inside of its proxy first
- if(IsDeputy(nextRelatedInDirection))
- {
- parent = nextRelatedInDirection->GetParent();
- nextRelatedInDirection = GetProxyInParent(parent);
- }
- }
- else
- {
- // If current object is deputy, and it has relation next object,
- // then do not use the relation next object, and use proxy first
- if(IsDeputy(node))
- {
- parent = node->GetParent();
- nextRelatedInDirection = GetProxyInParent(parent);
- }
- }
node = nextRelatedInDirection;
wantCycleDetection = 1;
}
DBus::ValueOrError<Accessible*, uint8_t> BridgeAccessible::GetNeighbor(std::string rootPath, int32_t direction, int32_t searchMode)
{
- auto start = FindSelf();
- rootPath = StripPrefix(rootPath);
- auto root = !rootPath.empty() ? Find(rootPath) : nullptr;
+ auto start = FindSelf();
+ auto root = !rootPath.empty() ? Find(StripPrefix(rootPath)) : nullptr;
auto accessible = CalculateNeighbor(root, start, direction == 1, static_cast<NeighborSearchMode>(searchMode));
unsigned char recurse = 0;
if(accessible)
mApplication.mChildren.clear();
}
-void BridgeBase::AddFilteredEvent(FilteredEvents kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
+void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
{
if(delay < 0)
{
delay = 0;
}
+ auto countdownBase = static_cast<unsigned int>(delay * 10);
- auto it = mFilteredEvents.insert({{kind, obj}, {static_cast<unsigned int>(delay * 10), {}}});
+ auto it = mCoalescableMessages.insert({{kind, obj}, {countdownBase, countdownBase, {}}});
if(it.second)
{
functor();
}
else
{
- it.first->second.second = std::move(functor);
+ std::get<1>(it.first->second) = countdownBase;
+ std::get<2>(it.first->second) = std::move(functor);
}
if(!tickTimer)
{
tickTimer = Dali::Timer::New(100);
- tickTimer.TickSignal().Connect(this, &BridgeBase::TickFilteredEvents);
+ tickTimer.TickSignal().Connect(this, &BridgeBase::TickCoalescableMessages);
+ }
+
+ if(!tickTimer.IsRunning())
+ {
+ tickTimer.Start();
}
}
-bool BridgeBase::TickFilteredEvents()
+bool BridgeBase::TickCoalescableMessages()
{
- for(auto it = mFilteredEvents.begin(); it != mFilteredEvents.end();)
+ for(auto it = mCoalescableMessages.begin(); it != mCoalescableMessages.end();)
{
- if(it->second.first)
+ auto& countdown = std::get<0>(it->second);
+ auto countdownBase = std::get<1>(it->second);
+ auto& functor = std::get<2>(it->second);
+ if(countdown)
{
- --it->second.first;
+ --countdown;
}
else
{
- if(it->second.second)
+ if(functor)
{
- it->second.second();
- it->second.second = {};
+ functor();
+ functor = {};
+ countdown = countdownBase;
}
else
{
- it = mFilteredEvents.erase(it);
+ it = mCoalescableMessages.erase(it);
continue;
}
}
++it;
}
- return !mFilteredEvents.empty();
+ return !mCoalescableMessages.empty();
}
void BridgeBase::UpdateRegisteredEvents()
#include <dali/public-api/dali-adaptor-version.h>
#include <dali/public-api/signals/connection-tracker.h>
#include <memory>
+#include <tuple>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/proxy-accessible.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/devel-api/atspi-interfaces/application.h>
#include <dali/devel-api/atspi-interfaces/collection.h>
+#include <dali/devel-api/atspi-interfaces/socket.h>
#include <dali/internal/accessibility/bridge/accessibility-common.h>
/**
* @brief The ApplicationAccessible class is to define Accessibility Application.
*/
-class ApplicationAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection, public virtual Dali::Accessibility::Application
+class ApplicationAccessible : public virtual Dali::Accessibility::Accessible,
+ public virtual Dali::Accessibility::Application,
+ public virtual Dali::Accessibility::Collection,
+ public virtual Dali::Accessibility::Component,
+ public virtual Dali::Accessibility::Socket
{
public:
Dali::Accessibility::ProxyAccessible mParent;
std::vector<Dali::Accessibility::Accessible*> mChildren;
std::string mName;
std::string mToolkitName{"dali"};
+ bool mIsEmbedded{false};
std::string GetName() const override
{
size_t GetIndexInParent() override
{
+ if(mIsEmbedded)
+ {
+ return 0u;
+ }
+
throw std::domain_error{"can't call GetIndexInParent on application object"};
}
Dali::Accessibility::States GetStates() override
{
- return {};
+ Dali::Accessibility::States result;
+
+ for(auto* child : mChildren)
+ {
+ result = result | child->GetStates();
+ }
+
+ return result;
}
Dali::Accessibility::Attributes GetAttributes() const override
return {"", "root"};
}
+ // Application
+
std::string GetToolkitName() const override
{
return mToolkitName;
{
return std::to_string(Dali::ADAPTOR_MAJOR_VERSION) + "." + std::to_string(Dali::ADAPTOR_MINOR_VERSION);
}
+
+ // Socket
+
+ Dali::Accessibility::Address Embed(Dali::Accessibility::Address plug) override
+ {
+ mIsEmbedded = true;
+ mParent.SetAddress(plug);
+
+ return GetAddress();
+ }
+
+ void Unembed(Dali::Accessibility::Address plug) override
+ {
+ if(mParent.GetAddress() == plug)
+ {
+ mIsEmbedded = false;
+ mParent.SetAddress({});
+ Dali::Accessibility::Bridge::GetCurrentBridge()->SetExtentsOffset(0, 0);
+ }
+ }
+
+ void SetOffset(std::int32_t x, std::int32_t y) override
+ {
+ if(!mIsEmbedded)
+ {
+ return;
+ }
+
+ Dali::Accessibility::Bridge::GetCurrentBridge()->SetExtentsOffset(x, y);
+ }
+
+ // Component
+
+ Dali::Rect<> GetExtents(Dali::Accessibility::CoordinateType type) const override
+ {
+ using limits = std::numeric_limits<float>;
+
+ float minX = limits::max();
+ float minY = limits::max();
+ float maxX = limits::min();
+ float maxY = limits::min();
+
+ for(Dali::Accessibility::Accessible* child : mChildren)
+ {
+ auto* component = Dali::Accessibility::Component::DownCast(child);
+ if(!component)
+ {
+ continue;
+ }
+
+ auto extents = component->GetExtents(type);
+
+ minX = std::min(minX, extents.x);
+ minY = std::min(minY, extents.y);
+ maxX = std::max(maxX, extents.x + extents.width);
+ maxY = std::max(maxY, extents.y + extents.height);
+ }
+
+ return {minX, minY, maxX - minX, maxY - minY};
+ }
+
+ Dali::Accessibility::ComponentLayer GetLayer() const override
+ {
+ return Dali::Accessibility::ComponentLayer::WINDOW;
+ }
+
+ std::int16_t GetMdiZOrder() const override
+ {
+ return 0;
+ }
+
+ bool GrabFocus() override
+ {
+ return false;
+ }
+
+ double GetAlpha() const override
+ {
+ return 0.0;
+ }
+
+ bool GrabHighlight() override
+ {
+ return false;
+ }
+
+ bool ClearHighlight() override
+ {
+ return false;
+ }
+
+ bool IsScrollable() const override
+ {
+ return false;
+ }
};
/**
- * @brief Enumeration for FilteredEvents.
+ * @brief Enumeration for CoalescableMessages.
*/
-enum class FilteredEvents
+enum class CoalescableMessages
{
- BOUNDS_CHANGED ///< Bounds changed
+ BOUNDS_CHANGED, ///< Bounds changed
+ SET_OFFSET, ///< Set offset
};
// Custom specialization of std::hash
namespace std
{
template<>
-struct hash<std::pair<FilteredEvents, Dali::Accessibility::Accessible*>>
+struct hash<std::pair<CoalescableMessages, Dali::Accessibility::Accessible*>>
{
- size_t operator()(std::pair<FilteredEvents, Dali::Accessibility::Accessible*> value) const
+ size_t operator()(std::pair<CoalescableMessages, Dali::Accessibility::Accessible*> value) const
{
return (static_cast<size_t>(value.first) * 131) ^ reinterpret_cast<size_t>(value.second);
}
*/
class BridgeBase : public Dali::Accessibility::Bridge, public Dali::ConnectionTracker
{
- std::unordered_map<std::pair<FilteredEvents, Dali::Accessibility::Accessible*>, std::pair<unsigned int, std::function<void()>>> mFilteredEvents;
+ std::unordered_map<std::pair<CoalescableMessages, Dali::Accessibility::Accessible*>, std::tuple<unsigned int, unsigned int, std::function<void()>>> mCoalescableMessages;
/**
- * @brief Removes all FilteredEvents using Tick signal.
+ * @brief Removes all CoalescableMessages using Tick signal.
*
- * @return False if mFilteredEvents is empty, otherwise true.
+ * @return False if mCoalescableMessages is empty, otherwise true.
*/
- bool TickFilteredEvents();
+ bool TickCoalescableMessages();
public:
/**
- * @brief Adds FilteredEvents, Accessible, and delay time to mFilteredEvents.
+ * @brief Adds CoalescableMessages, Accessible, and delay time to mCoalescableMessages.
*
- * @param[in] kind FilteredEvents enum value
+ * @param[in] kind CoalescableMessages enum value
* @param[in] obj Accessible object
* @param[in] delay The delay time
* @param[in] functor The function to be called // NEED TO UPDATE!
*/
- void AddFilteredEvent(FilteredEvents kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor);
+ void AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor);
/**
* @brief Callback when the visibility of the window is changed.
DBus::ValueOrError<std::tuple<int32_t, int32_t, int32_t, int32_t> > BridgeComponent::GetExtents(uint32_t coordType)
{
auto rect = FindSelf()->GetExtents(static_cast<CoordinateType>(coordType));
+
+ rect.x += mData->mExtentsOffset.first;
+ rect.y += mData->mExtentsOffset.second;
+
return std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height};
}
DBus::ValueOrError<int32_t, int32_t> BridgeComponent::GetPosition(uint32_t coordType)
{
auto rect = FindSelf()->GetExtents(static_cast<CoordinateType>(coordType));
+
+ rect.x += mData->mExtentsOffset.first;
+ rect.y += mData->mExtentsOffset.second;
+
return {static_cast<int32_t>(rect.x), static_cast<int32_t>(rect.y)};
}
/*
- * 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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
#include <dali/internal/accessibility/bridge/bridge-accessible.h>
#include <dali/internal/accessibility/bridge/bridge-action.h>
#include <dali/internal/accessibility/bridge/bridge-collection.h>
#include <dali/internal/accessibility/bridge/bridge-text.h>
#include <dali/internal/accessibility/bridge/bridge-value.h>
#include <dali/internal/accessibility/bridge/bridge-application.h>
-#include <dali/internal/accessibility/bridge/dummy-atspi.h>
+#include <dali/internal/accessibility/bridge/dummy/dummy-atspi.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/system/common/environment-variables.h>
Dali::Timer mReadIsEnabledTimer;
Dali::Timer mReadScreenReaderEnabledTimer;
Dali::Timer mForceUpTimer;
+ std::string mPreferredBusName;
public:
BridgeImpl()
mDisabledSignal.Emit();
UnembedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
+ ReleaseBusName(mPreferredBusName);
}
mHighlightedActor = {};
}
});
+ RequestBusName(mPreferredBusName);
+
auto parentAddress = EmbedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
mApplication.mParent.SetAddress(std::move(parentAddress));
mEnabledSignal.Emit();
client.method<void(Address)>("Unembed").call(plug);
}
+ void SetSocketOffset(ProxyAccessible* socket, std::int32_t x, std::int32_t y) override
+ {
+ AddCoalescableMessage(CoalescableMessages::SET_OFFSET, socket, 1.0f, [=]() {
+ auto client = CreateSocketClient(socket->GetAddress());
+
+ client.method<void(std::int32_t, std::int32_t)>("SetOffset").asyncCall([](DBus::ValueOrError<void>) {}, x, y);
+ });
+ }
+
+ void SetExtentsOffset(std::int32_t x, std::int32_t y) override
+ {
+ if(mData)
+ {
+ mData->mExtentsOffset = {x, y};
+ }
+ }
+
+ void SetPreferredBusName(std::string_view preferredBusName) override
+ {
+ if(preferredBusName == mPreferredBusName)
+ {
+ return;
+ }
+
+ std::string oldPreferredBusName = std::move(mPreferredBusName);
+ mPreferredBusName = std::string{preferredBusName};
+
+ if(IsUp())
+ {
+ ReleaseBusName(oldPreferredBusName);
+ RequestBusName(mPreferredBusName);
+ }
+ // else: request/release will be handled by ForceUp/ForceDown, respectively
+ }
+
private:
DBus::DBusClient CreateSocketClient(const Address& socket)
{
return {socket.GetBus(), ATSPI_PREFIX_PATH + socket.GetPath(), Accessible::GetInterfaceName(AtspiInterface::SOCKET), mConnectionPtr};
}
+
+ void RequestBusName(const std::string& busName)
+ {
+ if(busName.empty())
+ {
+ return;
+ }
+
+ DBus::requestBusName(mConnectionPtr, busName);
+ }
+
+ void ReleaseBusName(const std::string& busName)
+ {
+ if(busName.empty())
+ {
+ return;
+ }
+
+ DBus::releaseBusName(mConnectionPtr, busName);
+ }
}; // BridgeImpl
namespace // unnamed namespace
bridge->WindowShown(window);
}
}
+
+std::string Bridge::MakeBusNameForWidget(std::string_view widgetInstanceId)
+{
+ // The bus name should consist of dot-separated alphanumeric elements, e.g. "com.example.BusName123".
+ // Allowed characters in each element: "[A-Z][a-z][0-9]_", but no element may start with a digit.
+
+ static const char prefix[] = "com.samsung.dali.widget_";
+ static const char underscore = '_';
+
+ std::stringstream tmp;
+
+ tmp << prefix;
+
+ for(char ch : widgetInstanceId)
+ {
+ tmp << (std::isalnum(ch) ? ch : underscore);
+ }
+
+ return tmp.str();
+}
DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> > tmp{
std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height}};
- AddFilteredEvent(FilteredEvents::BOUNDS_CHANGED, obj, 1.0f, [=]() {
+ AddCoalescableMessage(CoalescableMessages::BOUNDS_CHANGED, obj, 1.0f, [=]() {
mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> >, Address>(
GetAccessiblePath(obj),
Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
AddFunctionToInterface(desc, "Embed", &BridgeSocket::Embed);
AddFunctionToInterface(desc, "Unembed", &BridgeSocket::Unembed);
+ AddFunctionToInterface(desc, "SetOffset", &BridgeSocket::SetOffset);
mDbusServer.addInterface("/", desc, true);
}
FindSelf()->Unembed(plug);
return {};
}
+
+DBus::ValueOrError<void> BridgeSocket::SetOffset(std::int32_t x, std::int32_t y)
+{
+ FindSelf()->SetOffset(x, y);
+ return {};
+}
* @copydoc Dali::Accessibility::Socket::Unembed()
*/
DBus::ValueOrError<void> Unembed(Dali::Accessibility::Address plug);
+
+ /**
+ * @copydoc Dali::Accessibility::Socket::SetOffset()
+ */
+ DBus::ValueOrError<void> SetOffset(std::int32_t x, std::int32_t y);
};
#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_SOCKET_H
// CLASS HEADER
#include <dali/internal/accessibility/bridge/accessibility-common.h>
-#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/dbus/dbus.h>
// EXTERNAL INCLUDES
#include <iostream>
return DBUS_W->eldbus_connection_unique_name_get_impl(c);
}
+void DBus::requestBusName(const DBusWrapper::ConnectionPtr& conn, const std::string& bus)
+{
+ DBUS_W->eldbus_name_request_impl(conn, bus);
+}
+
+void DBus::releaseBusName(const DBusWrapper::ConnectionPtr& conn, const std::string& bus)
+{
+ DBUS_W->eldbus_name_release_impl(conn, bus);
+}
+
bool DBus::DBusClient::getFromEinaValue(const _Eina_Value* v, void* dst)
{
return eina_value_get(const_cast<Eina_Value*>(v), dst);
return create(get(ptr), false);
}
+ void eldbus_name_request_impl(const ConnectionPtr& conn, const std::string& bus) override
+ {
+ eldbus_name_request(get(conn), bus.c_str(), ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE, nullptr, nullptr);
+ }
+
+ void eldbus_name_release_impl(const ConnectionPtr& conn, const std::string& bus) override
+ {
+ eldbus_name_release(get(conn), bus.c_str(), nullptr, nullptr);
+ }
+
struct Implementation
{
Eldbus_Service_Interface_Desc dsc;
virtual ObjectPtr eldbus_object_get_impl(const ConnectionPtr& conn, const std::string& bus, const std::string& path) = 0;
virtual ProxyPtr eldbus_proxy_get_impl(const ObjectPtr& obj, const std::string& interface) = 0;
virtual ProxyPtr eldbus_proxy_copy_impl(const ProxyPtr& ptr) = 0;
+ virtual void eldbus_name_request_impl(const ConnectionPtr& conn, const std::string& bus) = 0;
+ virtual void eldbus_name_release_impl(const ConnectionPtr& conn, const std::string& bus) = 0;
class StringStorage
{
DBusWrapper::ConnectionPtr getDBusConnectionByType(ConnectionType tp);
DBusWrapper::ConnectionPtr getDBusConnectionByName(const std::string& name);
std::string getConnectionName(const DBusWrapper::ConnectionPtr&);
+void requestBusName(const DBusWrapper::ConnectionPtr& conn, const std::string& bus);
+void releaseBusName(const DBusWrapper::ConnectionPtr& conn, const std::string& bus);
} // namespace DBus
namespace std
/*
- * 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 <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/devel-api/atspi-interfaces/component.h>
-#include <dali/internal/accessibility/bridge/dummy-atspi.h>
+#include <dali/internal/accessibility/bridge/dummy/dummy-atspi.h>
namespace Dali
{
{
}
+std::string MakeBusNameForWidget(std::string_view widgetInstanceId)
+{
+ return std::string{widgetInstanceId};
+}
+
void Accessibility::Accessible::EmitStateChanged(Accessibility::State state, int newValue, int reserved)
{
}
#define DALI_ADAPTOR_DUMMY_ATSPI_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.
void UnembedSocket(const Address& plug, const Address& socket) override
{
}
+
+ void SetSocketOffset(ProxyAccessible* socket, std::int32_t x, std::int32_t y) override
+ {
+ }
+
+ void SetExtentsOffset(std::int32_t x, std::int32_t y) override
+ {
+ }
+
+ void SetPreferredBusName(std::string_view preferredBusName) override
+ {
+ }
};
} // namespace Dali::Accessibility
${adaptor_accessibility_dir}/bridge/bridge-text.cpp
${adaptor_accessibility_dir}/bridge/bridge-value.cpp
${adaptor_accessibility_dir}/bridge/component.cpp
- ${adaptor_accessibility_dir}/bridge/dbus-tizen.cpp
+ ${adaptor_accessibility_dir}/bridge/dbus/dbus-tizen.cpp
)
SET( adaptor_accessibility_atspi_dummy_src_files
- ${adaptor_accessibility_dir}/bridge/dummy-atspi.cpp
+ ${adaptor_accessibility_dir}/bridge/dummy/dummy-atspi.cpp
)
# module: accessibility, backend: macos
#define DALI_INTERNAL_CANVAS_RENDERER_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
namespace Dali
{
#define DALI_INTERNAL_CANVAS_RENDERER_IMPL_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.
#include <dali/public-api/rendering/texture.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
namespace Dali
{
#define DALI_INTERNAL_DRAWABLE_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
namespace Dali
{
#define DALI_INTERNAL_DRAWABLE_GROUP_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
namespace Dali
{
#define DALI_INTERNAL_DRAWABLE_GROUP_IMPL_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.
#include <vector>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
namespace Dali
#define DALI_INTERNAL_DRAWABLE_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
namespace Dali
{
#define DALI_INTERNAL_GRADIENT_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
namespace Dali
{
#define DALI_INTERNAL_GRADIENT_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
namespace Dali
{
#define DALI_INTERNAL_LINEAR_GRADIENT_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
namespace Dali
{
#define DALI_INTERNAL_LINEAR_GRADIENT_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
#include <dali/internal/canvas-renderer/common/gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_PICTURE_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
namespace Dali
{
#define DALI_INTERNAL_PICTURE_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
namespace Dali
#define DALI_INTERNAL_RADIAL_GRADIENT_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
namespace Dali
{
#define DALI_INTERNAL_RADIAL_GRADIENT_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
#include <dali/internal/canvas-renderer/common/gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_SHAPE_FACTORY_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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
namespace Dali
{
#define DALI_INTERNAL_SHAPE_IMPL_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_CANVAS_RENDERER_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_DRAWABLE_GROUP_INTERFACE_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
#include <dali/internal/canvas-renderer/common/drawable-group-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_DRAWABLE_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_GRADIENT_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/gradient-impl.h>
#include <dali/internal/canvas-renderer/generic/canvas-renderer-impl-generic.h>
#define DALI_INTERNAL_GENERIC_LINEAR_GRADIENT_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
#include <dali/internal/canvas-renderer/common/linear-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_PICTURE_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
#include <dali/internal/canvas-renderer/common/picture-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_RADIAL_GRADIENT_IMPL_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
#include <dali/internal/canvas-renderer/common/radial-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_GENERIC_SHAPE_INTERFACE_GENERIC_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
#include <dali/internal/canvas-renderer/common/shape-impl.h>
namespace Dali
#define DALI_INTERNAL_TIZEN_CANVAS_RENDERER_IMPL_TIZEN_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.
#include <dali/public-api/rendering/texture.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#include <dali/internal/canvas-renderer/common/drawable-group-impl.h>
#define DALI_INTERNAL_TIZEN_DRAWABLE_GROUP_IMPL_TIZEN_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.
#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
#include <dali/internal/canvas-renderer/common/drawable-group-impl.h>
namespace Dali
#define DALI_INTERNAL_TIZEN_DRAWABLE_IMPL_TIZEN_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
#include <dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h>
#define DALI_INTERNAL_TIZEN_GRADIENT_IMPL_TIZEN_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/gradient-impl.h>
#include <dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h>
#define DALI_INTERNAL_TIZEN_LINEAR_GRADIENT_IMPL_TIZEN_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.
#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
#include <dali/internal/canvas-renderer/common/linear-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_TIZEN_PICTURE_IMPL_TIZEN_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
#include <dali/internal/canvas-renderer/common/picture-impl.h>
namespace Dali
#define DALI_INTERNAL_TIZEN_RADIAL_GRADIENT_IMPL_TIZEN_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
#include <dali/internal/canvas-renderer/common/radial-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_TIZEN_SHAPE_IMPL_TIZEN_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
#include <dali/internal/canvas-renderer/common/shape-impl.h>
namespace Dali
#define DALI_INTERNAL_UBUNTU_CANVAS_RENDERER_IMPL_UBUNTU_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.
#include <dali/public-api/rendering/texture.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/canvas-renderer-impl.h>
#include <dali/internal/canvas-renderer/common/drawable-group-impl.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#define DALI_INTERNAL_UBUNTU_DRAWABLE_GROUP_IMPL_UBUNTU_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.
#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
#include <dali/internal/canvas-renderer/common/drawable-group-impl.h>
namespace Dali
#define DALI_INTERNAL_UBUNTU_DRAWABLE_IMPL_UBUNTU_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/drawable-impl.h>
#include <dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h>
#define DALI_INTERNAL_UBUNTU_GRADIENT_IMPL_UBUNTU_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/internal/canvas-renderer/common/gradient-impl.h>
#include <dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h>
#define DALI_INTERNAL_UBUNTU_LINEAR_GRADIENT_IMPL_UBUNTU_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.
#include <dali/public-api/object/weak-handle.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
#include <dali/internal/canvas-renderer/common/linear-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_UBUNTU_PICTURE_IMPL_UBUNTU_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-picture.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
#include <dali/internal/canvas-renderer/common/picture-impl.h>
namespace Dali
#define DALI_INTERNAL_UBUNTU_RADIAL_GRADIENT_IMPL_UBUNTU_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
#include <dali/internal/canvas-renderer/common/radial-gradient-impl.h>
namespace Dali
#define DALI_INTERNAL_UBUNTU_SHAPE_IMPL_UBUNTU_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.
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
#include <dali/internal/canvas-renderer/common/shape-impl.h>
namespace Dali
if(!mSharedContext)
{
auto eglGraphics = dynamic_cast<Dali::Internal::Adaptor::EglGraphics*>(mGraphics);
- mSharedContext = eglGraphics->GetEglImplementation().GetContext();
+ if(eglGraphics)
+ {
+ mSharedContext = eglGraphics->GetEglImplementation().GetContext();
+ }
}
}
// BGR not supported in GLES
case Graphics::Format::B8G8R8_UNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_SNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_USCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_SSCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::B8G8R8_SRGB:
{
Assign(0, 0);
// ABGR not supported
case Graphics::Format::A8B8G8R8_UNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_SNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_USCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_SSCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_UINT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_SINT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A8B8G8R8_SRGB_PACK32:
{
Assign(0, 0);
// TBD which of the formats are supported
case Graphics::Format::A2R10G10B10_UNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2R10G10B10_SNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2R10G10B10_USCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2R10G10B10_SSCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2R10G10B10_UINT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2R10G10B10_SINT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_UNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_SNORM_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_USCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_SSCALED_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_UINT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::A2B10G10R10_SINT_PACK32:
{
Assign(0, 0);
break;
}
case Graphics::Format::R16_UNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_SNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_USCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_SSCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_UNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_SNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_USCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_SSCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_UNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_SNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_USCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_SSCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16_SINT:
{
Assign(0, 0);
break;
}
case Graphics::Format::R16G16B16A16_UNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_SNORM:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_USCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_SSCALED:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R16G16B16A16_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32B32_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32B32_SINT:
{
Assign(0, 0);
break;
}
case Graphics::Format::R32G32B32A32_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32B32A32_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R32G32B32A32_SFLOAT:
{
Assign(0, 0);
break;
}
case Graphics::Format::R64_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64_SFLOAT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64A64_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64A64_SINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::R64G64B64A64_SFLOAT:
{
Assign(0, 0);
break;
}
case Graphics::Format::B10G11R11_UFLOAT_PACK32:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::E5B9G9R9_UFLOAT_PACK32:
{
Assign(0, 0);
break;
}
case Graphics::Format::S8_UINT:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::D16_UNORM_S8_UINT:
{
Assign(0, 0);
break;
}
case Graphics::Format::BC1_RGB_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC1_RGB_SRGB_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC1_RGBA_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC1_RGBA_SRGB_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC2_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC2_SRGB_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC3_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC3_SRGB_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC4_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC4_SNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC5_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC5_SNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC6H_UFLOAT_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC6H_SFLOAT_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC7_UNORM_BLOCK:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::BC7_SRGB_BLOCK:
{
Assign(0, 0);
break;
}
case Graphics::Format::PVRTC2_2BPP_UNORM_BLOCK_IMG:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::PVRTC2_4BPP_UNORM_BLOCK_IMG:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::PVRTC1_2BPP_SRGB_BLOCK_IMG:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::PVRTC1_4BPP_SRGB_BLOCK_IMG:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::PVRTC2_2BPP_SRGB_BLOCK_IMG:
- {
- Assign(0, 0);
- break;
- }
case Graphics::Format::PVRTC2_4BPP_SRGB_BLOCK_IMG:
{
Assign(0, 0);
#include <dali/public-api/object/property-map.h>
// INTERNAL HEADERS
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/internal/imaging/common/image-operations.h>
#include <dali/internal/imaging/common/pixel-buffer-impl.h>
const unsigned int DECODED_RGB888 = 3;
const unsigned int DECODED_RGBA8888 = 4;
+const char* CHROMINANCE_SUBSAMPLING_OPTIONS_ENV[] = {"DALI_ENABLE_DECODE_JPEG_TO_YUV_444",
+ "DALI_ENABLE_DECODE_JPEG_TO_YUV_422",
+ "DALI_ENABLE_DECODE_JPEG_TO_YUV_420",
+ "",
+ "DALI_ENABLE_DECODE_JPEG_TO_YUV_440",
+ "DALI_ENABLE_DECODE_JPEG_TO_YUV_411"};
+
+static bool gSubsamplingFormatTable[TJ_NUMSAMP] = {
+ false,
+};
+static bool gIsSubsamplingFormatTableInitialized = false;
+
/** Transformations that can be applied to decoded pixels to respect exif orientation
* codes in image headers */
enum class JpegTransform
jmp_buf jumpBuffer;
};
+static bool IsSubsamplingFormatEnabled(int chrominanceSubsampling)
+{
+ if(!gIsSubsamplingFormatTableInitialized)
+ {
+ for(int i = 0; i < TJ_NUMSAMP; i++)
+ {
+ auto valueString = Dali::EnvironmentVariable::GetEnvironmentVariable(CHROMINANCE_SUBSAMPLING_OPTIONS_ENV[i]);
+ gSubsamplingFormatTable[i] = valueString ? std::atoi(valueString) : false;
+ }
+
+ gIsSubsamplingFormatTableInitialized = true;
+ }
+
+ return gSubsamplingFormatTable[chrominanceSubsampling];
+}
+
/**
* @brief Called by the JPEG library when it hits an error.
* We jump out of the library so our loader code can return an error.
bool result = false;
- // Now we support YUV420 only
- if(decodeToYuv && chrominanceSubsampling == TJSAMP_420 && transform == JpegTransform::NONE)
+ // Check decoding format
+ if(decodeToYuv && IsSubsamplingFormatEnabled(chrominanceSubsampling) && transform == JpegTransform::NONE)
{
unsigned char* planes[3];
#include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
#include <bundle.h>
#include <widget_base.h>
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+
namespace Dali
{
namespace Internal
void WidgetImplTizen::SetInformation(Dali::Window window, const std::string& widgetId)
{
+ using Dali::Accessibility::Bridge;
+
mWindow = window;
mWidgetId = widgetId;
+
+ auto preferredBusName = Bridge::MakeBusNameForWidget(widgetId);
+ Bridge::GetCurrentBridge()->SetPreferredBusName(preferredBusName);
+
+ // Widget should not send window events (which could narrow down the navigation context)
+ auto& suppressedEvents = Accessibility::Accessible::Get(window.GetRootLayer())->GetSuppressedEvents();
+ suppressedEvents[Accessibility::AtspiEvent::STATE_CHANGED] = true;
+ suppressedEvents[Accessibility::AtspiEvent::WINDOW_CHANGED] = true;
}
Dali::Window WidgetImplTizen::GetWindow() const
${adaptor_text_dir}/text-abstraction/plugin/bitmap-font-cache-item.cpp
${adaptor_text_dir}/text-abstraction/plugin/embedded-item.cpp
${adaptor_text_dir}/text-abstraction/plugin/font-client-utils.cpp
+ ${adaptor_text_dir}/text-abstraction/plugin/font-client-plugin-cache-handler.cpp
${adaptor_text_dir}/text-abstraction/plugin/font-client-plugin-impl.cpp
${adaptor_text_dir}/text-abstraction/plugin/font-face-cache-item.cpp
${adaptor_text_dir}/text-abstraction/plugin/font-face-glyph-cache-manager.cpp
mPlugin->GetDefaultPlatformFontDescription(fontDescription);
}
-void FontClient::GetDescription(FontId id, FontDescription& fontDescription)
+void FontClient::GetDescription(FontId fontId, FontDescription& fontDescription)
{
CreatePlugin();
- mPlugin->GetDescription(id, fontDescription);
+ mPlugin->GetDescription(fontId, fontDescription);
}
-PointSize26Dot6 FontClient::GetPointSize(FontId id)
+PointSize26Dot6 FontClient::GetPointSize(FontId fontId)
{
CreatePlugin();
- return mPlugin->GetPointSize(id);
+ return mPlugin->GetPointSize(fontId);
}
bool FontClient::IsCharacterSupportedByFont(FontId fontId, Character character)
{
CreatePlugin();
- return mPlugin->GetFontId(path,
- requestedPointSize,
- faceIndex,
- true);
+ return mPlugin->GetFontIdByPath(path,
+ requestedPointSize,
+ faceIndex,
+ true);
}
FontId FontClient::GetFontId(const FontDescription& fontDescription,
/**
* @copydoc Dali::TextAbstraction::FontClient::GetDescription()
*/
- void GetDescription(FontId id, FontDescription& fontDescription);
+ void GetDescription(FontId fontId, FontDescription& fontDescription);
/**
* @copydoc Dali::TextAbstraction::FontClient::GetPointSize()
*/
- PointSize26Dot6 GetPointSize(FontId id);
+ PointSize26Dot6 GetPointSize(FontId fontId);
/**
* @copydoc Dali::TextAbstraction::FontClient::IsCharacterSupportedByFont()
namespace Dali::TextAbstraction::Internal
{
-BitmapFontCacheItem::BitmapFontCacheItem(const BitmapFont& bitmapFont, FontId fontId)
+BitmapFontCacheItem::BitmapFontCacheItem(const BitmapFont& bitmapFont)
: font(bitmapFont),
- id(fontId)
+ pixelBuffers(),
+ id(0u)
{
// Resize the vector with the pixel buffers.
pixelBuffers.resize(bitmapFont.glyphs.size());
* @param[in] bitmapFont The font to cache
* @param[in] fontId The id of the font
*/
- BitmapFontCacheItem(const BitmapFont& bitmapFont, FontId fontId);
+ BitmapFontCacheItem(const BitmapFont& bitmapFont);
/**
* Destructor
-#ifndef DALI_INTERNAL_TEXTABSTRACTION_PLUGIN_EMBEDDED_ITEM_H
-#define DALI_INTERNAL_TEXTABSTRACTION_PLUGIN_EMBEDDED_ITEM_H
+#ifndef DALI_INTERNAL_TEXT_ABSTRACTION_PLUGIN_EMBEDDED_ITEM_H
+#define DALI_INTERNAL_TEXT_ABSTRACTION_PLUGIN_EMBEDDED_ITEM_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.
*/
struct EmbeddedItem
{
+ // Default constructor.
+ EmbeddedItem() = default;
+
+ // Default destructor.
+ ~EmbeddedItem() = default;
+
/**
* Get metrics for glyph from image
* @param[in] item The embedded image
void CreateBitmap(const std::vector<PixelBufferCacheItem>& pixelBufferCache,
Dali::TextAbstraction::FontClient::GlyphBufferData& data);
- PixelBufferId pixelBufferId; ///< Index to the vector of pixel buffers
- unsigned int width; ///< The desired width.
- unsigned int height; ///< The desired height.
+ PixelBufferId pixelBufferId{0u}; ///< Index to the vector of pixel buffers
+ uint32_t width{0u}; ///< The desired width.
+ uint32_t height{0u}; ///< The desired height.
+ GlyphIndex index{0u}; ///< The glyph index of this embedded items. Should be bigger than 0.
};
} // namespace Dali::TextAbstraction::Internal
-#endif //DALI_INTERNAL_TEXTABSTRACTION_PLUGIN_EMBEDDED_ITEM_H
+#endif //DALI_INTERNAL_TEXT_ABSTRACTION_PLUGIN_EMBEDDED_ITEM_H
--- /dev/null
+/*
+ * 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.
+ * 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 <dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <fontconfig/fontconfig.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/internal/text/text-abstraction/font-client-impl.h>
+#include <dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.h>
+#include <dali/internal/text/text-abstraction/plugin/font-client-utils.h>
+
+#if defined(DEBUG_ENABLED)
+extern Dali::Integration::Log::Filter* gFontClientLogFilter;
+
+#define FONT_LOG_DESCRIPTION(fontDescription, prefix) \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, #prefix " description; family : [%s]\n", fontDescription.family.c_str()); \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, \
+ " path : [%s]\n" \
+ " width : [%s]\n" \
+ " weight : [%s]\n" \
+ " slant : [%s]\n\n", \
+ fontDescription.path.c_str(), \
+ FontWidth::Name[fontDescription.width], \
+ FontWeight::Name[fontDescription.weight], \
+ FontSlant::Name[fontDescription.slant])
+
+#define FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor) \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, \
+ " character : %p\n" \
+ " requestedPointSize : %d\n" \
+ " preferColor : %s\n", \
+ charcode, \
+ requestedPointSize, \
+ (preferColor ? "true" : "false"))
+
+#else
+
+#define FONT_LOG_DESCRIPTION(fontDescription, prefix)
+#define FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor)
+
+#endif
+
+namespace
+{
+} // namespace
+
+namespace Dali::TextAbstraction::Internal
+{
+namespace
+{
+/**
+ * @brief Free the resources allocated by the FcCharSet objects.
+ *
+ * @param[in] characterSets The vector of character sets.
+ */
+void DestroyCharacterSets(CharacterSetList& characterSets)
+{
+ for(auto& item : characterSets)
+ {
+ if(item)
+ {
+ FcCharSetDestroy(item);
+ }
+ }
+}
+
+/**
+ * @brief Retrieves the fonts present in the platform.
+ *
+ * @note Need to call FcFontSetDestroy to free the allocated resources.
+ *
+ * @return A font fonfig data structure with the platform's fonts.
+ */
+_FcFontSet* GetFcFontSet()
+{
+ FcFontSet* fontset = nullptr;
+
+ // create a new pattern.
+ // a pattern holds a set of names, each name refers to a property of the font
+ FcPattern* pattern = FcPatternCreate();
+
+ if(nullptr != pattern)
+ {
+ // create an object set used to define which properties are to be returned in the patterns from FcFontList.
+ FcObjectSet* objectSet = FcObjectSetCreate();
+
+ if(nullptr != objectSet)
+ {
+ // build an object set from a list of property names
+ FcObjectSetAdd(objectSet, FC_FILE);
+ FcObjectSetAdd(objectSet, FC_FAMILY);
+ FcObjectSetAdd(objectSet, FC_WIDTH);
+ FcObjectSetAdd(objectSet, FC_WEIGHT);
+ FcObjectSetAdd(objectSet, FC_SLANT);
+
+ // get a list of fonts
+ // creates patterns from those fonts containing only the objects in objectSet and returns the set of unique such patterns
+ fontset = FcFontList(nullptr /* the default configuration is checked to be up to date, and used */, pattern, objectSet); // Creates a FcFontSet that needs to be destroyed by calling FcFontSetDestroy.
+
+ // clear up the object set
+ FcObjectSetDestroy(objectSet);
+ }
+
+ // clear up the pattern
+ FcPatternDestroy(pattern);
+ }
+
+ return fontset;
+}
+
+/**
+ * @brief Helper for GetDefaultFonts etc.
+ *
+ * @note CharacterSetList is a vector of FcCharSet that are reference counted. It's needed to call FcCharSetDestroy to decrease the reference counter.
+ *
+ * @param[in] fontDescription A font description.
+ * @param[out] fontList A list of the fonts which are a close match for fontDescription.
+ * @param[out] characterSetList A list of character sets which are a close match for fontDescription.
+ */
+void SetFontList(const FontDescription& fontDescription, FontList& fontList, CharacterSetList& characterSetList)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ fontList.clear();
+
+ FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription); // Creates a pattern that needs to be destroyed by calling FcPatternDestroy.
+
+ FcResult result = FcResultMatch;
+
+ // Match the pattern.
+ FcFontSet* fontSet = FcFontSort(nullptr /* use default configure */,
+ fontFamilyPattern,
+ false /* don't trim */,
+ nullptr,
+ &result); // FcFontSort creates a font set that needs to be destroyed by calling FcFontSetDestroy.
+
+ if(nullptr != fontSet)
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of fonts found : [%d]\n", fontSet->nfont);
+ // Reserve some space to avoid reallocations.
+ fontList.reserve(fontSet->nfont);
+
+ for(int i = 0u; i < fontSet->nfont; ++i)
+ {
+ FcPattern* fontPattern = fontSet->fonts[i];
+
+ FontPath path;
+
+ // Skip fonts with no path
+ if(GetFcString(fontPattern, FC_FILE, path))
+ {
+ // Retrieve the character set. Need to call FcCharSetDestroy to free the resources.
+ FcCharSet* characterSet = nullptr;
+ FcPatternGetCharSet(fontPattern, FC_CHARSET, 0u, &characterSet);
+
+ // Increase the reference counter of the character set.
+ characterSetList.PushBack(FcCharSetCopy(characterSet));
+
+ fontList.push_back(FontDescription());
+ FontDescription& newFontDescription = fontList.back();
+
+ newFontDescription.path = std::move(path);
+
+ int width = 0;
+ int weight = 0;
+ int slant = 0;
+ GetFcString(fontPattern, FC_FAMILY, newFontDescription.family);
+ GetFcInt(fontPattern, FC_WIDTH, width);
+ GetFcInt(fontPattern, FC_WEIGHT, weight);
+ GetFcInt(fontPattern, FC_SLANT, slant);
+ newFontDescription.width = IntToWidthType(width);
+ newFontDescription.weight = IntToWeightType(weight);
+ newFontDescription.slant = IntToSlantType(slant);
+
+ FONT_LOG_DESCRIPTION(newFontDescription, "new font");
+ }
+ }
+
+ // Destroys the font set created by FcFontSort.
+ FcFontSetDestroy(fontSet);
+ }
+ else
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " No fonts found.\n");
+ }
+
+ // Destroys the pattern created by FcPatternCreate in CreateFontFamilyPattern.
+ FcPatternDestroy(fontFamilyPattern);
+}
+
+} // namespace
+
+FontClient::Plugin::CacheHandler::FallbackCacheItem::FallbackCacheItem(FontDescription&& font, FontList* fallbackFonts, CharacterSetList* characterSets)
+: fontDescription{std::move(font)},
+ fallbackFonts{fallbackFonts},
+ characterSets{characterSets}
+{
+}
+
+FontClient::Plugin::CacheHandler::FontDescriptionCacheItem::FontDescriptionCacheItem(const FontDescription& fontDescription,
+ FontDescriptionId index)
+: fontDescription{fontDescription},
+ index{index}
+{
+}
+
+FontClient::Plugin::CacheHandler::FontDescriptionCacheItem::FontDescriptionCacheItem(FontDescription&& fontDescription,
+ FontDescriptionId index)
+: fontDescription{std::move(fontDescription)},
+ index{index}
+{
+}
+
+FontClient::Plugin::CacheHandler::FontDescriptionSizeCacheKey::FontDescriptionSizeCacheKey(FontDescriptionId fontDescriptionId,
+ PointSize26Dot6 requestedPointSize)
+: fontDescriptionId(fontDescriptionId),
+ requestedPointSize(requestedPointSize)
+{
+}
+
+// CacheHandler
+FontClient::Plugin::CacheHandler::CacheHandler()
+: mDefaultFontDescription(),
+ mSystemFonts(),
+ mDefaultFonts(),
+ mFontIdCache(),
+ mFontFaceCache(),
+ mValidatedFontCache(),
+ mFontDescriptionCache(),
+ mCharacterSetCache(),
+ mFontDescriptionSizeCache(),
+ mEllipsisCache(),
+ mEmbeddedItemCache(),
+ mLatestFoundFontDescription(),
+ mLatestFoundFontDescriptionId(0u),
+ mLatestFoundCacheKey(0, 0),
+ mLatestFoundCacheIndex(0u),
+ mDefaultFontDescriptionCached(false)
+{
+}
+
+FontClient::Plugin::CacheHandler::~CacheHandler()
+{
+ ClearCache();
+}
+
+void FontClient::Plugin::CacheHandler::ClearCache()
+{
+ mDefaultFontDescription = FontDescription();
+
+ mSystemFonts.clear();
+ mDefaultFonts.clear();
+
+ DestroyCharacterSets(mDefaultFontCharacterSets);
+ mDefaultFontCharacterSets.Clear();
+
+ ClearFallbackCache();
+ mFallbackCache.clear();
+
+ mFontIdCache.clear();
+
+ ClearCharacterSetFromFontFaceCache();
+ mFontFaceCache.clear();
+
+ mValidatedFontCache.clear();
+ mFontDescriptionCache.clear();
+
+ DestroyCharacterSets(mCharacterSetCache);
+ mCharacterSetCache.Clear();
+
+ mFontDescriptionSizeCache.clear();
+ mFontDescriptionSizeCache.rehash(0); // Note : unordered_map.clear() didn't deallocate memory
+
+ mEllipsisCache.clear();
+ mPixelBufferCache.clear();
+ mEmbeddedItemCache.clear();
+ mBitmapFontCache.clear();
+
+ mLatestFoundFontDescription.family.clear();
+ mLatestFoundCacheKey = FontDescriptionSizeCacheKey(0, 0);
+
+ mDefaultFontDescriptionCached = false;
+}
+
+void FontClient::Plugin::CacheHandler::ResetSystemDefaults()
+{
+ mDefaultFontDescriptionCached = false;
+}
+
+// Clear cache area
+
+void FontClient::Plugin::CacheHandler::ClearFallbackCache()
+{
+ for(auto& item : mFallbackCache)
+ {
+ if(nullptr != item.fallbackFonts)
+ {
+ delete item.fallbackFonts;
+ }
+
+ if(nullptr != item.characterSets)
+ {
+ // Free the resources allocated by the FcCharSet objects in the 'characterSets' vector.
+ DestroyCharacterSets(*item.characterSets);
+ delete item.characterSets;
+ }
+ }
+}
+
+void FontClient::Plugin::CacheHandler::ClearCharacterSetFromFontFaceCache()
+{
+ for(auto& item : mFontFaceCache)
+ {
+ FcCharSetDestroy(item.mCharacterSet);
+ item.mCharacterSet = nullptr;
+ }
+}
+
+void FontClient::Plugin::CacheHandler::ClearCharacterSet()
+{
+ // Decrease the reference counter and eventually free the resources allocated by FcCharSet objects.
+ DestroyCharacterSets(mDefaultFontCharacterSets);
+ DestroyCharacterSets(mCharacterSetCache);
+ mDefaultFontCharacterSets.Clear();
+ mCharacterSetCache.Clear();
+
+ for(auto& item : mFallbackCache)
+ {
+ // Decrease the reference counter and eventually free the resources allocated by FcCharSet objects.
+ DestroyCharacterSets(*item.characterSets);
+
+ delete item.characterSets;
+ item.characterSets = nullptr;
+ }
+
+ // Set the character set pointer as null. Will be created again the next time IsCharacterSupportedByFont()
+ ClearCharacterSetFromFontFaceCache();
+}
+
+void FontClient::Plugin::CacheHandler::CreateCharacterSet()
+{
+ for(const auto& description : mDefaultFonts)
+ {
+ mDefaultFontCharacterSets.PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
+ }
+
+ for(const auto& description : mFontDescriptionCache)
+ {
+ mCharacterSetCache.PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
+ }
+
+ for(auto& item : mFallbackCache)
+ {
+ if(nullptr != item.fallbackFonts)
+ {
+ if(nullptr == item.characterSets)
+ {
+ item.characterSets = new CharacterSetList;
+ }
+
+ for(const auto& description : *(item.fallbackFonts))
+ {
+ item.characterSets->PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
+ }
+ }
+ }
+}
+
+// System / Default
+
+void FontClient::Plugin::CacheHandler::InitSystemFonts()
+{
+ if(mSystemFonts.empty())
+ {
+ FcFontSet* fontSet = GetFcFontSet(); // Creates a FcFontSet that needs to be destroyed by calling FcFontSetDestroy.
+
+ if(fontSet)
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of system fonts : %d\n", fontSet->nfont);
+
+ // Reserve some space to avoid reallocations.
+ mSystemFonts.reserve(fontSet->nfont);
+
+ for(int i = 0u; i < fontSet->nfont; ++i)
+ {
+ FcPattern* fontPattern = fontSet->fonts[i];
+
+ FontPath path;
+
+ // Skip fonts with no path
+ if(GetFcString(fontPattern, FC_FILE, path))
+ {
+ mSystemFonts.push_back(FontDescription());
+ FontDescription& fontDescription = mSystemFonts.back();
+
+ fontDescription.path = std::move(path);
+
+ int width = 0;
+ int weight = 0;
+ int slant = 0;
+ GetFcString(fontPattern, FC_FAMILY, fontDescription.family);
+ GetFcInt(fontPattern, FC_WIDTH, width);
+ GetFcInt(fontPattern, FC_WEIGHT, weight);
+ GetFcInt(fontPattern, FC_SLANT, slant);
+ fontDescription.width = IntToWidthType(width);
+ fontDescription.weight = IntToWeightType(weight);
+ fontDescription.slant = IntToSlantType(slant);
+
+ FONT_LOG_DESCRIPTION(fontDescription, "system fonts");
+ }
+ }
+
+ // Destroys the font set created.
+ FcFontSetDestroy(fontSet);
+ }
+ }
+}
+
+void FontClient::Plugin::CacheHandler::InitDefaultFonts()
+{
+ if(mDefaultFonts.empty())
+ {
+ FontDescription fontDescription;
+ fontDescription.family = DefaultFontFamily(); // todo This could be set to the Platform font
+ fontDescription.width = DefaultFontWidth();
+ fontDescription.weight = DefaultFontWeight();
+ fontDescription.slant = DefaultFontSlant();
+ SetFontList(fontDescription, mDefaultFonts, mDefaultFontCharacterSets);
+ }
+}
+
+void FontClient::Plugin::CacheHandler::InitDefaultFontDescription()
+{
+ if(!mDefaultFontDescriptionCached)
+ {
+ // Clear any font config stored info in the caches.
+ ClearCharacterSet();
+
+ // FcInitBringUptoDate did not seem to reload config file as was still getting old default font.
+ FcInitReinitialize();
+
+ FcPattern* matchPattern = FcPatternCreate(); // Creates a pattern that needs to be destroyed by calling FcPatternDestroy.
+
+ if(nullptr != matchPattern)
+ {
+ FcConfigSubstitute(nullptr, matchPattern, FcMatchPattern);
+ FcDefaultSubstitute(matchPattern);
+
+ FcCharSet* characterSet = nullptr;
+ bool matched = MatchFontDescriptionToPattern(matchPattern, mDefaultFontDescription, &characterSet);
+
+ // Caching the default font description
+ if(matched)
+ {
+ // Copy default font description info.
+ // Due to the type changed, we need to make some temperal font description.
+ FontDescription tempFontDescription = mDefaultFontDescription;
+
+ // Add the path to the cache.
+ tempFontDescription.type = FontDescription::FACE_FONT;
+ mFontDescriptionCache.push_back(tempFontDescription);
+
+ // Set the index to the vector of paths to font file names.
+ const FontDescriptionId fontDescriptionId = mFontDescriptionCache.size();
+
+ FONT_LOG_DESCRIPTION(tempFontDescription, "default platform font");
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " default font fontDescriptionId : %d\n", fontDescriptionId);
+
+ // Cache the index and the matched font's description.
+ CacheValidateFont(std::move(tempFontDescription), fontDescriptionId);
+ }
+ else
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " default font validation failed for font [%s]\n", mDefaultFontDescription.family.c_str());
+ }
+
+ // Decrease the reference counter of the character set as it's not stored.
+ // Note. the cached default font description will increase reference counter by
+ // mFontDescriptionCache in CreateCharacterSet(). So we can decrease reference counter here.
+ FcCharSetDestroy(characterSet);
+
+ // Destroys the pattern created.
+ FcPatternDestroy(matchPattern);
+ }
+
+ // Create again the character sets as they are not valid after FcInitReinitialize()
+ CreateCharacterSet();
+
+ mDefaultFontDescriptionCached = true;
+ }
+}
+
+// Validate
+
+bool FontClient::Plugin::CacheHandler::FindValidatedFont(const FontDescription& fontDescription,
+ FontDescriptionId& fontDescriptionId)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of validated fonts in the cache : %d\n", mValidatedFontCache.size());
+
+ fontDescriptionId = 0u;
+
+ // Fast cut if inputed family is empty.
+ if(DALI_UNLIKELY(fontDescription.family.empty()))
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description not found / fontDescription.family is empty!\n");
+ return false;
+ }
+
+ // Heuristic optimize code : Compare with latest found item.
+ if((fontDescription.width == mLatestFoundFontDescription.width) &&
+ (fontDescription.weight == mLatestFoundFontDescription.weight) &&
+ (fontDescription.slant == mLatestFoundFontDescription.slant) &&
+ (fontDescription.family == mLatestFoundFontDescription.family))
+ {
+ fontDescriptionId = mLatestFoundFontDescriptionId;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description same as latest, id : %d\n", fontDescriptionId);
+ return true;
+ }
+
+ for(const auto& item : mValidatedFontCache)
+ {
+ if((fontDescription.width == item.fontDescription.width) &&
+ (fontDescription.weight == item.fontDescription.weight) &&
+ (fontDescription.slant == item.fontDescription.slant) &&
+ (fontDescription.family == item.fontDescription.family))
+ {
+ fontDescriptionId = item.index;
+
+ mLatestFoundFontDescription = fontDescription;
+ mLatestFoundFontDescriptionId = fontDescriptionId;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description found, id : %d\n", fontDescriptionId);
+ return true;
+ }
+ }
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description not found\n");
+ return false;
+}
+
+void FontClient::Plugin::CacheHandler::ValidateFont(const FontDescription& fontDescription,
+ FontDescriptionId& fontDescriptionId)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ FONT_LOG_DESCRIPTION(fontDescription, "");
+
+ // Create a font pattern.
+ FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription);
+
+ FontDescription description;
+
+ FcCharSet* characterSet = nullptr;
+ bool matched = MatchFontDescriptionToPattern(fontFamilyPattern, description, &characterSet);
+ FcPatternDestroy(fontFamilyPattern);
+
+ if(matched && (nullptr != characterSet))
+ {
+ // Add the path to the cache.
+ description.type = FontDescription::FACE_FONT;
+ mFontDescriptionCache.push_back(description);
+
+ // Set the index to the vector of paths to font file names.
+ fontDescriptionId = mFontDescriptionCache.size();
+
+ FONT_LOG_DESCRIPTION(description, "matched");
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fontDescriptionId : %d\n", fontDescriptionId);
+
+ // The reference counter of the character set has already been increased in MatchFontDescriptionToPattern.
+ mCharacterSetCache.PushBack(characterSet);
+
+ if((fontDescription.family != description.family) ||
+ (fontDescription.width != description.width) ||
+ (fontDescription.weight != description.weight) ||
+ (fontDescription.slant != description.slant))
+ {
+ // Cache the given font's description if it's different than the matched.
+ CacheValidateFont(std::move(FontDescription(fontDescription)), fontDescriptionId);
+ }
+
+ // Cache the index and the matched font's description.
+ CacheValidateFont(std::move(description), fontDescriptionId);
+ }
+ else
+ {
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font validation failed for font [%s]\n", fontDescription.family.c_str());
+ }
+}
+
+void FontClient::Plugin::CacheHandler::CacheValidateFont(FontDescription&& fontDescription,
+ FontDescriptionId validatedFontId)
+{
+ mValidatedFontCache.emplace_back(std::move(FontDescriptionCacheItem(fontDescription, validatedFontId)));
+}
+
+// Fallback
+
+bool FontClient::Plugin::CacheHandler::FindFallbackFontList(const FontDescription& fontDescription,
+ FontList*& fontList,
+ CharacterSetList*& characterSetList) const
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of fallback font lists in the cache : %d\n", mFallbackCache.size());
+
+ fontList = nullptr;
+
+ for(const auto& item : mFallbackCache)
+ {
+ if(!fontDescription.family.empty() &&
+ (fontDescription.family == item.fontDescription.family) &&
+ (fontDescription.width == item.fontDescription.width) &&
+ (fontDescription.weight == item.fontDescription.weight) &&
+ (fontDescription.slant == item.fontDescription.slant))
+ {
+ fontList = item.fallbackFonts;
+ characterSetList = item.characterSets;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fallback font list found.\n");
+ return true;
+ }
+ }
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fallback font list not found.\n");
+ return false;
+}
+
+void FontClient::Plugin::CacheHandler::CacheFallbackFontList(FontDescription&& fontDescription,
+ FontList*& fontList,
+ CharacterSetList*& characterSetList)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+
+ fontList = new FontList;
+ characterSetList = new CharacterSetList;
+
+ SetFontList(fontDescription, *fontList, *characterSetList);
+#ifdef __APPLE__
+ FontDescription appleColorEmoji;
+ appleColorEmoji.family = "Apple Color Emoji";
+ appleColorEmoji.width = fontDescription.width;
+ appleColorEmoji.weight = fontDescription.weight;
+ appleColorEmoji.slant = fontDescription.slant;
+ FontList emojiFontList;
+ CharacterSetList emojiCharSetList;
+ SetFontList(appleColorEmoji, emojiFontList, emojiCharSetList);
+
+ std::move(fontList->begin(), fontList->end(), std::back_inserter(emojiFontList));
+ emojiCharSetList.Insert(emojiCharSetList.End(), characterSetList->Begin(), characterSetList->End());
+ *fontList = std::move(emojiFontList);
+ *characterSetList = std::move(emojiCharSetList);
+#endif
+
+ // Add the font-list to the cache.
+ mFallbackCache.push_back(std::move(CacheHandler::FallbackCacheItem(std::move(fontDescription), fontList, characterSetList)));
+}
+
+// Font / FontFace
+
+bool FontClient::Plugin::CacheHandler::FindFontByPath(const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex faceIndex,
+ FontId& fontId) const
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " path : [%s]\n", path.c_str());
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize : %d\n", requestedPointSize);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of fonts in the cache : %d\n", mFontFaceCache.size());
+
+ fontId = 0u;
+ for(const auto& cacheItem : mFontFaceCache)
+ {
+ if(cacheItem.mRequestedPointSize == requestedPointSize &&
+ cacheItem.mFaceIndex == faceIndex &&
+ cacheItem.mPath == path)
+ {
+ fontId = cacheItem.mFontId + 1u;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font found, id : %d\n", fontId);
+ return true;
+ }
+ }
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font not found\n");
+ return false;
+}
+
+bool FontClient::Plugin::CacheHandler::FindFont(FontDescriptionId fontDescriptionId,
+ PointSize26Dot6 requestedPointSize,
+ FontCacheIndex& fontCacheIndex)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fontDescriptionId : %d\n", fontDescriptionId);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize : %d\n", requestedPointSize);
+
+ fontCacheIndex = 0u;
+
+ const FontDescriptionSizeCacheKey key(fontDescriptionId, requestedPointSize);
+
+ // Heuristic optimize code : Compare with latest found item.
+ if(key == mLatestFoundCacheKey)
+ {
+ fontCacheIndex = mLatestFoundCacheIndex;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font same as latest, index of font cache : %d\n", fontCacheIndex);
+ return true;
+ }
+
+ const auto& iter = mFontDescriptionSizeCache.find(key);
+ if(iter != mFontDescriptionSizeCache.cend())
+ {
+ fontCacheIndex = iter->second;
+
+ mLatestFoundCacheKey = key;
+ mLatestFoundCacheIndex = fontCacheIndex;
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font found, index of font cache : %d\n", fontCacheIndex);
+ return true;
+ }
+
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font not found.\n");
+ return false;
+}
+
+void FontClient::Plugin::CacheHandler::CacheFontDescriptionSize(FontDescriptionId fontDescriptionId, PointSize26Dot6 requestedPointSize, FontCacheIndex fontCacheIndex)
+{
+ mFontDescriptionSizeCache.emplace(FontDescriptionSizeCacheKey(fontDescriptionId, requestedPointSize), fontCacheIndex);
+}
+
+void FontClient::Plugin::CacheHandler::CacheFontPath(FT_Face ftFace, FontId fontId, PointSize26Dot6 requestedPointSize, const FontPath& path)
+{
+ FontDescription description;
+ description.path = path;
+ description.family = std::move(FontFamily(ftFace->family_name));
+ description.weight = FontWeight::NONE;
+ description.width = FontWidth::NONE;
+ description.slant = FontSlant::NONE;
+
+ // Note FreeType doesn't give too much info to build a proper font style.
+ if(ftFace->style_flags & FT_STYLE_FLAG_ITALIC)
+ {
+ description.slant = FontSlant::ITALIC;
+ }
+ if(ftFace->style_flags & FT_STYLE_FLAG_BOLD)
+ {
+ description.weight = FontWeight::BOLD;
+ }
+
+ FontDescriptionId fontDescriptionId = 0u;
+ if(!FindValidatedFont(description, fontDescriptionId))
+ {
+ // TODO : Due to the FontClient pattern match process, we cannot pass dali-toolkit UTC.
+ // Can't we use ValidateFont here?
+ /*
+ // Use font config to validate the font's description.
+ ValidateFont(description, fontDescriptionId);
+
+ const FontCacheIndex fontCacheIndex = mFontIdCache[fontId - 1u].index;
+ mFontFaceCache[fontCacheIndex].mCharacterSet = FcCharSetCopy(mCharacterSetCache[fontDescriptionId - 1u]); // Increases the reference counter.
+
+ // Cache the pair 'fontDescriptionId, requestedPointSize' to improve the following queries.
+ mFontDescriptionSizeCache.emplace(CacheHandler::FontDescriptionSizeCacheKey(fontDescriptionId, requestedPointSize), fontCacheIndex);
+ */
+
+ FcPattern* pattern = CreateFontFamilyPattern(description); // Creates a new pattern that needs to be destroyed by calling FcPatternDestroy.
+
+ FcResult result = FcResultMatch;
+ FcPattern* match = FcFontMatch(nullptr, pattern, &result); // FcFontMatch creates a new pattern that needs to be destroyed by calling FcPatternDestroy.
+
+ FcCharSet* characterSet = nullptr;
+ FcPatternGetCharSet(match, FC_CHARSET, 0u, &characterSet);
+
+ const FontCacheIndex fontCacheIndex = mFontIdCache[fontId - 1u].index;
+ mFontFaceCache[fontCacheIndex].mCharacterSet = FcCharSetCopy(characterSet); // Increases the reference counter.
+
+ // Destroys the created patterns.
+ FcPatternDestroy(match);
+ FcPatternDestroy(pattern);
+
+ // Add the path to the cache.
+ description.type = FontDescription::FACE_FONT;
+ mFontDescriptionCache.push_back(description);
+
+ // Set the index to the vector of paths to font file names.
+ fontDescriptionId = mFontDescriptionCache.size();
+
+ // Increase the reference counter and add the character set to the cache.
+ mCharacterSetCache.PushBack(FcCharSetCopy(characterSet));
+
+ // Cache the index and the font's description.
+ CacheValidateFont(std::move(description), fontDescriptionId);
+
+ // Cache the pair 'fontDescriptionId, requestedPointSize' to improve the following queries.
+ CacheFontDescriptionSize(fontDescriptionId, requestedPointSize, fontCacheIndex);
+ }
+}
+
+FontId FontClient::Plugin::CacheHandler::CacheFontFaceCacheItem(FontFaceCacheItem&& fontFaceCacheItem)
+{
+ // Set the index to the font's id cache.
+ fontFaceCacheItem.mFontId = mFontIdCache.size();
+
+ // Create the font id item to cache.
+ FontIdCacheItem fontIdCacheItem;
+ fontIdCacheItem.type = FontDescription::FACE_FONT;
+
+ // Set the index to the FreeType font face cache.
+ fontIdCacheItem.index = mFontFaceCache.size();
+
+ // Cache the items.
+ mFontFaceCache.emplace_back(std::move(fontFaceCacheItem));
+ mFontIdCache.emplace_back(std::move(fontIdCacheItem));
+
+ // Set the font id to be returned.
+ FontId fontId = mFontIdCache.size();
+
+ return fontId;
+}
+
+// Ellipsis
+
+bool FontClient::Plugin::CacheHandler::FindEllipsis(PointSize26Dot6 requestedPointSize, EllipsisCacheIndex& ellipsisCacheIndex) const
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize %d.\n", requestedPointSize);
+
+ ellipsisCacheIndex = 0u;
+
+ // First look into the cache if there is an ellipsis glyph for the requested point size.
+ for(const auto& item : mEllipsisCache)
+ {
+ if(item.requestedPointSize == requestedPointSize)
+ {
+ // Use the glyph in the cache.
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " glyph id %d found in the cache.\n", item.glyph.index);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font %d.\n", item.glyph.fontId);
+ ellipsisCacheIndex = item.index;
+ return true;
+ }
+ }
+ return false;
+}
+
+FontClient::Plugin::CacheHandler::EllipsisCacheIndex FontClient::Plugin::CacheHandler::CacheEllipsis(EllipsisItem&& ellipsisItem)
+{
+ EllipsisCacheIndex ellipsisCacheIndex = mEllipsisCache.size();
+
+ mEllipsisCache.emplace_back(std::move(ellipsisItem));
+
+ return ellipsisCacheIndex;
+}
+
+// Bitmap font
+
+bool FontClient::Plugin::CacheHandler::FindBitmapFont(const FontFamily& bitmapFontFamily, FontId& fontId) const
+{
+ fontId = 0u;
+
+ for(const auto& item : mBitmapFontCache)
+ {
+ if(bitmapFontFamily == item.font.name)
+ {
+ fontId = item.id + 1u;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+FontId FontClient::Plugin::CacheHandler::CacheBitmapFontCacheItem(BitmapFontCacheItem&& bitmapFontCacheItem)
+{
+ // Set the index to the font's id cache.
+ bitmapFontCacheItem.id = mFontIdCache.size();
+
+ // Create the font id item to cache.
+ CacheHandler::FontIdCacheItem fontIdCacheItem;
+ fontIdCacheItem.type = FontDescription::BITMAP_FONT;
+
+ // Set the index to the Bitmap font face cache.
+ fontIdCacheItem.index = mBitmapFontCache.size();
+
+ // Cache the items.
+ mBitmapFontCache.emplace_back(std::move(bitmapFontCacheItem));
+ mFontIdCache.emplace_back(std::move(fontIdCacheItem));
+
+ // Set the font id to be returned.
+ FontId fontId = mFontIdCache.size();
+
+ return fontId;
+}
+
+// Embedded
+
+bool FontClient::Plugin::CacheHandler::FindEmbeddedPixelBufferId(const std::string& url, PixelBufferId& pixelBufferId) const
+{
+ pixelBufferId = 0u;
+
+ for(const auto& cacheItem : mPixelBufferCache)
+ {
+ if(cacheItem.url == url)
+ {
+ // The url is in the pixel buffer cache.
+ pixelBufferId = cacheItem.id;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+PixelBufferId FontClient::Plugin::CacheHandler::CacheEmbeddedPixelBuffer(const std::string& url)
+{
+ PixelBufferId pixelBufferId = 0u;
+
+ // Load the image from the url.
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile(url);
+ if(pixelBuffer)
+ {
+ // Create the cache item.
+ PixelBufferCacheItem pixelBufferCacheItem;
+ pixelBufferCacheItem.pixelBuffer = pixelBuffer;
+ pixelBufferCacheItem.url = url;
+ pixelBufferCacheItem.id = mPixelBufferCache.size() + 1u;
+
+ // Store the cache item in the cache.
+ mPixelBufferCache.emplace_back(std::move(pixelBufferCacheItem));
+
+ // Set the pixel buffer id to be returned.
+ pixelBufferId = mPixelBufferCache.size();
+ }
+ return pixelBufferId;
+}
+
+bool FontClient::Plugin::CacheHandler::FindEmbeddedItem(PixelBufferId pixelBufferId, uint32_t width, uint32_t height, GlyphIndex& index) const
+{
+ index = 0u;
+
+ for(const auto& cacheItem : mEmbeddedItemCache)
+ {
+ if((cacheItem.pixelBufferId == pixelBufferId) &&
+ (cacheItem.width == width) &&
+ (cacheItem.height == height))
+ {
+ index = cacheItem.index;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+GlyphIndex FontClient::Plugin::CacheHandler::CacheEmbeddedItem(EmbeddedItem&& embeddedItem)
+{
+ embeddedItem.index = mEmbeddedItemCache.size() + 1u;
+
+ // Cache the embedded item.
+ mEmbeddedItemCache.emplace_back(std::move(embeddedItem));
+
+ // Set the font id to be returned.
+ GlyphIndex index = mEmbeddedItemCache.size();
+
+ return index;
+}
+
+} // namespace Dali::TextAbstraction::Internal
--- /dev/null
+#ifndef DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_CACHE_HANDLER_H
+#define DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_CACHE_HANDLER_H
+
+/*
+ * 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.
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.h>
+
+namespace Dali::TextAbstraction::Internal
+{
+/**
+ * @brief FontClient Plugin cache item handler.
+ */
+struct FontClient::Plugin::CacheHandler
+{
+public:
+ /**
+ * Constructor.
+ */
+ CacheHandler();
+
+ /**
+ * Default destructor.
+ *
+ * Frees any allocated resource.
+ */
+ ~CacheHandler();
+
+public: // Public struct
+ /// Redefine FontId name to specifiy the value's usage
+ using FontCacheIndex = FontId;
+ using EllipsisCacheIndex = FontId;
+
+ /**
+ * @brief Index of FontCache container.
+ */
+ struct FontIdCacheItem
+ {
+ FontDescription::Type type; ///< The type of font.
+ FontCacheIndex index; ///< Index to the cache of fonts for the specified type. Face or Bitmap
+ };
+
+ /**
+ * @brief Caches an list of fallback fonts for a given font-description
+ */
+ struct FallbackCacheItem
+ {
+ FallbackCacheItem(FontDescription&& fontDescription, FontList* fallbackFonts, CharacterSetList* characterSets);
+
+ FontDescription fontDescription; ///< The font description.
+ FontList* fallbackFonts; ///< The list of fallback fonts for the given font-description.
+ CharacterSetList* characterSets; ///< The list of character sets for the given font-description.
+ };
+
+ /**
+ * @brief Caches an glyph informations of ellipsis character per each point size.
+ */
+ struct EllipsisItem
+ {
+ PointSize26Dot6 requestedPointSize;
+ EllipsisCacheIndex index;
+ GlyphInfo glyph;
+ };
+
+ /**
+ * @brief Caches an index to the vector of font descriptions for a given font.
+ */
+ struct FontDescriptionCacheItem
+ {
+ FontDescriptionCacheItem(const FontDescription& fontDescription,
+ FontDescriptionId index);
+ FontDescriptionCacheItem(FontDescription&& fontDescription,
+ FontDescriptionId index);
+
+ FontDescription fontDescription; ///< The font description.
+ FontDescriptionId index; ///< Index to the vector of font descriptions.
+ };
+
+ /**
+ * @brief Pair of FontDescriptionId and PointSize. It will be used to find cached validate font.
+ */
+ struct FontDescriptionSizeCacheKey
+ {
+ FontDescriptionSizeCacheKey(FontDescriptionId fontDescriptionId,
+ PointSize26Dot6 requestedPointSize);
+
+ FontDescriptionId fontDescriptionId; ///< Index to the vector with font descriptions.
+ PointSize26Dot6 requestedPointSize; ///< The font point size.
+
+ bool operator==(FontDescriptionSizeCacheKey const& rhs) const noexcept
+ {
+ return fontDescriptionId == rhs.fontDescriptionId && requestedPointSize == rhs.requestedPointSize;
+ }
+ };
+
+ /**
+ * @brief Custom hash functions for FontDescriptionSizeCacheKey.
+ */
+ struct FontDescriptionSizeCacheKeyHash
+ {
+ std::size_t operator()(FontDescriptionSizeCacheKey const& key) const noexcept
+ {
+ return key.fontDescriptionId ^ key.requestedPointSize;
+ }
+ };
+
+ /**
+ * @brief Caches the font id of the pair font point size and the index to the vector of font descriptions of validated fonts.
+ */
+ using FontDescriptionSizeCacheContainer = std::unordered_map<FontDescriptionSizeCacheKey, FontCacheIndex, FontDescriptionSizeCacheKeyHash>;
+
+public: // Clear cache public
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::Plugin::ClearCache()
+ */
+ void ClearCache();
+
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::Plugin::ResetSystemDefaults()
+ */
+ void ResetSystemDefaults();
+
+private: // Clear cache private
+ /**
+ * @brief Free the resources allocated by the FcCharSet objects.
+ */
+ void ClearCharacterSetFromFontFaceCache();
+
+ /**
+ * @brief Free the resources allocated in the fallback cache.
+ */
+ void ClearFallbackCache();
+
+ /**
+ * @brief Free the resources allocated in charset cache.
+ */
+ void ClearCharacterSet();
+
+private:
+ /**
+ * @brief Crate the charset resouces by default font and Fallback caches.
+ * @pre We should call this API only one times after ClearCharacterSet().
+ */
+ void CreateCharacterSet();
+
+public: // Find & Cache
+ // System / Default
+
+ /**
+ * @brief Caches the fonts present in the platform.
+ *
+ * Calls GetFcFontSet() to retrieve the fonts.
+ */
+ void InitSystemFonts();
+
+ /**
+ * @brief Retrieve the list of default fonts supported by the system.
+ */
+ void InitDefaultFonts();
+
+ /**
+ * @brief Retrieve the active default font from the system.
+ */
+ void InitDefaultFontDescription();
+
+ // Validate
+
+ /**
+ * @brief Finds in the cache a cluster 'font family, font width, font weight, font slant'
+ * If there is one, it writes the index to the vector with font descriptions in the param @p validatedFontId.
+ *
+ * @param[in] fontDescription The font to validate.
+ * @param[out] validatedFontId The index to the vector with font descriptions.
+ *
+ * @return @e true if the pair is found.
+ */
+ bool FindValidatedFont(const FontDescription& fontDescription,
+ FontDescriptionId& validatedFontId);
+
+ /**
+ * @brief Validate a font description.
+ *
+ * @param[in] fontDescription The font to validate.
+ * @param[out] fontDescriptionId Result of validation
+ */
+ void ValidateFont(const FontDescription& fontDescription,
+ FontDescriptionId& fontDescriptionId);
+
+ /**
+ * @brief Cache in the descrption and validate id information
+ * @note We use std::move operation to fontDescription.
+ *
+ * @param[in] fontDescription The font to validate.
+ * @param[in] validatedFontId The index to the vector with font descriptions.
+ */
+ void CacheValidateFont(FontDescription&& fontDescription,
+ FontDescriptionId validatedFontId);
+
+ // Fallback
+
+ /**
+ * @brief Finds a fallback font list from the cache for a given font-description
+ *
+ * @param[in] fontDescription The font to validate.
+ * @param[out] fontList A valid pointer to a font list, or @e nullptr if not found.
+ * @param[out] characterSetList A valid pointer to a character set list, or @e nullptr if not found.
+ *
+ * @return Whether the fallback font list has been found.
+ */
+ bool FindFallbackFontList(const FontDescription& fontDescription,
+ FontList*& fontList,
+ CharacterSetList*& characterSetList) const;
+
+ /**
+ * @brief Cache a fallback font list for a given font-description
+ * @note We use std::move operation to fontDescription.
+ *
+ * @param[in] fontDescription The font to validate.
+ * @param[out] fontListA valid pointer to a font list.
+ * @param[out] characterSetList A valid pointer to a character set list.
+ */
+ void CacheFallbackFontList(FontDescription&& fontDescription,
+ FontList*& fontList,
+ CharacterSetList*& characterSetList);
+
+ // Font / FontFace
+
+ /**
+ * @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index.
+ * If there is one , if writes the font identifier in the param @p fontId.
+ *
+ * @param[in] path Path to the font file name.
+ * @param[in] requestedPointSize The font point size.
+ * @param[in] faceIndex The face index.
+ * @param[out] fontId The font identifier.
+ *
+ * @return @e true if there triplet is found.
+ */
+ bool FindFontByPath(const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex, FontId& fontId) const;
+
+ /**
+ * @brief Finds in the cache a pair 'validated font identifier and font point size'.
+ * If there is one it writes the font identifier in the param @p fontCacheIndex.
+ *
+ * @param[in] validatedFontId Index to the vector with font descriptions.
+ * @param[in] requestedPointSize The font point size.
+ * @param[out] fontCacheIndex The index of font cache identifier.
+ *
+ * @return @e true if the pair is found.
+ */
+ bool FindFont(FontDescriptionId validatedFontId,
+ PointSize26Dot6 requestedPointSize,
+ FontCacheIndex& fontCacheIndex);
+
+ /**
+ * @brief Cache the font descpription size item.
+ *
+ * @param[in] fontDescriptionId FontDescriptionId of current font.
+ * @param[in] requestedPointSize Size of current font.
+ * @param[in] fontCacheIndex Index of this font's cache.
+ */
+ void CacheFontDescriptionSize(FontDescriptionId fontDescriptionId, PointSize26Dot6 requestedPointSize, FontCacheIndex fontCacheIndex);
+
+ /**
+ * @brief Cache the font face cache item.
+ * @note We use std::move operation to cache item.
+ *
+ * @param[in] fontFaceCacheItem Font face cache item.
+ * @return FontId of newly inserted font cache item.
+ */
+ FontId CacheFontFaceCacheItem(FontFaceCacheItem&& fontFaceCacheItem);
+
+ /**
+ * @brief Caches a font path.
+ *
+ * @param[in] ftFace The FreeType face.
+ * @param[in] fontId The font identifier.
+ * @param[in] requestedPointSize The font point size.
+ * @param[in] path Path to the font file name.
+ */
+ void CacheFontPath(FT_Face ftFace, FontId fontId, PointSize26Dot6 requestedPointSize, const FontPath& path);
+
+ // Ellipsis
+
+ /**
+ * @brief Finds an ellipsis cache for a given point size
+ *
+ * @param[in] requestedPointSize Requested point size.
+ * @param[out] ellipsisCacheIndex The index of cached ellipsis.
+ *
+ * @return Whether the ellipsis has been found.
+ */
+ bool FindEllipsis(PointSize26Dot6 requestedPointSize, EllipsisCacheIndex& ellipsisCacheIndex) const;
+
+ /**
+ * @brief Cache an ellipsis item
+ * @note We use std::move operation to cache item.
+ *
+ * @param[in] ellipsisItem Ellipsis item.
+ * @return The index of cached ellipsis.
+ */
+ EllipsisCacheIndex CacheEllipsis(EllipsisItem&& ellipsisItem);
+
+ // Bitmap font
+
+ /**
+ * @brief Finds in the cache a bitmap font with the @p bitmapFont family name.
+ *
+ * @param[in] bitmapFontFamily The font's family name.
+ * @param[out] fontId The id of the font.
+ *
+ * @return Whether the font has been found.
+ */
+ bool FindBitmapFont(const FontFamily& bitmapFontFamily, FontId& fontId) const;
+
+ /**
+ * @brief Cache the bitmap font cache item.
+ * @note We use std::move operation to cache item.
+ *
+ * @param[in] bitmapFontCacheItem Bitmap font cache item.
+ * @return FontId of newly inserted font cache item.
+ */
+ FontId CacheBitmapFontCacheItem(BitmapFontCacheItem&& bitmapFontCacheItem);
+
+ // Embedded
+
+ /**
+ * @brief Finds in the cache a pixel buffer for embedded font.
+ *
+ * @param[in] url The embedded image's url.
+ * @param[out] pixelBufferId The id of the loaded pixel buffer.
+ *
+ * @return Whether the embedded pixel buffer has been found.
+ */
+ bool FindEmbeddedPixelBufferId(const std::string& url, PixelBufferId& pixelBufferId) const;
+
+ /**
+ * @brief Cache the pixel buffer
+ * @note We load image syncronously.
+ *
+ * @param[in] url The url of embedded pixel buffer.
+ * @return PixelBufferId of newly inserted pixel buffer. Or 0 if we fail to be load.
+ */
+ PixelBufferId CacheEmbeddedPixelBuffer(const std::string& url);
+
+ /**
+ * @brief Finds in the cache a embedded item.
+ *
+ * @param pixelBufferId The id of embedded item's pixel buffer.
+ * @param width The width of embedded item.
+ * @param height The height of embedded item.
+ * @param[out] index GlyphIndex of embedded item.
+ * @return Whether the embedded item has been found.
+ */
+ bool FindEmbeddedItem(PixelBufferId pixelBufferId, uint32_t width, uint32_t height, GlyphIndex& index) const;
+
+ /**
+ * @brief Cache the embedded item.
+ * @note We use std::move operation to cache item.
+ *
+ * @param[in] embeddedItem The url of embedded pixel buffer.
+ * @return GlyphIndex of newly inserted embedded item.
+ */
+ GlyphIndex CacheEmbeddedItem(EmbeddedItem&& embeddedItem);
+
+private:
+ CacheHandler(const CacheHandler&) = delete;
+ CacheHandler& operator=(const CacheHandler&) = delete;
+
+public: // Cache container list
+ FontDescription mDefaultFontDescription; ///< Cached default font from the system
+
+ FontList mSystemFonts; ///< Cached system fonts.
+ FontList mDefaultFonts; ///< Cached default fonts.
+ CharacterSetList mDefaultFontCharacterSets; ///< Cached default fonts character set.
+
+ std::vector<FallbackCacheItem> mFallbackCache; ///< Cached fallback font lists.
+
+ std::vector<FontIdCacheItem> mFontIdCache; ///< Caches from FontId to FontCacheIndex.
+ std::vector<FontFaceCacheItem> mFontFaceCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
+ std::vector<FontDescriptionCacheItem> mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font.
+ FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font.
+ CharacterSetList mCharacterSetCache; ///< Caches character set lists for the validated font.
+
+ FontDescriptionSizeCacheContainer mFontDescriptionSizeCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
+
+ std::vector<EllipsisItem> mEllipsisCache; ///< Caches ellipsis glyphs for a particular point size.
+ std::vector<BitmapFontCacheItem> mBitmapFontCache; ///< Stores bitmap fonts.
+ std::vector<PixelBufferCacheItem> mPixelBufferCache; ///< Caches the pixel buffer of a url.
+ std::vector<EmbeddedItem> mEmbeddedItemCache; ///< Cache embedded items.
+
+private: // Member value
+ FontDescription mLatestFoundFontDescription; ///< Latest found font description and id in FindValidatedFont()
+ FontDescriptionId mLatestFoundFontDescriptionId;
+
+ FontDescriptionSizeCacheKey mLatestFoundCacheKey; ///< Latest found font description and id in FindFont()
+ FontCacheIndex mLatestFoundCacheIndex;
+
+ bool mDefaultFontDescriptionCached : 1; ///< Whether the default font is cached or not
+};
+
+} // namespace Dali::TextAbstraction::Internal
+
+#endif // DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_CACHE_HANDLER_H
// INTERNAL INCLUDES
#include <dali/devel-api/text-abstraction/font-list.h>
-
-#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/imaging/common/image-operations.h>
#include <dali/internal/text/text-abstraction/plugin/bitmap-font-cache-item.h>
#include <dali/internal/text/text-abstraction/plugin/embedded-item.h>
+#include <dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.h>
#include <dali/internal/text/text-abstraction/plugin/font-client-utils.h>
#include <dali/internal/text/text-abstraction/plugin/font-face-cache-item.h>
#include <dali/public-api/common/dali-vector.h>
const float FROM_266 = 1.0f / 64.0f;
const float POINTS_PER_INCH = 72.f;
-const std::string DEFAULT_FONT_FAMILY_NAME("Tizen");
-
const uint32_t ELLIPSIS_CHARACTER = 0x2026;
} // namespace
using Dali::Vector;
-using namespace std;
namespace Dali::TextAbstraction::Internal
{
-/**
- * @brief Free the resources allocated by the FcCharSet objects.
- *
- * @param[in] characterSets The vector of character sets.
- */
-void DestroyCharacterSets(CharacterSetList& characterSets)
+namespace
{
- for(auto& item : characterSets)
- {
- if(item)
- {
- FcCharSetDestroy(item);
- }
- }
-}
-
/**
* @brief Check if @p ftFace and @p requestedPointSize produces block that fit into atlas block
*
return error;
}
-FontClient::Plugin::FallbackCacheItem::FallbackCacheItem(FontDescription&& font, FontList* fallbackFonts, CharacterSetList* characterSets)
-: fontDescription{std::move(font)},
- fallbackFonts{fallbackFonts},
- characterSets{characterSets}
-{
-}
-
-FontClient::Plugin::FontDescriptionCacheItem::FontDescriptionCacheItem(const FontDescription& fontDescription,
- FontDescriptionId index)
-: fontDescription{fontDescription},
- index{index}
-{
-}
-
-FontClient::Plugin::FontDescriptionCacheItem::FontDescriptionCacheItem(FontDescription&& fontDescription,
- FontDescriptionId index)
-: fontDescription{std::move(fontDescription)},
- index{index}
-{
-}
-
-FontClient::Plugin::FontDescriptionSizeCacheKey::FontDescriptionSizeCacheKey(FontDescriptionId fontDescriptionId,
- PointSize26Dot6 requestedPointSize)
-: fontDescriptionId(fontDescriptionId),
- requestedPointSize(requestedPointSize)
-{
-}
+} // namespace
FontClient::Plugin::Plugin(unsigned int horizontalDpi,
unsigned int verticalDpi)
: mFreeTypeLibrary(nullptr),
mDpiHorizontal(horizontalDpi),
mDpiVertical(verticalDpi),
- mDefaultFontDescription(),
- mSystemFonts(),
- mDefaultFonts(),
- mFontIdCache(),
- mFontFaceCache(),
- mValidatedFontCache(),
- mFontDescriptionCache(),
- mCharacterSetCache(),
- mFontDescriptionSizeCache(),
- mVectorFontCache(nullptr),
- mEllipsisCache(),
- mEmbeddedItemCache(),
- mLatestFoundFontDescription(),
- mLatestFoundFontDescriptionId(0u),
- mLatestFoundCacheKey(0, 0),
- mLatestFoundCacheIndex(0u),
- mDefaultFontDescriptionCached(false),
mIsAtlasLimitationEnabled(TextAbstraction::FontClient::DEFAULT_ATLAS_LIMITATION_ENABLED),
- mCurrentMaximumBlockSizeFitInAtlas(TextAbstraction::FontClient::MAX_SIZE_FIT_IN_ATLAS)
-
+ mCurrentMaximumBlockSizeFitInAtlas(TextAbstraction::FontClient::MAX_SIZE_FIT_IN_ATLAS),
+ mVectorFontCache(nullptr),
+ mCacheHandler(new CacheHandler())
{
int error = FT_Init_FreeType(&mFreeTypeLibrary);
if(FT_Err_Ok != error)
FontClient::Plugin::~Plugin()
{
- ClearFallbackCache(mFallbackCache);
-
- // Free the resources allocated by the FcCharSet objects.
- DestroyCharacterSets(mDefaultFontCharacterSets);
- DestroyCharacterSets(mCharacterSetCache);
- ClearCharacterSetFromFontFaceCache();
-
- // Clear FontFaceCache here. Due to we sould deallocate FT_Faces before done freetype library
- mFontFaceCache.clear();
+ // Delete cache hanlder before remove mFreeTypeLibrary
+ delete mCacheHandler;
#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
delete mVectorFontCache;
#endif
+
FT_Done_FreeType(mFreeTypeLibrary);
}
-void FontClient::Plugin::ClearCache()
+void FontClient::Plugin::ClearCache() const
{
- mDefaultFontDescription = FontDescription();
-
- mSystemFonts.clear();
- mDefaultFonts.clear();
-
- DestroyCharacterSets(mDefaultFontCharacterSets);
- mDefaultFontCharacterSets.Clear();
-
- ClearFallbackCache(mFallbackCache);
- mFallbackCache.clear();
-
- mFontIdCache.Clear();
-
- ClearCharacterSetFromFontFaceCache();
- mFontFaceCache.clear();
-
- mValidatedFontCache.clear();
- mFontDescriptionCache.clear();
-
- DestroyCharacterSets(mCharacterSetCache);
- mCharacterSetCache.Clear();
-
- mFontDescriptionSizeCache.clear();
- mFontDescriptionSizeCache.rehash(0); // Note : unordered_map.clear() didn't deallocate memory
-
- mEllipsisCache.Clear();
- mPixelBufferCache.clear();
- mEmbeddedItemCache.Clear();
- mBitmapFontCache.clear();
-
- mLatestFoundFontDescription.family.clear();
- mLatestFoundCacheKey = FontDescriptionSizeCacheKey(0, 0);
-
- mDefaultFontDescriptionCached = false;
+ mCacheHandler->ClearCache();
}
void FontClient::Plugin::SetDpi(unsigned int horizontalDpi,
mDpiVertical = verticalDpi;
}
-void FontClient::Plugin::ResetSystemDefaults()
+void FontClient::Plugin::ResetSystemDefaults() const
{
- mDefaultFontDescriptionCached = false;
+ mCacheHandler->ResetSystemDefaults();
}
-void FontClient::Plugin::SetFontList(const FontDescription& fontDescription, FontList& fontList, CharacterSetList& characterSetList)
+void FontClient::Plugin::GetDefaultPlatformFontDescription(FontDescription& fontDescription) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- FONT_LOG_DESCRIPTION(fontDescription, "");
- fontList.clear();
-
- FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription); // Creates a pattern that needs to be destroyed by calling FcPatternDestroy.
-
- FcResult result = FcResultMatch;
-
- // Match the pattern.
- FcFontSet* fontSet = FcFontSort(nullptr /* use default configure */,
- fontFamilyPattern,
- false /* don't trim */,
- nullptr,
- &result); // FcFontSort creates a font set that needs to be destroyed by calling FcFontSetDestroy.
-
- if(nullptr != fontSet)
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of fonts found : [%d]\n", fontSet->nfont);
- // Reserve some space to avoid reallocations.
- fontList.reserve(fontSet->nfont);
-
- for(int i = 0u; i < fontSet->nfont; ++i)
- {
- FcPattern* fontPattern = fontSet->fonts[i];
- FontPath path;
+ mCacheHandler->InitDefaultFontDescription();
+ fontDescription = mCacheHandler->mDefaultFontDescription;
- // Skip fonts with no path
- if(GetFcString(fontPattern, FC_FILE, path))
- {
- // Retrieve the character set. Need to call FcCharSetDestroy to free the resources.
- FcCharSet* characterSet = nullptr;
- FcPatternGetCharSet(fontPattern, FC_CHARSET, 0u, &characterSet);
-
- // Increase the reference counter of the character set.
- characterSetList.PushBack(FcCharSetCopy(characterSet));
-
- fontList.push_back(FontDescription());
- FontDescription& newFontDescription = fontList.back();
-
- newFontDescription.path = std::move(path);
-
- int width = 0;
- int weight = 0;
- int slant = 0;
- GetFcString(fontPattern, FC_FAMILY, newFontDescription.family);
- GetFcInt(fontPattern, FC_WIDTH, width);
- GetFcInt(fontPattern, FC_WEIGHT, weight);
- GetFcInt(fontPattern, FC_SLANT, slant);
- newFontDescription.width = IntToWidthType(width);
- newFontDescription.weight = IntToWeightType(weight);
- newFontDescription.slant = IntToSlantType(slant);
-
- FONT_LOG_DESCRIPTION(newFontDescription, "");
- }
- }
-
- // Destroys the font set created by FcFontSort.
- FcFontSetDestroy(fontSet);
- }
- else
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " No fonts found.\n");
- }
-
- // Destroys the pattern created by FcPatternCreate in CreateFontFamilyPattern.
- FcPatternDestroy(fontFamilyPattern);
+ FONT_LOG_DESCRIPTION(fontDescription, "");
}
-void FontClient::Plugin::GetDefaultFonts(FontList& defaultFonts)
+void FontClient::Plugin::GetDefaultFonts(FontList& defaultFonts) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- if(mDefaultFonts.empty())
- {
- FontDescription fontDescription;
- fontDescription.family = DEFAULT_FONT_FAMILY_NAME; // todo This could be set to the Platform font
- fontDescription.width = DefaultFontWidth();
- fontDescription.weight = DefaultFontWeight();
- fontDescription.slant = DefaultFontSlant();
- SetFontList(fontDescription, mDefaultFonts, mDefaultFontCharacterSets);
- }
-
- defaultFonts = mDefaultFonts;
+ mCacheHandler->InitDefaultFonts();
+ defaultFonts = mCacheHandler->mDefaultFonts;
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of default fonts : [%d]\n", mDefaultFonts.size());
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of default fonts : [%d]\n", mCacheHandler->mDefaultFonts.size());
}
-void FontClient::Plugin::GetDefaultPlatformFontDescription(FontDescription& fontDescription)
+void FontClient::Plugin::GetSystemFonts(FontList& systemFonts) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- if(!mDefaultFontDescriptionCached)
- {
- // Clear any font config stored info in the caches.
-
- // Decrease the reference counter and eventually free the resources allocated by FcCharSet objects.
- DestroyCharacterSets(mDefaultFontCharacterSets);
- DestroyCharacterSets(mCharacterSetCache);
- mDefaultFontCharacterSets.Clear();
- mCharacterSetCache.Clear();
-
- for(auto& item : mFallbackCache)
- {
- // Decrease the reference counter and eventually free the resources allocated by FcCharSet objects.
- DestroyCharacterSets(*item.characterSets);
-
- delete item.characterSets;
- item.characterSets = nullptr;
- }
-
- // Set the character set pointer as null. Will be created again the next time IsCharacterSupportedByFont()
- ClearCharacterSetFromFontFaceCache();
+ mCacheHandler->InitSystemFonts();
+ systemFonts = mCacheHandler->mSystemFonts;
- // FcInitBringUptoDate did not seem to reload config file as was still getting old default font.
- FcInitReinitialize();
-
- FcPattern* matchPattern = FcPatternCreate(); // Creates a pattern that needs to be destroyed by calling FcPatternDestroy.
-
- if(nullptr != matchPattern)
- {
- FcConfigSubstitute(nullptr, matchPattern, FcMatchPattern);
- FcDefaultSubstitute(matchPattern);
-
- FcCharSet* characterSet = nullptr;
- bool matched = MatchFontDescriptionToPattern(matchPattern, mDefaultFontDescription, &characterSet);
-
- // Caching the default font description
- if(matched)
- {
- // Copy default font description info.
- // Due to the type changed, we need to make some temperal font description.
- FontDescription tempFontDescription = mDefaultFontDescription;
-
- // Add the path to the cache.
- tempFontDescription.type = FontDescription::FACE_FONT;
- mFontDescriptionCache.push_back(tempFontDescription);
-
- // Set the index to the vector of paths to font file names.
- const FontDescriptionId fontDescriptionId = mFontDescriptionCache.size();
-
- FONT_LOG_DESCRIPTION(tempFontDescription, "default platform font");
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " default font fontDescriptionId : %d\n", fontDescriptionId);
-
- // Cache the index and the matched font's description.
- FontDescriptionCacheItem item(tempFontDescription,
- fontDescriptionId);
-
- mValidatedFontCache.push_back(std::move(item));
- }
- else
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " default font validation failed for font [%s]\n", mDefaultFontDescription.family.c_str());
- }
-
- // Decrease the reference counter of the character set as it's not stored.
- // Note. the cached default font description will increase reference counter by
- // mFontDescriptionCache. So we can decrease reference counter here.
- FcCharSetDestroy(characterSet);
-
- // Destroys the pattern created.
- FcPatternDestroy(matchPattern);
- }
-
- // Create again the character sets as they are not valid after FcInitReinitialize()
-
- for(const auto& description : mDefaultFonts)
- {
- mDefaultFontCharacterSets.PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
- }
-
- for(const auto& description : mFontDescriptionCache)
- {
- mCharacterSetCache.PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
- }
-
- for(auto& item : mFallbackCache)
- {
- if(nullptr != item.fallbackFonts)
- {
- if(nullptr == item.characterSets)
- {
- item.characterSets = new CharacterSetList;
- }
-
- for(const auto& description : *(item.fallbackFonts))
- {
- item.characterSets->PushBack(FcCharSetCopy(CreateCharacterSetFromDescription(description)));
- }
- }
- }
-
- mDefaultFontDescriptionCached = true;
- }
-
- fontDescription.path = mDefaultFontDescription.path;
- fontDescription.family = mDefaultFontDescription.family;
- fontDescription.width = mDefaultFontDescription.width;
- fontDescription.weight = mDefaultFontDescription.weight;
- fontDescription.slant = mDefaultFontDescription.slant;
-
- FONT_LOG_DESCRIPTION(fontDescription, "");
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of system fonts : [%d]\n", mCacheHandler->mSystemFonts.size());
}
-void FontClient::Plugin::GetSystemFonts(FontList& systemFonts)
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
-
- if(mSystemFonts.empty())
- {
- InitSystemFonts();
- }
-
- systemFonts = mSystemFonts;
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of system fonts : [%d]\n", mSystemFonts.size());
-}
-
-void FontClient::Plugin::GetDescription(FontId id,
+void FontClient::Plugin::GetDescription(FontId fontId,
FontDescription& fontDescription) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", id);
- const FontId index = id - 1u;
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
- if((id > 0u) && (index < mFontIdCache.Count()))
+ if((fontId > 0u) && (fontId - 1u < mCacheHandler->mFontIdCache.size()))
{
- const FontIdCacheItem& fontIdCacheItem = mFontIdCache[index];
+ const auto& fontIdCacheItem = mCacheHandler->mFontIdCache[fontId - 1u];
switch(fontIdCacheItem.type)
{
case FontDescription::FACE_FONT:
{
- for(const auto& item : mFontDescriptionSizeCache)
+ for(const auto& item : mCacheHandler->mFontDescriptionSizeCache)
{
if(item.second == fontIdCacheItem.index)
{
- fontDescription = *(mFontDescriptionCache.begin() + item.first.fontDescriptionId - 1u);
+ fontDescription = *(mCacheHandler->mFontDescriptionCache.begin() + item.first.fontDescriptionId - 1u);
FONT_LOG_DESCRIPTION(fontDescription, "");
return;
case FontDescription::BITMAP_FONT:
{
fontDescription.type = FontDescription::BITMAP_FONT;
- fontDescription.family = mBitmapFontCache[fontIdCacheItem.index].font.name;
+ fontDescription.family = mCacheHandler->mBitmapFontCache[fontIdCacheItem.index].font.name;
break;
}
default:
}
}
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " No description found for the font ID %d\n", id);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " No description found for the font id %d\n", fontId);
}
-PointSize26Dot6 FontClient::Plugin::GetPointSize(FontId id)
+PointSize26Dot6 FontClient::Plugin::GetPointSize(FontId fontId) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", id);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
PointSize26Dot6 pointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE;
- const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(id);
+ const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
if(fontCacheItem != nullptr)
{
pointSize = fontCacheItem->GetPointSize();
return pointSize;
}
-bool FontClient::Plugin::IsCharacterSupportedByFont(FontId fontId, Character character)
+bool FontClient::Plugin::IsCharacterSupportedByFont(FontId fontId, Character character) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
return isSupported;
}
-const FontCacheItemInterface* FontClient::Plugin::GetCachedFontItem(FontId id) const
+const FontCacheItemInterface* FontClient::Plugin::GetCachedFontItem(FontId fontId) const
{
- const FontCacheIndex index = id - 1u;
- if((id > 0u) && (index < mFontIdCache.Count()))
+ if((fontId > 0u) && (fontId - 1u < mCacheHandler->mFontIdCache.size()))
{
- const FontIdCacheItem& fontIdCacheItem = mFontIdCache[index];
+ const auto& fontIdCacheItem = mCacheHandler->mFontIdCache[fontId - 1u];
switch(fontIdCacheItem.type)
{
case FontDescription::FACE_FONT:
{
- return &mFontFaceCache[fontIdCacheItem.index];
+ return &mCacheHandler->mFontFaceCache[fontIdCacheItem.index];
}
case FontDescription::BITMAP_FONT:
{
- return &mBitmapFontCache[fontIdCacheItem.index];
+ return &mCacheHandler->mBitmapFontCache[fontIdCacheItem.index];
}
default:
{
const CharacterSetList& characterSetList,
Character character,
PointSize26Dot6 requestedPointSize,
- bool preferColor)
+ bool preferColor) const
{
DALI_ASSERT_DEBUG((fontList.size() == characterSetList.Count()) && "FontClient::Plugin::FindFontForCharacter. Different number of fonts and character sets.");
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
if(preferColor)
{
- if((fontId > 0) &&
- (fontId - 1u < mFontIdCache.Count()))
+ if((fontId > 0) && (fontId - 1u < mCacheHandler->mFontIdCache.size()))
{
- const FontFaceCacheItem& item = mFontFaceCache[mFontIdCache[fontId - 1u].index];
+ const FontFaceCacheItem& item = mCacheHandler->mFontFaceCache[mCacheHandler->mFontIdCache[fontId - 1u].index];
foundColor = item.mHasColorTables;
}
FontId FontClient::Plugin::FindDefaultFont(Character charcode,
PointSize26Dot6 requestedPointSize,
- bool preferColor)
+ bool preferColor) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor);
FontId fontId(0);
// Create the list of default fonts if it has not been created.
- if(mDefaultFonts.empty())
- {
- FontDescription fontDescription;
- fontDescription.family = DEFAULT_FONT_FAMILY_NAME;
- fontDescription.width = DefaultFontWidth();
- fontDescription.weight = DefaultFontWeight();
- fontDescription.slant = DefaultFontSlant();
-
- SetFontList(fontDescription, mDefaultFonts, mDefaultFontCharacterSets);
- }
- DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of default fonts : %d\n", mDefaultFonts.size());
+ mCacheHandler->InitDefaultFonts();
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of default fonts : %d\n", mCacheHandler->mDefaultFonts.size());
// Traverse the list of default fonts.
// Check for each default font if supports the character.
- fontId = FindFontForCharacter(mDefaultFonts, mDefaultFontCharacterSets, charcode, requestedPointSize, preferColor);
+ fontId = FindFontForCharacter(mCacheHandler->mDefaultFonts, mCacheHandler->mDefaultFontCharacterSets, charcode, requestedPointSize, preferColor);
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
return fontId;
FontId FontClient::Plugin::FindFallbackFont(Character charcode,
const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize,
- bool preferColor)
+ bool preferColor) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor);
FontDescription fontDescription;
// Fill the font description with the preferred font description and complete with the defaults.
- fontDescription.family = preferredFontDescription.family.empty() ? DEFAULT_FONT_FAMILY_NAME : preferredFontDescription.family;
+ fontDescription.family = preferredFontDescription.family.empty() ? DefaultFontFamily() : preferredFontDescription.family;
fontDescription.weight = ((FontWeight::NONE == preferredFontDescription.weight) ? DefaultFontWeight() : preferredFontDescription.weight);
fontDescription.width = ((FontWidth::NONE == preferredFontDescription.width) ? DefaultFontWidth() : preferredFontDescription.width);
fontDescription.slant = ((FontSlant::NONE == preferredFontDescription.slant) ? DefaultFontSlant() : preferredFontDescription.slant);
FontList* fontList = nullptr;
CharacterSetList* characterSetList = nullptr;
- if(!FindFallbackFontList(fontDescription, fontList, characterSetList))
+ if(!mCacheHandler->FindFallbackFontList(fontDescription, fontList, characterSetList))
{
- fontList = new FontList;
- characterSetList = new CharacterSetList;
-
- SetFontList(fontDescription, *fontList, *characterSetList);
-#ifdef __APPLE__
- FontDescription appleColorEmoji;
- appleColorEmoji.family = "Apple Color Emoji";
- appleColorEmoji.width = fontDescription.width;
- appleColorEmoji.weight = fontDescription.weight;
- appleColorEmoji.slant = fontDescription.slant;
- FontList emojiFontList;
- CharacterSetList emojiCharSetList;
- SetFontList(appleColorEmoji, emojiFontList, emojiCharSetList);
-
- std::move(fontList->begin(), fontList->end(), std::back_inserter(emojiFontList));
- emojiCharSetList.Insert(emojiCharSetList.End(), characterSetList->Begin(), characterSetList->End());
- *fontList = std::move(emojiFontList);
- *characterSetList = std::move(emojiCharSetList);
-#endif
-
- // Add the font-list to the cache.
- mFallbackCache.push_back(std::move(FallbackCacheItem(std::move(fontDescription), fontList, characterSetList)));
+ mCacheHandler->CacheFallbackFontList(std::move(fontDescription), fontList, characterSetList);
}
if(fontList && characterSetList)
return fontId;
}
-FontId FontClient::Plugin::GetFontId(const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex,
- bool cacheDescription)
+FontId FontClient::Plugin::GetFontIdByPath(const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex faceIndex,
+ bool cacheDescription) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " path : [%s]\n", path.c_str());
if(nullptr != mFreeTypeLibrary)
{
FontId foundId = 0u;
- if(FindFont(path, requestedPointSize, faceIndex, foundId))
+ if(mCacheHandler->FindFontByPath(path, requestedPointSize, faceIndex, foundId))
{
id = foundId;
}
FontId FontClient::Plugin::GetFontId(const FontDescription& fontDescription,
PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex)
+ FaceIndex faceIndex) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
FONT_LOG_DESCRIPTION(fontDescription, "");
// Special case when font Description don't have family information.
// In this case, we just use default description family and path.
- const FontDescription& realFontDescription = fontDescription.family.empty() ? FontDescription(mDefaultFontDescription.path,
- mDefaultFontDescription.family,
+ const FontDescription& realFontDescription = fontDescription.family.empty() ? FontDescription(mCacheHandler->mDefaultFontDescription.path,
+ mCacheHandler->mDefaultFontDescription.family,
fontDescription.width,
fontDescription.weight,
fontDescription.slant,
FontId fontId = 0u;
// Check first if the font description matches with a previously loaded bitmap font.
- if(FindBitmapFont(realFontDescription.family, fontId))
+ if(mCacheHandler->FindBitmapFont(realFontDescription.family, fontId))
{
return fontId;
}
// Check if the font's description have been validated before.
FontDescriptionId fontDescriptionId = 0u;
- if(!FindValidatedFont(realFontDescription,
- fontDescriptionId))
+ if(!mCacheHandler->FindValidatedFont(realFontDescription, fontDescriptionId))
{
// Use font config to validate the font's description.
- ValidateFont(realFontDescription,
- fontDescriptionId);
+ mCacheHandler->ValidateFont(realFontDescription, fontDescriptionId);
}
+ using FontCacheIndex = CacheHandler::FontCacheIndex;
FontCacheIndex fontCacheIndex = 0u;
// Check if exists a pair 'fontDescriptionId, requestedPointSize' in the cache.
- if(!FindFont(fontDescriptionId, requestedPointSize, fontCacheIndex))
+ if(!mCacheHandler->FindFont(fontDescriptionId, requestedPointSize, fontCacheIndex))
{
// Retrieve the font file name path.
- const FontDescription& description = *(mFontDescriptionCache.begin() + fontDescriptionId - 1u);
+ const FontDescription& description = *(mCacheHandler->mFontDescriptionCache.begin() + fontDescriptionId - 1u);
// Retrieve the font id. Do not cache the description as it has been already cached.
- fontId = GetFontId(description.path,
- requestedPointSize,
- faceIndex,
- false);
+ // Note : CacheFontPath() API call ValidateFont() + setup CharacterSet + cache the font description.
+ // So set cacheDescription=false, that we don't call CacheFontPath().
+ fontId = GetFontIdByPath(description.path, requestedPointSize, faceIndex, false);
- fontCacheIndex = mFontIdCache[fontId - 1u].index;
- mFontFaceCache[fontCacheIndex].mCharacterSet = FcCharSetCopy(mCharacterSetCache[fontDescriptionId - 1u]);
+ fontCacheIndex = mCacheHandler->mFontIdCache[fontId - 1u].index;
+ mCacheHandler->mFontFaceCache[fontCacheIndex].mCharacterSet = FcCharSetCopy(mCacheHandler->mCharacterSetCache[fontDescriptionId - 1u]);
// Cache the pair 'fontDescriptionId, requestedPointSize' to improve the following queries.
- mFontDescriptionSizeCache.emplace(FontDescriptionSizeCacheKey(fontDescriptionId, requestedPointSize), fontCacheIndex);
+ mCacheHandler->CacheFontDescriptionSize(fontDescriptionId, requestedPointSize, fontCacheIndex);
}
else
{
- fontId = mFontFaceCache[fontCacheIndex].mFontId + 1u;
+ fontId = mCacheHandler->mFontFaceCache[fontCacheIndex].mFontId + 1u;
}
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
return fontId;
}
-FontId FontClient::Plugin::GetFontId(const BitmapFont& bitmapFont)
-{
- for(const auto& item : mBitmapFontCache)
- {
- if(bitmapFont.name == item.font.name)
- {
- return item.id + 1u;
- }
- }
-
- BitmapFontCacheItem bitmapFontCacheItem(bitmapFont, mFontIdCache.Count());
-
- FontIdCacheItem fontIdCacheItem;
- fontIdCacheItem.type = FontDescription::BITMAP_FONT;
- fontIdCacheItem.index = mBitmapFontCache.size();
-
- mBitmapFontCache.push_back(std::move(bitmapFontCacheItem));
- mFontIdCache.PushBack(fontIdCacheItem);
-
- return bitmapFontCacheItem.id + 1u;
-}
-
-void FontClient::Plugin::ValidateFont(const FontDescription& fontDescription,
- FontDescriptionId& fontDescriptionId)
+FontId FontClient::Plugin::GetFontId(const BitmapFont& bitmapFont) const
{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- FONT_LOG_DESCRIPTION(fontDescription, "");
-
- // Create a font pattern.
- FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription);
-
- FontDescription description;
-
- FcCharSet* characterSet = nullptr;
- bool matched = MatchFontDescriptionToPattern(fontFamilyPattern, description, &characterSet);
- FcPatternDestroy(fontFamilyPattern);
-
- if(matched && (nullptr != characterSet))
+ // The font id to be returned.
+ FontId fontId = 0u;
+ if(!mCacheHandler->FindBitmapFont(bitmapFont.name, fontId))
{
- // Add the path to the cache.
- description.type = FontDescription::FACE_FONT;
- mFontDescriptionCache.push_back(description);
-
- // Set the index to the vector of paths to font file names.
- fontDescriptionId = mFontDescriptionCache.size();
-
- FONT_LOG_DESCRIPTION(description, "matched");
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fontDescriptionId : %d\n", fontDescriptionId);
+ BitmapFontCacheItem bitmapFontCacheItem(bitmapFont);
- // The reference counter of the character set has already been increased in MatchFontDescriptionToPattern.
- mCharacterSetCache.PushBack(characterSet);
-
- // Cache the index and the matched font's description.
- FontDescriptionCacheItem item(description,
- fontDescriptionId);
-
- mValidatedFontCache.push_back(std::move(item));
-
- if((fontDescription.family != description.family) ||
- (fontDescription.width != description.width) ||
- (fontDescription.weight != description.weight) ||
- (fontDescription.slant != description.slant))
- {
- // Cache the given font's description if it's different than the matched.
- FontDescriptionCacheItem item(fontDescription,
- fontDescriptionId);
-
- mValidatedFontCache.push_back(std::move(item));
- }
- }
- else
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font validation failed for font [%s]\n", fontDescription.family.c_str());
+ fontId = mCacheHandler->CacheBitmapFontCacheItem(std::move(bitmapFontCacheItem));
}
+ return fontId;
}
void FontClient::Plugin::GetFontMetrics(FontId fontId,
- FontMetrics& metrics)
+ FontMetrics& metrics) const
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
if(fontCacheItem != nullptr)
}
GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId fontId,
- Character charcode)
+ Character charcode) const
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
if(fontCacheItem != nullptr)
GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId fontId,
Character charcode,
- Character variantSelector)
+ Character variantSelector) const
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
if(fontCacheItem != nullptr)
bool FontClient::Plugin::GetGlyphMetrics(GlyphInfo* array,
uint32_t size,
GlyphType type,
- bool horizontal)
+ bool horizontal) const
{
if(VECTOR_GLYPH == type)
{
bool FontClient::Plugin::GetBitmapMetrics(GlyphInfo* array,
uint32_t size,
- bool horizontal)
+ bool horizontal) const
{
- bool success(false);
+ bool success(size > 0u);
for(unsigned int i = 0; i < size; ++i)
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(glyph.fontId);
if(fontCacheItem != nullptr)
{
- success = fontCacheItem->GetGlyphMetrics(glyph, mDpiVertical, horizontal);
+ success &= fontCacheItem->GetGlyphMetrics(glyph, mDpiVertical, horizontal);
}
// Check if it's an embedded image.
- else if((0u == glyph.fontId) && (0u != glyph.index) && (glyph.index <= mEmbeddedItemCache.Count()))
+ else if((0u == glyph.fontId) && (0u != glyph.index) && (glyph.index <= mCacheHandler->mEmbeddedItemCache.size()))
+ {
+ mCacheHandler->mEmbeddedItemCache[glyph.index - 1u].GetGlyphMetrics(glyph);
+ }
+ else
{
- mEmbeddedItemCache[glyph.index - 1u].GetGlyphMetrics(glyph);
- success = true;
+ success = false;
}
}
bool FontClient::Plugin::GetVectorMetrics(GlyphInfo* array,
uint32_t size,
- bool horizontal)
+ bool horizontal) const
{
#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
bool success(true);
FontId fontId = array[i].fontId;
if((fontId > 0u) &&
- (fontId - 1u) < mFontIdCache.Count())
+ (fontId - 1u) < mCacheHandler->mFontIdCache.size())
{
- FontFaceCacheItem& font = mFontFaceCache[mFontIdCache[fontId - 1u].index];
+ FontFaceCacheItem& font = mCacheHandler->mFontFaceCache[mCacheHandler->mFontIdCache[fontId - 1u].index];
if(!font.mVectorFontId)
{
#endif
}
-void FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth)
+void FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth) const
{
data.isColorBitmap = false;
data.isColorEmoji = false;
{
fontCacheItem->CreateBitmap(glyphIndex, data, outlineWidth, isItalicRequired, isBoldRequired);
}
- else if((0u != glyphIndex) && (glyphIndex <= mEmbeddedItemCache.Count()))
+ else if((0u != glyphIndex) && (glyphIndex <= mCacheHandler->mEmbeddedItemCache.size()))
{
// It's an embedded item.
- mEmbeddedItemCache[glyphIndex - 1u].CreateBitmap(mPixelBufferCache, data);
+ mCacheHandler->mEmbeddedItemCache[glyphIndex - 1u].CreateBitmap(mCacheHandler->mPixelBufferCache, data);
}
}
-PixelData FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth)
+PixelData FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth) const
{
TextAbstraction::FontClient::GlyphBufferData data;
CreateBitmap(fontId, glyphIndex, false, false, data, outlineWidth);
+ // If data is compressed or not owned buffer, copy this.
+ if(!data.isBufferOwned || data.compressionType != TextAbstraction::FontClient::GlyphBufferData::CompressionType::NO_COMPRESSION)
+ {
+ uint8_t* newBuffer = (uint8_t*)malloc(data.width * data.height * Pixel::GetBytesPerPixel(data.format));
+ TextAbstraction::FontClient::GlyphBufferData::Decompress(data, newBuffer);
+ if(data.isBufferOwned)
+ {
+ free(data.buffer);
+ }
+
+ data.buffer = newBuffer;
+ data.isBufferOwned = true;
+ data.compressionType = TextAbstraction::FontClient::GlyphBufferData::CompressionType::NO_COMPRESSION;
+ }
+
return PixelData::New(data.buffer,
data.width * data.height * Pixel::GetBytesPerPixel(data.format),
data.width,
PixelData::FREE);
}
-void FontClient::Plugin::CreateVectorBlob(FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight)
+void FontClient::Plugin::CreateVectorBlob(FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight) const
{
blob = nullptr;
blobLength = 0;
#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
if((fontId > 0u) &&
- (fontId - 1u < mFontIdCache.Count()))
+ (fontId - 1u < mCacheHandler->mFontIdCache.size()))
{
- const FontCacheIndex fontFaceId = mFontIdCache[fontId - 1u].index;
- FontFaceCacheItem& font = mFontFaceCache[fontFaceId];
+ using FontCacheIndex = CacheHandler::FontCacheIndex;
+ const FontCacheIndex fontCacheIndex = mCacheHandler->mFontIdCache[fontId - 1u].index;
+ FontFaceCacheItem& font = mCacheHandler->mFontFaceCache[fontCacheIndex];
if(!font.mVectorFontId)
{
font.mVectorFontId = mVectorFontCache->GetFontId(font.mPath);
}
- mVectorFontCache->GetVectorBlob(font.mVectorFontId, fontFaceId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight);
+ mVectorFontCache->GetVectorBlob(font.mVectorFontId, fontCacheIndex, glyphIndex, blob, blobLength, nominalWidth, nominalHeight);
}
#endif
}
-const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph(PointSize26Dot6 requestedPointSize)
+const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph(PointSize26Dot6 requestedPointSize) const
{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize %d.\n", requestedPointSize);
+ using EllipsisCacheIndex = CacheHandler::EllipsisCacheIndex;
+ using EllipsisItem = CacheHandler::EllipsisItem;
+ EllipsisCacheIndex ellipsisCacheIndex = 0u;
- // First look into the cache if there is an ellipsis glyph for the requested point size.
- for(const auto& item : mEllipsisCache)
+ if(!mCacheHandler->FindEllipsis(requestedPointSize, ellipsisCacheIndex))
{
- if(item.requestedPointSize == requestedPointSize)
- {
- // Use the glyph in the cache.
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " glyph id %d found in the cache.\n", item.glyph.index);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font %d.\n", item.glyph.fontId);
- return item.glyph;
- }
- }
+ // No glyph has been found. Create one.
+ EllipsisItem item;
- // No glyph has been found. Create one.
- mEllipsisCache.PushBack(EllipsisItem());
- EllipsisItem& item = *(mEllipsisCache.End() - 1u);
+ item.requestedPointSize = requestedPointSize;
+ item.index = ellipsisCacheIndex;
- item.requestedPointSize = requestedPointSize;
+ // Find a font for the ellipsis glyph.
+ item.glyph.fontId = FindDefaultFont(ELLIPSIS_CHARACTER,
+ requestedPointSize,
+ false);
- // Find a font for the ellipsis glyph.
- item.glyph.fontId = FindDefaultFont(ELLIPSIS_CHARACTER,
- requestedPointSize,
- false);
+ // Set the character index to access the glyph inside the font.
+ item.glyph.index = GetGlyphIndex(item.glyph.fontId, ELLIPSIS_CHARACTER);
- // Set the character index to access the glyph inside the font.
- item.glyph.index = FT_Get_Char_Index(mFontFaceCache[mFontIdCache[item.glyph.fontId - 1u].index].mFreeTypeFace,
- ELLIPSIS_CHARACTER);
+ // Get glyph informations.
+ GetBitmapMetrics(&item.glyph, 1u, true);
- GetBitmapMetrics(&item.glyph, 1u, true);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " glyph id %d found in the cache.\n", item.glyph.index);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font %d.\n", item.glyph.fontId);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " glyph id %d found in the cache.\n", item.glyph.index);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font %d.\n", item.glyph.fontId);
- return item.glyph;
+ ellipsisCacheIndex = mCacheHandler->CacheEllipsis(std::move(item));
+ }
+ return mCacheHandler->mEllipsisCache[ellipsisCacheIndex].glyph;
}
-bool FontClient::Plugin::IsColorGlyph(FontId fontId, GlyphIndex glyphIndex)
+bool FontClient::Plugin::IsColorGlyph(FontId fontId, GlyphIndex glyphIndex) const
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
return fontCacheItem && fontCacheItem->IsColorGlyph(glyphIndex);
}
-FT_FaceRec_* FontClient::Plugin::GetFreetypeFace(FontId fontId)
+FT_FaceRec_* FontClient::Plugin::GetFreetypeFace(FontId fontId) const
{
const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
if(fontCacheItem != nullptr)
return nullptr;
}
-FontDescription::Type FontClient::Plugin::GetFontType(FontId fontId)
+FontDescription::Type FontClient::Plugin::GetFontType(FontId fontId) const
{
const FontId index = fontId - 1u;
- if((fontId > 0u) &&
- (index < mFontIdCache.Count()))
+ if((fontId > 0u) && (index < mCacheHandler->mFontIdCache.size()))
{
- return mFontIdCache[index].type;
+ return mCacheHandler->mFontIdCache[index].type;
}
return FontDescription::INVALID;
}
return FcConfigAppFontAddDir(nullptr, reinterpret_cast<const FcChar8*>(path.c_str()));
}
-HarfBuzzFontHandle FontClient::Plugin::GetHarfBuzzFont(FontId fontId)
+HarfBuzzFontHandle FontClient::Plugin::GetHarfBuzzFont(FontId fontId) const
{
FontCacheItemInterface* fontCacheItem = const_cast<FontCacheItemInterface*>(GetCachedFontItem(fontId));
if(fontCacheItem != nullptr)
return nullptr;
}
-GlyphIndex FontClient::Plugin::CreateEmbeddedItem(const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat)
+GlyphIndex FontClient::Plugin::CreateEmbeddedItem(const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat) const
{
EmbeddedItem embeddedItem;
if(!description.url.empty())
{
// Check if the url is in the cache.
- PixelBufferId index = 0u;
-
- for(const auto& cacheItem : mPixelBufferCache)
- {
- ++index;
- if(cacheItem.url == description.url)
- {
- // The url is in the pixel buffer cache.
- // Set the index +1 to the vector.
- embeddedItem.pixelBufferId = index;
- break;
- }
- }
-
Devel::PixelBuffer pixelBuffer;
- if(0u == embeddedItem.pixelBufferId)
+ if(!mCacheHandler->FindEmbeddedPixelBufferId(description.url, embeddedItem.pixelBufferId))
{
// The pixel buffer is not in the cache. Create one and cache it.
-
- // Load the image from the url.
- pixelBuffer = LoadImageFromFile(description.url);
-
- // Create the cache item.
- PixelBufferCacheItem pixelBufferCacheItem;
- pixelBufferCacheItem.pixelBuffer = pixelBuffer;
- pixelBufferCacheItem.url = description.url;
-
- // Store the cache item in the cache.
- mPixelBufferCache.push_back(std::move(pixelBufferCacheItem));
-
- // Set the pixel buffer id to the embedded item.
- embeddedItem.pixelBufferId = mPixelBufferCache.size();
+ embeddedItem.pixelBufferId = mCacheHandler->CacheEmbeddedPixelBuffer(description.url);
}
- else
+
+ if((embeddedItem.pixelBufferId > 0u) && (embeddedItem.pixelBufferId - 1u) < mCacheHandler->mPixelBufferCache.size())
{
// Retrieve the pixel buffer from the cache to set the pixel format.
- pixelBuffer = mPixelBufferCache[embeddedItem.pixelBufferId - 1u].pixelBuffer;
+ pixelBuffer = mCacheHandler->mPixelBufferCache[embeddedItem.pixelBufferId - 1u].pixelBuffer;
}
if(pixelBuffer)
}
// Find if the same embeddedItem has already been created.
- unsigned int index = 0u;
- for(const auto& item : mEmbeddedItemCache)
+ GlyphIndex index = 0u;
+ if(!mCacheHandler->FindEmbeddedItem(embeddedItem.pixelBufferId, embeddedItem.width, embeddedItem.height, index))
{
- ++index;
- if((item.pixelBufferId == embeddedItem.pixelBufferId) &&
- (item.width == embeddedItem.width) &&
- (item.height == embeddedItem.height))
- {
- return index;
- }
+ index = mCacheHandler->CacheEmbeddedItem(std::move(embeddedItem));
}
-
- // Cache the embedded item.
- mEmbeddedItemCache.PushBack(embeddedItem);
-
- return mEmbeddedItemCache.Count();
+ return index;
}
void FontClient::Plugin::EnableAtlasLimitation(bool enabled)
;
}
-void FontClient::Plugin::InitSystemFonts()
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
-
- FcFontSet* fontSet = GetFcFontSet(); // Creates a FcFontSet that needs to be destroyed by calling FcFontSetDestroy.
-
- if(fontSet)
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " number of system fonts : %d\n", fontSet->nfont);
-
- // Reserve some space to avoid reallocations.
- mSystemFonts.reserve(fontSet->nfont);
-
- for(int i = 0u; i < fontSet->nfont; ++i)
- {
- FcPattern* fontPattern = fontSet->fonts[i];
-
- FontPath path;
-
- // Skip fonts with no path
- if(GetFcString(fontPattern, FC_FILE, path))
- {
- mSystemFonts.push_back(FontDescription());
- FontDescription& fontDescription = mSystemFonts.back();
-
- fontDescription.path = std::move(path);
-
- int width = 0;
- int weight = 0;
- int slant = 0;
- GetFcString(fontPattern, FC_FAMILY, fontDescription.family);
- GetFcInt(fontPattern, FC_WIDTH, width);
- GetFcInt(fontPattern, FC_WEIGHT, weight);
- GetFcInt(fontPattern, FC_SLANT, slant);
- fontDescription.width = IntToWidthType(width);
- fontDescription.weight = IntToWeightType(weight);
- fontDescription.slant = IntToSlantType(slant);
-
- FONT_LOG_DESCRIPTION(fontDescription, "");
- }
- }
-
- // Destroys the font set created.
- FcFontSetDestroy(fontSet);
- }
-}
-
-bool FontClient::Plugin::MatchFontDescriptionToPattern(FcPattern* pattern, Dali::TextAbstraction::FontDescription& fontDescription, FcCharSet** characterSet)
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
-
- FcResult result = FcResultMatch;
- FcPattern* match = FcFontMatch(nullptr /* use default configure */, pattern, &result); // Creates a new font pattern that needs to be destroyed by calling FcPatternDestroy.
-
- const bool matched = nullptr != match;
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " pattern matched : %s\n", (matched ? "true" : "false"));
-
- if(matched)
- {
- int width = 0;
- int weight = 0;
- int slant = 0;
- GetFcString(match, FC_FILE, fontDescription.path);
- GetFcString(match, FC_FAMILY, fontDescription.family);
- GetFcInt(match, FC_WIDTH, width);
- GetFcInt(match, FC_WEIGHT, weight);
- GetFcInt(match, FC_SLANT, slant);
- fontDescription.width = IntToWidthType(width);
- fontDescription.weight = IntToWeightType(weight);
- fontDescription.slant = IntToSlantType(slant);
-
- // Retrieve the character set and increase the reference counter.
- FcPatternGetCharSet(match, FC_CHARSET, 0u, characterSet);
- *characterSet = FcCharSetCopy(*characterSet);
-
- // destroyed the matched pattern
- FcPatternDestroy(match);
- FONT_LOG_DESCRIPTION(fontDescription, "");
- }
- return matched;
-}
-
-_FcFontSet* FontClient::Plugin::GetFcFontSet() const
-{
- FcFontSet* fontset = nullptr;
-
- // create a new pattern.
- // a pattern holds a set of names, each name refers to a property of the font
- FcPattern* pattern = FcPatternCreate();
-
- if(nullptr != pattern)
- {
- // create an object set used to define which properties are to be returned in the patterns from FcFontList.
- FcObjectSet* objectSet = FcObjectSetCreate();
-
- if(nullptr != objectSet)
- {
- // build an object set from a list of property names
- FcObjectSetAdd(objectSet, FC_FILE);
- FcObjectSetAdd(objectSet, FC_FAMILY);
- FcObjectSetAdd(objectSet, FC_WIDTH);
- FcObjectSetAdd(objectSet, FC_WEIGHT);
- FcObjectSetAdd(objectSet, FC_SLANT);
-
- // get a list of fonts
- // creates patterns from those fonts containing only the objects in objectSet and returns the set of unique such patterns
- fontset = FcFontList(nullptr /* the default configuration is checked to be up to date, and used */, pattern, objectSet); // Creates a FcFontSet that needs to be destroyed by calling FcFontSetDestroy.
-
- // clear up the object set
- FcObjectSetDestroy(objectSet);
- }
-
- // clear up the pattern
- FcPatternDestroy(pattern);
- }
-
- return fontset;
-}
-
-bool FontClient::Plugin::GetFcString(const FcPattern* const pattern,
- const char* const n,
- std::string& string)
-{
- FcChar8* file = nullptr;
- const FcResult retVal = FcPatternGetString(pattern, n, 0u, &file);
-
- if(FcResultMatch == retVal)
- {
- // Have to use reinterpret_cast because FcChar8 is unsigned char*, not a const char*.
- string.assign(reinterpret_cast<const char*>(file));
-
- return true;
- }
-
- return false;
-}
-
-bool FontClient::Plugin::GetFcInt(const _FcPattern* const pattern, const char* const n, int& intVal)
-{
- const FcResult retVal = FcPatternGetInteger(pattern, n, 0u, &intVal);
-
- if(FcResultMatch == retVal)
- {
- return true;
- }
-
- return false;
-}
-
FontId FontClient::Plugin::CreateFont(const FontPath& path,
PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex,
- bool cacheDescription)
+ bool cacheDescription) const
{
DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " path : [%s]\n", path.c_str());
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize : %d\n", requestedPointSize);
- FontId id = 0u;
+ FontId fontId = 0u;
// Create & cache new font face
FT_Face ftFace;
const bool isScalable = (0 != (ftFace->face_flags & FT_FACE_FLAG_SCALABLE));
const bool hasFixedSizedBitmaps = (0 != (ftFace->face_flags & FT_FACE_FLAG_FIXED_SIZES)) && (0 != ftFace->num_fixed_sizes);
const bool hasColorTables = (0 != (ftFace->face_flags & FT_FACE_FLAG_COLOR));
- FontId fontFaceId = 0u;
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " isScalable : [%s]\n", (isScalable ? "true" : "false"));
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " hasFixedSizedBitmaps : [%s]\n", (hasFixedSizedBitmaps ? "true" : "false"));
// Create the FreeType font face item to cache.
FontFaceCacheItem fontFaceCacheItem(mFreeTypeLibrary, ftFace, path, requestedPointSize, faceIndex, metrics, fixedSizeIndex, fixedWidth, fixedHeight, hasColorTables);
- // Set the index to the font's id cache.
- fontFaceCacheItem.mFontId = mFontIdCache.Count();
-
- // Create the font id item to cache.
- FontIdCacheItem fontIdCacheItem;
- fontIdCacheItem.type = FontDescription::FACE_FONT;
-
- // Set the index to the FreeType font face cache.
- fontIdCacheItem.index = mFontFaceCache.size();
- fontFaceId = fontIdCacheItem.index + 1u;
-
- // Cache the items.
- mFontFaceCache.emplace_back(std::move(fontFaceCacheItem));
- mFontIdCache.PushBack(fontIdCacheItem);
-
- // Set the font id to be returned.
- id = mFontIdCache.Count();
+ fontId = mCacheHandler->CacheFontFaceCacheItem(std::move(fontFaceCacheItem));
}
}
else
// Create the FreeType font face item to cache.
FontFaceCacheItem fontFaceCacheItem(mFreeTypeLibrary, ftFace, path, requestedPointSize, faceIndex, metrics);
- // Set the index to the font's id cache.
- fontFaceCacheItem.mFontId = mFontIdCache.Count();
-
- // Create the font id item to cache.
- FontIdCacheItem fontIdCacheItem;
- fontIdCacheItem.type = FontDescription::FACE_FONT;
-
- // Set the index to the FreeType font face cache.
- fontIdCacheItem.index = mFontFaceCache.size();
- fontFaceId = fontIdCacheItem.index + 1u;
-
- // Cache the items.
- mFontFaceCache.emplace_back(std::move(fontFaceCacheItem));
- mFontIdCache.PushBack(fontIdCacheItem);
-
- // Set the font id to be returned.
- id = mFontIdCache.Count();
+ fontId = mCacheHandler->CacheFontFaceCacheItem(std::move(fontFaceCacheItem));
}
else
{
}
}
- if(0u != fontFaceId)
+ if(0u != fontId)
{
if(cacheDescription)
{
- CacheFontPath(ftFace, fontFaceId, requestedPointSize, path);
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " Cache Font Path at font id : %d [%s]\n", fontId, path.c_str());
+ mCacheHandler->CacheFontPath(ftFace, fontId, requestedPointSize, path);
}
}
}
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " FreeType New_Face error: %d for [%s]\n", error, path.c_str());
}
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", id);
- return id;
-}
-
-bool FontClient::Plugin::FindFont(const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex,
- FontId& fontId) const
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " path : [%s]\n", path.c_str());
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize : %d\n", requestedPointSize);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of fonts in the cache : %d\n", mFontFaceCache.size());
-
- fontId = 0u;
- for(const auto& cacheItem : mFontFaceCache)
- {
- if(cacheItem.mRequestedPointSize == requestedPointSize &&
- cacheItem.mFaceIndex == faceIndex &&
- cacheItem.mPath == path)
- {
- fontId = cacheItem.mFontId + 1u;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font found, id : %d\n", fontId);
- return true;
- }
- }
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font not found\n");
- return false;
-}
-
-bool FontClient::Plugin::FindValidatedFont(const FontDescription& fontDescription,
- FontDescriptionId& fontDescriptionId)
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- FONT_LOG_DESCRIPTION(fontDescription, "");
- DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of validated fonts in the cache : %d\n", mValidatedFontCache.size());
-
- fontDescriptionId = 0u;
-
- // Fast cut if inputed family is empty.
- if(DALI_UNLIKELY(fontDescription.family.empty()))
- {
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description not found / fontDescription.family is empty!\n");
- return false;
- }
-
- // Heuristic optimize code : Compare with latest found item.
- if((fontDescription.width == mLatestFoundFontDescription.width) &&
- (fontDescription.weight == mLatestFoundFontDescription.weight) &&
- (fontDescription.slant == mLatestFoundFontDescription.slant) &&
- (fontDescription.family == mLatestFoundFontDescription.family))
- {
- fontDescriptionId = mLatestFoundFontDescriptionId;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description same as latest, id : %d\n", fontDescriptionId);
- return true;
- }
-
- for(const auto& item : mValidatedFontCache)
- {
- if((fontDescription.width == item.fontDescription.width) &&
- (fontDescription.weight == item.fontDescription.weight) &&
- (fontDescription.slant == item.fontDescription.slant) &&
- (fontDescription.family == item.fontDescription.family))
- {
- fontDescriptionId = item.index;
-
- mLatestFoundFontDescription = fontDescription;
- mLatestFoundFontDescriptionId = fontDescriptionId;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description found, id : %d\n", fontDescriptionId);
- return true;
- }
- }
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " validated font description not found\n");
- return false;
-}
-
-bool FontClient::Plugin::FindFallbackFontList(const FontDescription& fontDescription,
- FontList*& fontList,
- CharacterSetList*& characterSetList)
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- FONT_LOG_DESCRIPTION(fontDescription, "");
- DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, " number of fallback font lists in the cache : %d\n", mFallbackCache.size());
-
- fontList = nullptr;
-
- for(const auto& item : mFallbackCache)
- {
- if(!fontDescription.family.empty() &&
- (fontDescription.family == item.fontDescription.family) &&
- (fontDescription.width == item.fontDescription.width) &&
- (fontDescription.weight == item.fontDescription.weight) &&
- (fontDescription.slant == item.fontDescription.slant))
- {
- fontList = item.fallbackFonts;
- characterSetList = item.characterSets;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fallback font list found.\n");
- return true;
- }
- }
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fallback font list not found.\n");
- return false;
-}
-
-bool FontClient::Plugin::FindFont(FontDescriptionId fontDescriptionId,
- PointSize26Dot6 requestedPointSize,
- FontCacheIndex& fontCacheIndex)
-{
- DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " fontDescriptionId : %d\n", fontDescriptionId);
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " requestedPointSize : %d\n", requestedPointSize);
-
- fontCacheIndex = 0u;
-
- const FontDescriptionSizeCacheKey key(fontDescriptionId, requestedPointSize);
-
- // Heuristic optimize code : Compare with latest found item.
- if(key == mLatestFoundCacheKey)
- {
- fontCacheIndex = mLatestFoundCacheIndex;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font same as latest, index of font cache : %d\n", fontCacheIndex);
- return true;
- }
-
- const auto& iter = mFontDescriptionSizeCache.find(key);
- if(iter != mFontDescriptionSizeCache.cend())
- {
- fontCacheIndex = iter->second;
-
- mLatestFoundCacheKey = key;
- mLatestFoundCacheIndex = fontCacheIndex;
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font found, index of font cache : %d\n", fontCacheIndex);
- return true;
- }
-
- DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font not found.\n");
- return false;
-}
-
-bool FontClient::Plugin::FindBitmapFont(const FontFamily& bitmapFont, FontId& fontId) const
-{
- fontId = 0u;
-
- for(const auto& item : mBitmapFontCache)
- {
- if(bitmapFont == item.font.name)
- {
- fontId = item.id + 1u;
- return true;
- }
- }
-
- return false;
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font id : %d\n", fontId);
+ return fontId;
}
-bool FontClient::Plugin::IsScalable(const FontPath& path)
+bool FontClient::Plugin::IsScalable(const FontPath& path) const
{
bool isScalable = false;
- FT_Face ftFace;
- int error = FT_New_Face(mFreeTypeLibrary,
+ FT_Face ftFace = nullptr;
+ int error = FT_New_Face(mFreeTypeLibrary,
path.c_str(),
0,
&ftFace);
isScalable = ftFace->face_flags & FT_FACE_FLAG_SCALABLE;
}
+ if(ftFace)
+ {
+ FT_Done_Face(ftFace);
+ }
+
return isScalable;
}
-bool FontClient::Plugin::IsScalable(const FontDescription& fontDescription)
+bool FontClient::Plugin::IsScalable(const FontDescription& fontDescription) const
{
// Create a font pattern.
FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription); // Creates a font pattern that needs to be destroyed by calling FcPatternDestroy.
return isScalable;
}
-void FontClient::Plugin::GetFixedSizes(const FontPath& path, Vector<PointSize26Dot6>& sizes)
+void FontClient::Plugin::GetFixedSizes(const FontPath& path, Vector<PointSize26Dot6>& sizes) const
{
// Empty the caller container
sizes.Clear();
- FT_Face ftFace;
- int error = FT_New_Face(mFreeTypeLibrary,
+ FT_Face ftFace = nullptr;
+ int error = FT_New_Face(mFreeTypeLibrary,
path.c_str(),
0,
&ftFace);
DALI_LOG_INFO(gFontClientLogFilter, Debug::General, "FontClient::Plugin::GetFixedSizes. FreeType Cannot check font path : [%s]\n", path.c_str());
}
- // Fetch the number of fixed sizes available
- if(ftFace->num_fixed_sizes && ftFace->available_sizes)
+ if(ftFace)
{
- for(int i = 0; i < ftFace->num_fixed_sizes; ++i)
+ // Fetch the number of fixed sizes available
+ if(ftFace->num_fixed_sizes && ftFace->available_sizes)
{
- sizes.PushBack(ftFace->available_sizes[i].size);
+ for(int i = 0; i < ftFace->num_fixed_sizes; ++i)
+ {
+ sizes.PushBack(ftFace->available_sizes[i].size);
+ }
}
+
+ FT_Done_Face(ftFace);
}
}
void FontClient::Plugin::GetFixedSizes(const FontDescription& fontDescription,
- Vector<PointSize26Dot6>& sizes)
+ Vector<PointSize26Dot6>& sizes) const
{
// Create a font pattern.
FcPattern* fontFamilyPattern = CreateFontFamilyPattern(fontDescription); // Creates a font pattern that needs to be destroyed by calling FcPatternDestroy.
return false;
}
-void FontClient::Plugin::CacheFontPath(FT_Face ftFace, FontId id, PointSize26Dot6 requestedPointSize, const FontPath& path)
-{
- FontDescription description;
- description.path = path;
- description.family = std::move(FontFamily(ftFace->family_name));
- description.weight = FontWeight::NONE;
- description.width = FontWidth::NONE;
- description.slant = FontSlant::NONE;
-
- // Note FreeType doesn't give too much info to build a proper font style.
- if(ftFace->style_flags & FT_STYLE_FLAG_ITALIC)
- {
- description.slant = FontSlant::ITALIC;
- }
- if(ftFace->style_flags & FT_STYLE_FLAG_BOLD)
- {
- description.weight = FontWeight::BOLD;
- }
-
- FontDescriptionId fontDescriptionId = 0u;
- if(!FindValidatedFont(description,
- fontDescriptionId))
- {
- FcPattern* pattern = CreateFontFamilyPattern(description); // Creates a new pattern that needs to be destroyed by calling FcPatternDestroy.
-
- FcResult result = FcResultMatch;
- FcPattern* match = FcFontMatch(nullptr, pattern, &result); // FcFontMatch creates a new pattern that needs to be destroyed by calling FcPatternDestroy.
-
- FcCharSet* characterSet = nullptr;
- FcPatternGetCharSet(match, FC_CHARSET, 0u, &characterSet);
-
- const FontId fontFaceId = id - 1u;
- mFontFaceCache[fontFaceId].mCharacterSet = FcCharSetCopy(characterSet); // Increases the reference counter.
-
- // Destroys the created patterns.
- FcPatternDestroy(match);
- FcPatternDestroy(pattern);
-
- // Add the path to the cache.
- description.type = FontDescription::FACE_FONT;
- mFontDescriptionCache.push_back(description);
-
- // Set the index to the vector of paths to font file names.
- fontDescriptionId = mFontDescriptionCache.size();
-
- // Increase the reference counter and add the character set to the cache.
- mCharacterSetCache.PushBack(FcCharSetCopy(characterSet));
-
- // Cache the index and the font's description.
- mValidatedFontCache.push_back(std::move(FontDescriptionCacheItem(std::move(description),
- fontDescriptionId)));
-
- // Cache the pair 'fontDescriptionId, requestedPointSize' to improve the following queries.
- mFontDescriptionSizeCache.emplace(FontDescriptionSizeCacheKey(fontDescriptionId, requestedPointSize), fontFaceId);
- }
-}
-
-void FontClient::Plugin::ClearFallbackCache(std::vector<FallbackCacheItem>& fallbackCache)
-{
- for(auto& item : fallbackCache)
- {
- if(nullptr != item.fallbackFonts)
- {
- delete item.fallbackFonts;
- }
-
- if(nullptr != item.characterSets)
- {
- // Free the resources allocated by the FcCharSet objects in the 'characterSets' vector.
- DestroyCharacterSets(*item.characterSets);
- delete item.characterSets;
- }
- }
-}
-
-void FontClient::Plugin::ClearCharacterSetFromFontFaceCache()
-{
- for(auto& item : mFontFaceCache)
- {
- FcCharSetDestroy(item.mCharacterSet);
- item.mCharacterSet = nullptr;
- }
-}
-
} // namespace Dali::TextAbstraction::Internal
*/
struct FontClient::Plugin
{
-private:
- /// Redefine FontId name to specifiy the value's usage
- using FontCacheIndex = FontId;
-
- /**
- * @brief Index of FontCache container.
- */
- struct FontIdCacheItem
- {
- FontDescription::Type type; ///< The type of font.
- FontCacheIndex index; ///< Index to the cache of fonts for the specified type. Face or Bitmap
- };
-
- /**
- * @brief Caches an list of fallback fonts for a given font-description
- */
- struct FallbackCacheItem
- {
- FallbackCacheItem(FontDescription&& fontDescription, FontList* fallbackFonts, CharacterSetList* characterSets);
-
- FontDescription fontDescription; ///< The font description.
- FontList* fallbackFonts; ///< The list of fallback fonts for the given font-description.
- CharacterSetList* characterSets; ///< The list of character sets for the given font-description.
- };
-
- /**
- * @brief Caches an index to the vector of font descriptions for a given font.
- */
- struct FontDescriptionCacheItem
- {
- FontDescriptionCacheItem(const FontDescription& fontDescription,
- FontDescriptionId index);
- FontDescriptionCacheItem(FontDescription&& fontDescription,
- FontDescriptionId index);
-
- FontDescription fontDescription; ///< The font description.
- FontDescriptionId index; ///< Index to the vector of font descriptions.
- };
-
- /**
- * @brief Pair of FontDescriptionId and PointSize. It will be used to find cached validate font.
- */
- struct FontDescriptionSizeCacheKey
- {
- FontDescriptionSizeCacheKey(FontDescriptionId fontDescriptionId,
- PointSize26Dot6 requestedPointSize);
-
- FontDescriptionId fontDescriptionId; ///< Index to the vector with font descriptions.
- PointSize26Dot6 requestedPointSize; ///< The font point size.
-
- bool operator==(FontDescriptionSizeCacheKey const& rhs) const noexcept
- {
- return fontDescriptionId == rhs.fontDescriptionId && requestedPointSize == rhs.requestedPointSize;
- }
- };
-
- /**
- * @brief Custom hash functions for FontDescriptionSizeCacheKey.
- */
- struct FontDescriptionSizeCacheKeyHash
- {
- std::size_t operator()(FontDescriptionSizeCacheKey const& key) const noexcept
- {
- return key.fontDescriptionId ^ key.requestedPointSize;
- }
- };
-
- /**
- * @brief Caches the font id of the pair font point size and the index to the vector of font descriptions of validated fonts.
- */
- using FontDescriptionSizeCacheContainer = std::unordered_map<FontDescriptionSizeCacheKey, FontCacheIndex, FontDescriptionSizeCacheKeyHash>;
-
- struct EllipsisItem
- {
- PointSize26Dot6 requestedPointSize;
- GlyphInfo glyph;
- };
-
-public:
+public: // Dali::TextAbstraction::FontClient
/**
* Constructor.
*
/**
* @copydoc Dali::TextAbstraction::FontClient::ClearCache()
*/
- void ClearCache();
+ void ClearCache() const;
/**
* @copydoc Dali::TextAbstraction::FontClient::SetDpi()
/**
* @copydoc Dali::TextAbstraction::FontClient::ResetSystemDefaults()
*/
- void ResetSystemDefaults();
-
- /**
- * @copydoc Dali::TextAbstraction::FontClient::SetDefaultFont()
- */
- void SetDefaultFont(const FontDescription& preferredFontDescription);
+ void ResetSystemDefaults() const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetDefaultPlatformFontDescription()
*/
- void GetDefaultPlatformFontDescription(FontDescription& fontDescription);
+ void GetDefaultPlatformFontDescription(FontDescription& fontDescription) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetDefaultFonts()
*/
- void GetDefaultFonts(FontList& defaultFonts);
+ void GetDefaultFonts(FontList& defaultFonts) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetSystemFonts()
*/
- void GetSystemFonts(FontList& systemFonts);
+ void GetSystemFonts(FontList& systemFonts) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetDescription()
*/
- void GetDescription(FontId id, FontDescription& fontDescription) const;
+ void GetDescription(FontId fontId, FontDescription& fontDescription) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetPointSize()
*/
- PointSize26Dot6 GetPointSize(FontId id);
+ PointSize26Dot6 GetPointSize(FontId fontId) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::IsCharacterSupportedByFont()
*/
- bool IsCharacterSupportedByFont(FontId fontId, Character character);
-
- /**
- * Get the cached font item for the given font
- * @param[in] id The font id to search for
- * @return the matching cached font item
- */
- const FontCacheItemInterface* GetCachedFontItem(FontId id) const;
-
- /**
- * @brief Finds within the @p fontList a font which support the @p carcode.
- *
- * @param[in] fontList A list of font paths, family, width, weight and slant.
- * @param[in] characterSetList A list that contains a character set for each description of the font list.
- * @param[in] charcode The character for which a font is needed.
- * @param[in] requestedPointSize The point size in 26.6 fractional points.
- * @param[in] preferColor @e true if a color font is preferred.
- *
- * @return A valid font identifier, or zero if no font is found.
- */
- FontId FindFontForCharacter(const FontList& fontList,
- const CharacterSetList& characterSetList,
- Character charcode,
- PointSize26Dot6 requestedPointSize,
- bool preferColor);
+ bool IsCharacterSupportedByFont(FontId fontId, Character character) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::FindDefaultFont()
*/
FontId FindDefaultFont(Character charcode,
PointSize26Dot6 requestedPointSize,
- bool preferColor);
+ bool preferColor) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::FindFallbackFont()
FontId FindFallbackFont(Character charcode,
const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize,
- bool preferColor);
+ bool preferColor) const;
/**
* @see Dali::TextAbstraction::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*
* @param[in] cacheDescription Whether to cache the font description.
*/
- FontId GetFontId(const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex,
- bool cacheDescription);
+ FontId GetFontIdByPath(const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex faceIndex,
+ bool cacheDescription) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
*/
FontId GetFontId(const FontDescription& fontDescription,
PointSize26Dot6 requestedPointSize,
- FaceIndex faceIndex);
+ FaceIndex faceIndex) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetFontId( const BitmapFont& bitmapFont )
*/
- FontId GetFontId(const BitmapFont& bitmapFont);
+ FontId GetFontId(const BitmapFont& bitmapFont) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontPath& path )
*/
- bool IsScalable(const FontPath& path);
+ bool IsScalable(const FontPath& path) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontDescription& fontDescription )
*/
- bool IsScalable(const FontDescription& fontDescription);
+ bool IsScalable(const FontDescription& fontDescription) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes()
*/
- void GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes);
+ void GetFixedSizes(const FontPath& path, Dali::Vector<PointSize26Dot6>& sizes) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes()
*/
void GetFixedSizes(const FontDescription& fontDescription,
- Dali::Vector<PointSize26Dot6>& sizes);
+ Dali::Vector<PointSize26Dot6>& sizes) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::HasItalicStyle()
/**
* @copydoc Dali::TextAbstraction::FontClient::GetFontMetrics()
*/
- void GetFontMetrics(FontId fontId, FontMetrics& metrics);
+ void GetFontMetrics(FontId fontId, FontMetrics& metrics) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetGlyphIndex()
*/
- GlyphIndex GetGlyphIndex(FontId fontId, Character charcode);
+ GlyphIndex GetGlyphIndex(FontId fontId, Character charcode) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetGlyphIndex()
*/
- GlyphIndex GetGlyphIndex(FontId fontId, Character charcode, Character variantSelector);
+ GlyphIndex GetGlyphIndex(FontId fontId, Character charcode, Character variantSelector) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetGlyphMetrics()
*/
- bool GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal);
+ bool GetGlyphMetrics(GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal) const;
/**
* Helper for GetGlyphMetrics when using bitmaps
*/
- bool GetBitmapMetrics(GlyphInfo* array, uint32_t size, bool horizontal);
+ bool GetBitmapMetrics(GlyphInfo* array, uint32_t size, bool horizontal) const;
/**
* Helper for GetGlyphMetrics when using vectors
*/
- bool GetVectorMetrics(GlyphInfo* array, uint32_t size, bool horizontal);
+ bool GetVectorMetrics(GlyphInfo* array, uint32_t size, bool horizontal) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
*/
- void CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth);
+ void CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool isItalicRequired, bool isBoldRequired, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
*/
- PixelData CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth);
+ PixelData CreateBitmap(FontId fontId, GlyphIndex glyphIndex, int outlineWidth) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateVectorBlob()
*/
- void CreateVectorBlob(FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight);
+ void CreateVectorBlob(FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::GetEllipsisGlyph()
*/
- const GlyphInfo& GetEllipsisGlyph(PointSize26Dot6 requestedPointSize);
+ const GlyphInfo& GetEllipsisGlyph(PointSize26Dot6 requestedPointSize) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::IsColorGlyph()
*/
- bool IsColorGlyph(FontId fontId, GlyphIndex glyphIndex);
+ bool IsColorGlyph(FontId fontId, GlyphIndex glyphIndex) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::CreateEmbeddedItem()
*/
- GlyphIndex CreateEmbeddedItem(const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat);
+ GlyphIndex CreateEmbeddedItem(const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat) const;
/**
* @copydoc Dali::TextAbstraction::FontClient::EnableAtlasLimitation(bool enabled)
uint32_t GetNumberOfPointsPerOneUnitOfPointSize() const;
/**
- * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFreetypeFace()
- */
- FT_FaceRec_* GetFreetypeFace(FontId fontId);
-
- /**
- * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFontType()
- */
- FontDescription::Type GetFontType(FontId fontId);
-
- /**
* @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
*/
bool AddCustomFontDirectory(const FontPath& path);
+public: // Dali::TextAbstraction::Internal::FontClient
/**
- * @copydoc Dali::TextAbstraction::FontClient::GetHarfBuzzFont()
- */
- HarfBuzzFontHandle GetHarfBuzzFont(FontId fontId);
-
-private:
- /**
- * @brief Caches the fonts present in the platform.
- *
- * Calls GetFcFontSet() to retrieve the fonts.
+ * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFreetypeFace()
*/
- void InitSystemFonts();
+ FT_FaceRec_* GetFreetypeFace(FontId fontId) const;
/**
- * @brief Gets the FontDescription which matches the given pattern.
- *
- * @note The reference counter of the @p characterSet has been increased. Call FcCharSetDestroy to decrease it.
- *
- * @param[in] pattern pattern to match against.
- * @param[out] fontDescription the resultant fontDescription that matched.
- * @param[out] characterSet The character set for that pattern.
- * @return true if match found.
+ * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFontType()
*/
- bool MatchFontDescriptionToPattern(_FcPattern* pattern, Dali::TextAbstraction::FontDescription& fontDescription, _FcCharSet** characterSet);
+ FontDescription::Type GetFontType(FontId fontId) const;
/**
- * @brief Retrieves the fonts present in the platform.
- *
- * @note Need to call FcFontSetDestroy to free the allocated resources.
- *
- * @return A font fonfig data structure with the platform's fonts.
+ * @copydoc Dali::TextAbstraction::Internal::FontClient::GetHarfBuzzFont()
*/
- _FcFontSet* GetFcFontSet() const;
+ HarfBuzzFontHandle GetHarfBuzzFont(FontId fontId) const;
+private:
/**
- * @brief Retrieves a font config object's value from a pattern.
- *
- * @param[in] pattern The font config pattern.
- * @param[in] n The object.
- * @param[out] string The object's value.
- *
- * @return @e true if the operation is successful.
+ * Get the cached font item for the given font
+ * @param[in] fontId The font id to search for
+ * @return the matching cached font item
*/
- bool GetFcString(const _FcPattern* const pattern, const char* const n, std::string& string);
+ const FontCacheItemInterface* GetCachedFontItem(FontId fontId) const;
/**
- * @brief Retrieves a font config object's value from a pattern.
+ * @brief Finds within the @p fontList a font which support the @p carcode.
*
- * @param[in] pattern The font config pattern.
- * @param[in] n The object.
- * @param[out] intVal The object's value.
+ * @param[in] fontList A list of font paths, family, width, weight and slant.
+ * @param[in] characterSetList A list that contains a character set for each description of the font list.
+ * @param[in] charcode The character for which a font is needed.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points.
+ * @param[in] preferColor @e true if a color font is preferred.
*
- * @return @e true if the operation is successful.
+ * @return A valid font identifier, or zero if no font is found.
*/
- bool GetFcInt(const _FcPattern* const pattern, const char* const n, int& intVal);
+ FontId FindFontForCharacter(const FontList& fontList,
+ const CharacterSetList& characterSetList,
+ Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor) const;
/**
* @brief Creates a font.
FontId CreateFont(const FontPath& path,
PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex,
- bool cacheDescription);
-
- /**
- * @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index.
- * If there is one , if writes the font identifier in the param @p fontId.
- *
- * @param[in] path Path to the font file name.
- * @param[in] requestedPointSize The font point size.
- * @param[in] faceIndex The face index.
- * @param[out] fontId The font identifier.
- *
- * @return @e true if there triplet is found.
- */
- bool FindFont(const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex, FontId& fontId) const;
-
- /**
- * @brief Finds in the cache a cluster 'font family, font width, font weight, font slant'
- * If there is one, it writes the index to the vector with font descriptions in the param @p validatedFontId.
- *
- * @param[in] fontDescription The font to validate.
- * @param[out] validatedFontId The index to the vector with font descriptions.
- *
- * @return @e true if the pair is found.
- */
- bool FindValidatedFont(const FontDescription& fontDescription,
- FontDescriptionId& validatedFontId);
-
- /**
- * @brief Finds a fallback font list from the cache for a given font-description
- *
- * @param[in] fontDescription The font to validate.
- * @param[out] A valid pointer to a font list, or @e nullptr if not found.
- * @param[out] characterSetList A valid pointer to a character set list, or @e nullptr if not found.
- */
- bool FindFallbackFontList(const FontDescription& fontDescription,
- FontList*& fontList,
- CharacterSetList*& characterSetList);
-
- /**
- * @brief Finds in the cache a pair 'validated font identifier and font point size'.
- * If there is one it writes the font identifier in the param @p fontCacheIndex.
- *
- * @param[in] validatedFontId Index to the vector with font descriptions.
- * @param[in] requestedPointSize The font point size.
- * @param[out] fontCacheIndex The index of font cache identifier.
- *
- * @return @e true if the pair is found.
- */
- bool FindFont(FontDescriptionId validatedFontId,
- PointSize26Dot6 requestedPointSize,
- FontCacheIndex& fontCacheIndex);
-
- /**
- * @brief Finds in the cache a bitmap font with the @p bitmapFont family name.
- *
- * @param[in] bitmapFont The font's family name.
- * @param[out] fontId The id of the font.
- *
- * @return Whether the font has been found.
- */
- bool FindBitmapFont(const FontFamily& bitmapFont, FontId& fontId) const;
-
- /**
- * @brief Validate a font description.
- *
- * @param[in] fontDescription The font to validate.
- * @param[out] validatedFontId Result of validation
- */
- void ValidateFont(const FontDescription& fontDescription,
- FontDescriptionId& validatedFontId);
-
- /**
- * @brief Helper for GetDefaultFonts etc.
- *
- * @note CharacterSetList is a vector of FcCharSet that are reference counted. It's needed to call FcCharSetDestroy to decrease the reference counter.
- *
- * @param[in] fontDescription A font description.
- * @param[out] fontList A list of the fonts which are a close match for fontDescription.
- * @param[out] characterSetList A list of character sets which are a close match for fontDescription.
- */
- void SetFontList(const FontDescription& fontDescription, FontList& fontList, CharacterSetList& characterSetList);
-
- /**
- * Caches a font path.
- *
- * @param[in] ftFace The FreeType face.
- * @param[in] id The font identifier.
- * @param[in] requestedPointSize The font point size.
- * @param[in] path Path to the font file name.
- */
- void CacheFontPath(FT_Face ftFace, FontId id, PointSize26Dot6 requestedPointSize, const FontPath& path);
-
- /**
- * @brief Free the resources allocated in the fallback cache.
- *
- * @param[in] fallbackCache The fallback cache.
- */
- void ClearFallbackCache(std::vector<FallbackCacheItem>& fallbackCache);
-
- /**
- * @brief Free the resources allocated by the FcCharSet objects.
- */
- void ClearCharacterSetFromFontFaceCache();
+ bool cacheDescription) const;
private:
Plugin(const Plugin&) = delete;
unsigned int mDpiHorizontal; ///< Horizontal dpi.
unsigned int mDpiVertical; ///< Vertical dpi.
- FontDescription mDefaultFontDescription; ///< The cached default font from the system
-
- FontList mSystemFonts; ///< Cached system fonts.
- FontList mDefaultFonts; ///< Cached default fonts.
- CharacterSetList mDefaultFontCharacterSets;
-
- std::vector<FallbackCacheItem> mFallbackCache; ///< Cached fallback font lists.
-
- Vector<FontIdCacheItem> mFontIdCache; ///< Caches from FontId to FontCacheIndex.
- std::vector<FontFaceCacheItem> mFontFaceCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
- std::vector<FontDescriptionCacheItem> mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font.
- FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font.
- CharacterSetList mCharacterSetCache; ///< Caches character set lists for the validated font.
-
- FontDescriptionSizeCacheContainer mFontDescriptionSizeCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
+ bool mIsAtlasLimitationEnabled : 1; ///< Whether the validation on maximum atlas block size, then reduce block size to fit into it is enabled or not.
+ Vector2 mCurrentMaximumBlockSizeFitInAtlas; ///< The current maximum size (width, height) of text-atlas-block.
+private:
VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc.
- Vector<EllipsisItem> mEllipsisCache; ///< Caches ellipsis glyphs for a particular point size.
- std::vector<PixelBufferCacheItem> mPixelBufferCache; ///< Caches the pixel buffer of a url.
- Vector<EmbeddedItem> mEmbeddedItemCache; ///< Cache embedded items.
- std::vector<BitmapFontCacheItem> mBitmapFontCache; ///< Stores bitmap fonts.
-
- FontDescription mLatestFoundFontDescription; ///< Latest found font description and id in FindValidatedFont()
- FontDescriptionId mLatestFoundFontDescriptionId;
-
- FontDescriptionSizeCacheKey mLatestFoundCacheKey; ///< Latest found font description and id in FindFont()
- FontCacheIndex mLatestFoundCacheIndex;
-
- bool mDefaultFontDescriptionCached : 1; ///< Whether the default font is cached or not
-
- bool mIsAtlasLimitationEnabled : 1; ///< Whether the validation on maximum atlas block size, then reduce block size to fit into it is enabled or not.
- Vector2 mCurrentMaximumBlockSizeFitInAtlas; ///< The current maximum size (width, height) of text-atlas-block.
+ struct CacheHandler;
+ CacheHandler* mCacheHandler; ///< Seperate cache for font data.
};
} // namespace Internal
#if defined(DEBUG_ENABLED)
extern Dali::Integration::Log::Filter* gFontClientLogFilter;
+
+#define FONT_LOG_DESCRIPTION(fontDescription, prefix) \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, #prefix " description; family : [%s]\n", fontDescription.family.c_str()); \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, \
+ " path : [%s]\n" \
+ " width : [%s]\n" \
+ " weight : [%s]\n" \
+ " slant : [%s]\n\n", \
+ fontDescription.path.c_str(), \
+ FontWidth::Name[fontDescription.width], \
+ FontWeight::Name[fontDescription.weight], \
+ FontSlant::Name[fontDescription.slant])
+
+#define FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor) \
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, \
+ " character : %p\n" \
+ " requestedPointSize : %d\n" \
+ " preferColor : %s\n", \
+ charcode, \
+ requestedPointSize, \
+ (preferColor ? "true" : "false"))
+
+#else
+
+#define FONT_LOG_DESCRIPTION(fontDescription, prefix)
+#define FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor)
+
#endif
namespace Dali::TextAbstraction::Internal
return static_cast<FontSlant::Type>(ValueToIndex(slant, FONT_SLANT_TYPE_TO_INT, NUM_FONT_SLANT_TYPE - 1u));
}
-const int DEFAULT_FONT_WIDTH(100);
-const int DEFAULT_FONT_WEIGHT(80);
-const int DEFAULT_FONT_SLANT(0);
+const std::string DEFAULT_FONT_FAMILY_NAME("Tizen");
+const int DEFAULT_FONT_WIDTH(100);
+const int DEFAULT_FONT_WEIGHT(80);
+const int DEFAULT_FONT_SLANT(0);
+const std::string_view DefaultFontFamily()
+{
+ return DEFAULT_FONT_FAMILY_NAME;
+}
const FontWidth::Type DefaultFontWidth()
{
return IntToWidthType(DEFAULT_FONT_WIDTH);
return characterSet;
}
+bool MatchFontDescriptionToPattern(FcPattern* pattern, Dali::TextAbstraction::FontDescription& fontDescription, FcCharSet** characterSet)
+{
+ DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
+
+ FcResult result = FcResultMatch;
+ FcPattern* match = FcFontMatch(nullptr /* use default configure */, pattern, &result); // Creates a new font pattern that needs to be destroyed by calling FcPatternDestroy.
+
+ const bool matched = nullptr != match;
+ DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " pattern matched : %s\n", (matched ? "true" : "false"));
+
+ if(matched)
+ {
+ int width = 0;
+ int weight = 0;
+ int slant = 0;
+ GetFcString(match, FC_FILE, fontDescription.path);
+ GetFcString(match, FC_FAMILY, fontDescription.family);
+ GetFcInt(match, FC_WIDTH, width);
+ GetFcInt(match, FC_WEIGHT, weight);
+ GetFcInt(match, FC_SLANT, slant);
+ fontDescription.width = IntToWidthType(width);
+ fontDescription.weight = IntToWeightType(weight);
+ fontDescription.slant = IntToSlantType(slant);
+
+ // Retrieve the character set and increase the reference counter.
+ FcPatternGetCharSet(match, FC_CHARSET, 0u, characterSet);
+ *characterSet = FcCharSetCopy(*characterSet);
+
+ // destroyed the matched pattern
+ FcPatternDestroy(match);
+ FONT_LOG_DESCRIPTION(fontDescription, "");
+ }
+ return matched;
+}
+
+bool GetFcString(const FcPattern* const pattern, const char* const n, std::string& string)
+{
+ FcChar8* file = nullptr;
+ const FcResult retVal = FcPatternGetString(pattern, n, 0u, &file);
+
+ if(FcResultMatch == retVal)
+ {
+ // Have to use reinterpret_cast because FcChar8 is unsigned char*, not a const char*.
+ string.assign(reinterpret_cast<const char*>(file));
+
+ return true;
+ }
+
+ return false;
+}
+
+bool GetFcInt(const _FcPattern* const pattern, const char* const n, int& intVal)
+{
+ const FcResult retVal = FcPatternGetInteger(pattern, n, 0u, &intVal);
+
+ if(FcResultMatch == retVal)
+ {
+ return true;
+ }
+
+ return false;
+}
+
} // namespace Dali::TextAbstraction::Internal
-#ifndef DALI_TEST_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
-#define DALI_TEST_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
+#ifndef DALI_TEXT_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
+#define DALI_TEXT_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
/*
* Copyright (c) 2022 Samsung Electronics Co., Ltd.
*/
FcCharSet* CreateCharacterSetFromDescription(const FontDescription& description);
+/**
+ * @brief Gets the FontDescription which matches the given pattern.
+ *
+ * @note The reference counter of the @p characterSet has been increased. Call FcCharSetDestroy to decrease it.
+ *
+ * @param[in] pattern pattern to match against.
+ * @param[out] fontDescription the resultant fontDescription that matched.
+ * @param[out] characterSet The character set for that pattern.
+ * @return true if match found.
+ */
+bool MatchFontDescriptionToPattern(FcPattern* pattern, Dali::TextAbstraction::FontDescription& fontDescription, FcCharSet** characterSet);
+
+/**
+ * @brief Retrieves a font config object's value from a pattern.
+ *
+ * @param[in] pattern The font config pattern.
+ * @param[in] n The object.
+ * @param[out] string The object's value.
+ *
+ * @return @e true if the operation is successful.
+ */
+bool GetFcString(const FcPattern* const pattern, const char* const n, std::string& string);
+
+/**
+ * @brief Retrieves a font config object's value from a pattern.
+ *
+ * @param[in] pattern The font config pattern.
+ * @param[in] n The object.
+ * @param[out] intVal The object's value.
+ *
+ * @return @e true if the operation is successful.
+ */
+bool GetFcInt(const _FcPattern* const pattern, const char* const n, int& intVal);
+
constexpr int ValueToIndex(int value, const int* const table, unsigned int maxIndex)
{
if(nullptr == table)
*/
const FontSlant::Type IntToSlantType(int slant);
+const std::string_view DefaultFontFamily();
const FontWidth::Type DefaultFontWidth();
const FontWeight::Type DefaultFontWeight();
const FontSlant::Type DefaultFontSlant();
} // namespace Dali::TextAbstraction::Internal
-#endif // DALI_TEST_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
+#endif // DALI_TEXT_ABSTRACTION_INTERNAL_FONT_CLIENT_UTILS_H
}
} // namespace
-FontFaceCacheItem::FontFaceCacheItem(FT_Library& freeTypeLibrary,
+FontFaceCacheItem::FontFaceCacheItem(const FT_Library& freeTypeLibrary,
FT_Face ftFace,
const FontPath& path,
PointSize26Dot6 requestedPointSize,
{
}
-FontFaceCacheItem::FontFaceCacheItem(FT_Library& freeTypeLibrary,
+FontFaceCacheItem::FontFaceCacheItem(const FT_Library& freeTypeLibrary,
FT_Face ftFace,
const FontPath& path,
PointSize26Dot6 requestedPointSize,
-#ifndef DALI_TEST_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
-#define DALI_TEST_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
+#ifndef DALI_TEXT_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
+#define DALI_TEXT_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
/*
* Copyright (c) 2022 Samsung Electronics Co., Ltd.
*/
struct FontFaceCacheItem : public FontCacheItemInterface
{
- FontFaceCacheItem(FT_Library& freeTypeLibrary,
+ FontFaceCacheItem(const FT_Library& freeTypeLibrary,
FT_Face ftFace,
const FontPath& path,
PointSize26Dot6 requestedPointSize,
FaceIndex face,
const FontMetrics& metrics);
- FontFaceCacheItem(FT_Library& freeTypeLibrary,
+ FontFaceCacheItem(const FT_Library& freeTypeLibrary,
FT_Face ftFace,
const FontPath& path,
PointSize26Dot6 requestedPointSize,
}
public:
- FT_Library& mFreeTypeLibrary; ///< A handle to a FreeType library instance.
- FT_Face mFreeTypeFace; ///< The FreeType face.
+ const FT_Library& mFreeTypeLibrary; ///< A handle to a FreeType library instance.
+ FT_Face mFreeTypeFace; ///< The FreeType face.
std::unique_ptr<GlyphCacheManager> mGlyphCacheManager; ///< The glyph cache manager. It will cache this face's glyphs.
std::unique_ptr<HarfBuzzProxyFont> mHarfBuzzProxyFont; ///< The harfbuzz font. It will store harfbuzz relate data.
} // namespace Dali::TextAbstraction::Internal
-#endif //DALI_TEST_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
+#endif //DALI_TEXT_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
#define DALI_INTERNAL_TEXT_ABSTRACTION_PLUGIN_PIXEL_BUFFER_CACHE_ITEM_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.
{
Devel::PixelBuffer pixelBuffer; ///< The pixel buffer loaded from the url.
std::string url; ///< The url.
+ PixelBufferId id; ///< The id of this item. Should be bigger than 0.
};
} // namespace Dali::TextAbstraction::Internal
/*
- * 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.
return mPlugin.GetMarkerInfo(marker, startFrame, endFrame);
}
-void VectorAnimationRenderer::IgnoreRenderedFrame()
+void VectorAnimationRenderer::InvalidateBuffer()
{
- mPlugin.IgnoreRenderedFrame();
+ mPlugin.InvalidateBuffer();
}
Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_IMPL_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.
bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
/**
- * @copydoc Dali::VectorAnimationRenderer::IgnoreRenderedFrame()
+ * @copydoc Dali::VectorAnimationRenderer::InvalidateBuffer()
*/
- void IgnoreRenderedFrame();
+ void InvalidateBuffer();
/**
* @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal()
/*
- * 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.
{
mPlugin->GetDefaultSize(width, height);
}
+ else
+ {
+ width = 0;
+ height = 0;
+ }
}
void VectorAnimationRendererPluginProxy::GetLayerInfo(Property::Map& map) const
return false;
}
-void VectorAnimationRendererPluginProxy::IgnoreRenderedFrame()
+void VectorAnimationRendererPluginProxy::InvalidateBuffer()
{
if(mPlugin)
{
- mPlugin->IgnoreRenderedFrame();
+ mPlugin->InvalidateBuffer();
}
}
#define DALI_INTERNAL_VECTOR_ANIMATION_RENDERER_PLUGIN_PROXY_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.
bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const;
/**
- * @copydoc Dali::VectorAnimationRendererPlugin::IgnoreRenderedFrame()
+ * @copydoc Dali::VectorAnimationRendererPlugin::InvalidateBuffer()
*/
- void IgnoreRenderedFrame();
+ void InvalidateBuffer();
/**
* @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal()
VectorImageRenderer::~VectorImageRenderer()
{
+ Mutex::ScopedLock lock(mMutex);
#ifdef THORVG_SUPPORT
//NOTE: Initializer::term() will call clear() internally.
bool VectorImageRenderer::Load(const Vector<uint8_t>& data, float dpi)
{
+ Mutex::ScopedLock lock(mMutex);
#ifdef THORVG_SUPPORT
if(!mSwCanvas)
{
Dali::Devel::PixelBuffer VectorImageRenderer::Rasterize(uint32_t width, uint32_t height)
{
+ Mutex::ScopedLock lock(mMutex);
+
if(width == 0)
{
if(mDefaultWidth == 0)
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/threading/mutex.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/connection-tracker.h>
+
#ifdef THORVG_SUPPORT
#include <thorvg.h>
#endif
NSVGimage* mParsedImage{nullptr};
NSVGrasterizer* mRasterizer{nullptr};
#endif
- uint32_t mDefaultWidth{0}; ///< The default width of the file
- uint32_t mDefaultHeight{0}; ///< The default height of the file
+ Dali::Mutex mMutex{}; ///< The mutex
+ uint32_t mDefaultWidth{0}; ///< The default width of the file
+ uint32_t mDefaultHeight{0}; ///< The default height of the file
};
} // namespace Adaptor
/*
- * 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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
-#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
-#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
-#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
#include <dali/internal/system/common/environment-variables.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/images/pixel-data.h>
#define DALI_WEB_ENGINE_IMPL_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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
-#include <dali/devel-api/adaptor-framework/web-engine.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine.h>
namespace Dali
{
{
Uint16Pair newSize(newRect.width, newRect.height);
+ mWindowWidth = newRect.width;
+ mWindowHeight = newRect.height;
+
SurfaceResized();
mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
{
const unsigned int ADAPTOR_MAJOR_VERSION = 2;
const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 30;
+const unsigned int ADAPTOR_MICRO_VERSION = 31;
const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 2.1.30
+Version: 2.1.31
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT