[dali_2.1.31] Merge branch 'devel/master' 75/277975/1
authorRichard Huang <r.huang@samsung.com>
Fri, 15 Jul 2022 12:17:27 +0000 (13:17 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 15 Jul 2022 12:17:27 +0000 (13:17 +0100)
Change-Id: Icea15eb7e35cb61d8809b830505a461471c4317e

141 files changed:
automated-tests/resources/gallery-small-1-yuv411.jpg [new file with mode: 0644]
automated-tests/resources/gallery-small-1-yuv420.jpg [new file with mode: 0644]
automated-tests/resources/gallery-small-1-yuv422.jpg [new file with mode: 0644]
automated-tests/resources/gallery-small-1-yuv440.jpg [new file with mode: 0644]
automated-tests/resources/gallery-small-1-yuv444.jpg [new file with mode: 0644]
automated-tests/resources/lake_front.jpg [deleted file]
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.cpp [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.h [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-compare-types.h
automated-tests/src/dali-adaptor/utc-Dali-ImageLoading.cpp
build/tizen/CMakeLists.txt
dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.cpp with 91% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-drawable-group.h with 93% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-drawable.cpp with 94% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-drawable.h with 97% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-gradient.cpp with 92% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-gradient.h with 96% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.cpp with 91% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h with 94% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-picture.cpp with 91% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-picture.h with 93% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.cpp with 91% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h with 93% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer-shape.cpp with 97% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h [moved from dali/devel-api/adaptor-framework/canvas-renderer-shape.h with 98% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.cpp [moved from dali/devel-api/adaptor-framework/canvas-renderer.cpp with 94% similarity]
dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h [moved from dali/devel-api/adaptor-framework/canvas-renderer.h with 98% similarity]
dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list-item.h [moved from dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h with 97% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h [moved from dali/devel-api/adaptor-framework/web-engine-back-forward-list.h with 96% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h [moved from dali/devel-api/adaptor-framework/web-engine-certificate.h with 97% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h [moved from dali/devel-api/adaptor-framework/web-engine-console-message.h with 97% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h [moved from dali/devel-api/adaptor-framework/web-engine-context-menu-item.h with 99% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h [moved from dali/devel-api/adaptor-framework/web-engine-context-menu.h with 95% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-context.h [moved from dali/devel-api/adaptor-framework/web-engine-context.h with 98% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h [moved from dali/devel-api/adaptor-framework/web-engine-cookie-manager.h with 98% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-form-repost-decision.h [moved from dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h with 95% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-frame.h [moved from dali/devel-api/adaptor-framework/web-engine-frame.h with 95% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h [moved from dali/devel-api/adaptor-framework/web-engine-hit-test.h with 98% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h [moved from dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h with 97% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h [moved from dali/devel-api/adaptor-framework/web-engine-load-error.h with 98% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h [moved from dali/devel-api/adaptor-framework/web-engine-plugin.h with 99% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h [moved from dali/devel-api/adaptor-framework/web-engine-policy-decision.h with 98% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h [moved from dali/devel-api/adaptor-framework/web-engine-request-interceptor.h with 100% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-security-origin.h [moved from dali/devel-api/adaptor-framework/web-engine-security-origin.h with 96% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h [moved from dali/devel-api/adaptor-framework/web-engine-settings.h with 99% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine.cpp [moved from dali/devel-api/adaptor-framework/web-engine.cpp with 93% similarity]
dali/devel-api/adaptor-framework/web-engine/web-engine.h [moved from dali/devel-api/adaptor-framework/web-engine.h with 99% similarity]
dali/devel-api/atspi-interfaces/socket.h
dali/devel-api/file.list
dali/devel-api/text-abstraction/font-client.cpp
dali/devel-api/text-abstraction/font-client.h
dali/internal/accessibility/bridge/accessibility-common.h
dali/internal/accessibility/bridge/bridge-accessible.cpp
dali/internal/accessibility/bridge/bridge-base.cpp
dali/internal/accessibility/bridge/bridge-base.h
dali/internal/accessibility/bridge/bridge-component.cpp
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/accessibility/bridge/bridge-object.cpp
dali/internal/accessibility/bridge/bridge-socket.cpp
dali/internal/accessibility/bridge/bridge-socket.h
dali/internal/accessibility/bridge/dbus/dbus-locators.h [moved from dali/internal/accessibility/bridge/dbus-locators.h with 100% similarity]
dali/internal/accessibility/bridge/dbus/dbus-tizen.cpp [moved from dali/internal/accessibility/bridge/dbus-tizen.cpp with 97% similarity]
dali/internal/accessibility/bridge/dbus/dbus.h [moved from dali/internal/accessibility/bridge/dbus.h with 99% similarity]
dali/internal/accessibility/bridge/dummy/dummy-atspi.cpp [moved from dali/internal/accessibility/bridge/dummy-atspi.cpp with 93% similarity]
dali/internal/accessibility/bridge/dummy/dummy-atspi.h [moved from dali/internal/accessibility/bridge/dummy-atspi.h with 93% similarity]
dali/internal/accessibility/file.list [changed mode: 0755->0644]
dali/internal/canvas-renderer/common/canvas-renderer-factory.h
dali/internal/canvas-renderer/common/canvas-renderer-impl.h
dali/internal/canvas-renderer/common/drawable-factory.h
dali/internal/canvas-renderer/common/drawable-group-factory.h
dali/internal/canvas-renderer/common/drawable-group-impl.h
dali/internal/canvas-renderer/common/drawable-impl.h
dali/internal/canvas-renderer/common/gradient-factory.h
dali/internal/canvas-renderer/common/gradient-impl.h
dali/internal/canvas-renderer/common/linear-gradient-factory.h
dali/internal/canvas-renderer/common/linear-gradient-impl.h
dali/internal/canvas-renderer/common/picture-factory.h
dali/internal/canvas-renderer/common/picture-impl.h
dali/internal/canvas-renderer/common/radial-gradient-factory.h
dali/internal/canvas-renderer/common/radial-gradient-impl.h
dali/internal/canvas-renderer/common/shape-factory.h
dali/internal/canvas-renderer/common/shape-impl.h
dali/internal/canvas-renderer/generic/canvas-renderer-impl-generic.h
dali/internal/canvas-renderer/generic/drawable-group-impl-generic.h
dali/internal/canvas-renderer/generic/drawable-impl-generic.h
dali/internal/canvas-renderer/generic/gradient-impl-generic.h
dali/internal/canvas-renderer/generic/linear-gradient-impl-generic.h
dali/internal/canvas-renderer/generic/picture-impl-generic.h
dali/internal/canvas-renderer/generic/radial-gradient-impl-generic.h
dali/internal/canvas-renderer/generic/shape-impl-generic.h
dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.h
dali/internal/canvas-renderer/tizen/drawable-group-impl-tizen.h
dali/internal/canvas-renderer/tizen/drawable-impl-tizen.h
dali/internal/canvas-renderer/tizen/gradient-impl-tizen.h
dali/internal/canvas-renderer/tizen/linear-gradient-impl-tizen.h
dali/internal/canvas-renderer/tizen/picture-impl-tizen.h
dali/internal/canvas-renderer/tizen/radial-gradient-impl-tizen.h
dali/internal/canvas-renderer/tizen/shape-impl-tizen.h
dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/drawable-group-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/drawable-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/gradient-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/linear-gradient-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/picture-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/radial-gradient-impl-ubuntu.h
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.h
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/gles-graphics-types.h
dali/internal/imaging/common/loader-jpeg-turbo.cpp
dali/internal/system/tizen-wayland/widget-controller-tizen.cpp
dali/internal/text/file.list
dali/internal/text/text-abstraction/font-client-impl.cpp
dali/internal/text/text-abstraction/font-client-impl.h
dali/internal/text/text-abstraction/plugin/bitmap-font-cache-item.cpp
dali/internal/text/text-abstraction/plugin/bitmap-font-cache-item.h
dali/internal/text/text-abstraction/plugin/embedded-item.h
dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.cpp [new file with mode: 0644]
dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.h [new file with mode: 0644]
dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp
dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.h
dali/internal/text/text-abstraction/plugin/font-client-utils.cpp
dali/internal/text/text-abstraction/plugin/font-client-utils.h
dali/internal/text/text-abstraction/plugin/font-face-cache-item.cpp
dali/internal/text/text-abstraction/plugin/font-face-cache-item.h
dali/internal/text/text-abstraction/plugin/pixel-buffer-cache-item.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h
dali/internal/vector-image/common/vector-image-renderer-impl.cpp
dali/internal/vector-image/common/vector-image-renderer-impl.h
dali/internal/web-engine/common/web-engine-impl.cpp
dali/internal/web-engine/common/web-engine-impl.h
dali/internal/window-system/common/window-impl.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

diff --git a/automated-tests/resources/gallery-small-1-yuv411.jpg b/automated-tests/resources/gallery-small-1-yuv411.jpg
new file mode 100644 (file)
index 0000000..f53b86b
Binary files /dev/null and b/automated-tests/resources/gallery-small-1-yuv411.jpg differ
diff --git a/automated-tests/resources/gallery-small-1-yuv420.jpg b/automated-tests/resources/gallery-small-1-yuv420.jpg
new file mode 100644 (file)
index 0000000..c1362a6
Binary files /dev/null and b/automated-tests/resources/gallery-small-1-yuv420.jpg differ
diff --git a/automated-tests/resources/gallery-small-1-yuv422.jpg b/automated-tests/resources/gallery-small-1-yuv422.jpg
new file mode 100644 (file)
index 0000000..abb6fa2
Binary files /dev/null and b/automated-tests/resources/gallery-small-1-yuv422.jpg differ
diff --git a/automated-tests/resources/gallery-small-1-yuv440.jpg b/automated-tests/resources/gallery-small-1-yuv440.jpg
new file mode 100644 (file)
index 0000000..8a435e7
Binary files /dev/null and b/automated-tests/resources/gallery-small-1-yuv440.jpg differ
diff --git a/automated-tests/resources/gallery-small-1-yuv444.jpg b/automated-tests/resources/gallery-small-1-yuv444.jpg
new file mode 100644 (file)
index 0000000..cac624f
Binary files /dev/null and b/automated-tests/resources/gallery-small-1-yuv444.jpg differ
diff --git a/automated-tests/resources/lake_front.jpg b/automated-tests/resources/lake_front.jpg
deleted file mode 100644 (file)
index 470a679..0000000
Binary files a/automated-tests/resources/lake_front.jpg and /dev/null differ
index dc7415b..2c1668b 100644 (file)
@@ -45,6 +45,7 @@ LIST(APPEND TC_SOURCES
     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
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.cpp
new file mode 100644 (file)
index 0000000..4693dd6
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/adaptor-environment-variable.h
new file mode 100644 (file)
index 0000000..a955f5f
--- /dev/null
@@ -0,0 +1,36 @@
+#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
index d917107..fcadd6f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -111,109 +111,4 @@ inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsil
          (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
index 12af8b0..2e4a8b5 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+#include <adaptor-environment-variable.h>
 #include <dali-test-img-utils.h>
 #include <dali-test-suite-utils.h>
 
@@ -34,8 +35,16 @@ const char* IMAGE_128_RGB = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
 // 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";
@@ -424,14 +433,85 @@ int UtcDaliDownloadImageN(void)
 
 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();
@@ -445,13 +525,6 @@ int UtcDaliLoadImagePlanesFromFileP(void)
 
   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;
 }
 
index 70cea5c..8b0cb56 100644 (file)
@@ -277,6 +277,8 @@ SET( tizenadaptordevelapidir ${INCLUDE_DIR}/dali/devel-api )
 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 )
@@ -291,6 +293,8 @@ INSTALL( FILES ${public_api_header_files} DESTINATION ${tizenadaptorpublicapidir
 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} )
 
index 1b59436..43d2a55 100644 (file)
@@ -36,6 +36,7 @@ namespace Dali
 namespace Accessibility
 {
 class Accessible;
+class ProxyAccessible;
 
 /**
  * @brief Base class for different accessibility bridges.
@@ -401,6 +402,48 @@ struct DALI_ADAPTOR_API Bridge
   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
@@ -435,6 +478,16 @@ struct DALI_ADAPTOR_API Bridge
    */
   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;
@@ -463,6 +516,7 @@ protected:
     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;
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+* Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+* Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
index 002fa99..8569640 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -132,9 +132,10 @@ public:
   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.
index b0c4825..47d6368 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -103,9 +103,9 @@ bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t&
   return GetImplementation(*this).GetMarkerInfo(marker, startFrame, endFrame);
 }
 
-void VectorAnimationRenderer::IgnoreRenderedFrame()
+void VectorAnimationRenderer::InvalidateBuffer()
 {
-  GetImplementation(*this).IgnoreRenderedFrame();
+  GetImplementation(*this).InvalidateBuffer();
 }
 
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
index f493b6b..956dc94 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -163,9 +163,10 @@ public:
   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
   /**
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -25,8 +25,8 @@
 #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
 {
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -27,7 +27,7 @@
 
 // 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>
 
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -2,7 +2,7 @@
 #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.
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // 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
@@ -2,7 +2,7 @@
 #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.
@@ -23,7 +23,7 @@
 
 //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
index 0e74694..34bd45e 100644 (file)
@@ -48,6 +48,14 @@ public:
   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
index 89cb0a9..c332a7e 100755 (executable)
@@ -1,20 +1,21 @@
 
 
 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
@@ -45,7 +46,6 @@ SET( devel_api_src_files
   ${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
@@ -63,14 +63,6 @@ SET( devel_api_adaptor_framework_header_files
   ${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
@@ -105,25 +97,6 @@ SET( devel_api_adaptor_framework_header_files
   ${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
@@ -140,6 +113,41 @@ SET( devel_api_adaptor_framework_header_files
 )
 
 
+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
index 704469c..a778346 100644 (file)
@@ -643,14 +643,14 @@ void FontClient::GetSystemFonts(FontList& systemFonts)
   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)
index e21f3e6..0644ddf 100644 (file)
@@ -138,16 +138,16 @@ public:
      */
     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.
   };
 
   /**
@@ -262,21 +262,21 @@ public:
   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.
index 4f61522..e77281d 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -26,8 +26,8 @@
 
 // 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
index a7ecf8e..0a0d5a5 100644 (file)
@@ -266,29 +266,6 @@ static std::string MakeIndent(unsigned int maxRecursionDepth)
   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)
 {
@@ -355,11 +332,6 @@ static bool CheckChainEndWithAttribute(Accessible* obj, unsigned char forward)
   return false;
 }
 
-static Accessible* GetDeputyOfProxyInParent(Accessible* obj)
-{
-  return nullptr;
-}
-
 static std::vector<Component*> GetScrollableParents(Accessible* accessible)
 {
   std::vector<Component*> scrollableParents;
@@ -627,6 +599,10 @@ DBus::ValueOrError<Accessible*, uint8_t, Accessible*> BridgeAccessible::GetNavig
   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;
@@ -742,6 +718,10 @@ Accessible* BridgeAccessible::GetNextNonDefunctSibling(Accessible* obj, Accessib
   {
     return nullptr;
   }
+  else if(parent->IsProxy())
+  {
+    return parent;
+  }
 
   auto children = GetValidChildren(parent->GetChildren(), start);
   SortChildrenFromTopLeft(children);
@@ -813,9 +793,7 @@ Accessible* BridgeAccessible::CalculateNeighbor(Accessible* root, Accessible* st
 
   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;
@@ -876,17 +854,6 @@ Accessible* BridgeAccessible::CalculateNeighbor(Accessible* root, Accessible* st
     }
 
     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;
@@ -895,27 +862,6 @@ Accessible* BridgeAccessible::CalculateNeighbor(Accessible* root, Accessible* st
     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;
     }
@@ -949,9 +895,8 @@ Accessible* BridgeAccessible::CalculateNeighbor(Accessible* root, Accessible* st
 
 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)
index 9b920d8..261d5f4 100644 (file)
@@ -40,54 +40,65 @@ BridgeBase::~BridgeBase()
   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()
index 2449842..5ab2a03 100644 (file)
@@ -23,6 +23,7 @@
 #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
   {
@@ -80,6 +87,11 @@ public:
 
   size_t GetIndexInParent() override
   {
+    if(mIsEmbedded)
+    {
+      return 0u;
+    }
+
     throw std::domain_error{"can't call GetIndexInParent on application object"};
   }
 
@@ -90,7 +102,14 @@ public:
 
   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
@@ -147,6 +166,8 @@ public:
     return {"", "root"};
   }
 
+  // Application
+
   std::string GetToolkitName() const override
   {
     return mToolkitName;
@@ -156,23 +177,119 @@ public:
   {
     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);
   }
@@ -184,25 +301,25 @@ struct hash<std::pair<FilteredEvents, Dali::Accessibility::Accessible*>>
  */
 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.
index 2a297f5..ef0ff0f 100644 (file)
@@ -65,12 +65,20 @@ DBus::ValueOrError<Accessible*> BridgeComponent::GetAccessibleAtPoint(int32_t x,
 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)};
 }
 
index 4cde992..afd3a96 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
 // 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>
@@ -40,7 +41,7 @@
 #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>
 
@@ -84,6 +85,7 @@ class BridgeImpl : public virtual BridgeBase,
   Dali::Timer                                                   mReadIsEnabledTimer;
   Dali::Timer                                                   mReadScreenReaderEnabledTimer;
   Dali::Timer                                                   mForceUpTimer;
+  std::string                                                   mPreferredBusName;
 
 public:
   BridgeImpl()
@@ -227,6 +229,7 @@ public:
 
       mDisabledSignal.Emit();
       UnembedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
+      ReleaseBusName(mPreferredBusName);
     }
 
     mHighlightedActor     = {};
@@ -352,6 +355,8 @@ public:
       }
     });
 
+    RequestBusName(mPreferredBusName);
+
     auto parentAddress = EmbedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
     mApplication.mParent.SetAddress(std::move(parentAddress));
     mEnabledSignal.Emit();
@@ -712,11 +717,66 @@ public:
     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
@@ -816,3 +876,23 @@ void Bridge::EnableAutoInit()
     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();
+}
index 6490166..26b697c 100644 (file)
@@ -224,7 +224,7 @@ void BridgeObject::EmitBoundsChanged(Accessible* obj, Dali::Rect<> rect)
   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),
index fdbae8c..621a433 100644 (file)
@@ -26,6 +26,7 @@ void BridgeSocket::RegisterInterfaces()
 
   AddFunctionToInterface(desc, "Embed", &BridgeSocket::Embed);
   AddFunctionToInterface(desc, "Unembed", &BridgeSocket::Unembed);
+  AddFunctionToInterface(desc, "SetOffset", &BridgeSocket::SetOffset);
 
   mDbusServer.addInterface("/", desc, true);
 }
@@ -45,3 +46,9 @@ DBus::ValueOrError<void> BridgeSocket::Unembed(Address plug)
   FindSelf()->Unembed(plug);
   return {};
 }
+
+DBus::ValueOrError<void> BridgeSocket::SetOffset(std::int32_t x, std::int32_t y)
+{
+  FindSelf()->SetOffset(x, y);
+  return {};
+}
index 6034700..f39671c 100644 (file)
@@ -52,6 +52,11 @@ public:
    * @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
@@ -16,7 +16,7 @@
 
 // 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>
@@ -169,6 +169,16 @@ std::string DBus::getConnectionName(const DBusWrapper::ConnectionPtr& c)
   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);
@@ -544,6 +554,16 @@ struct DefaultDBusWrapper : public DBusWrapper
     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;
similarity index 99%
rename from dali/internal/accessibility/bridge/dbus.h
rename to dali/internal/accessibility/bridge/dbus/dbus.h
index d43c009..c23cd53 100644 (file)
@@ -125,6 +125,8 @@ struct DALI_ADAPTOR_API DBusWrapper
   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
   {
@@ -2699,6 +2701,8 @@ private:
 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
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
 #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
 {
@@ -84,6 +84,11 @@ void Accessibility::Bridge::EnableAutoInit()
 {
 }
 
+std::string MakeBusNameForWidget(std::string_view widgetInstanceId)
+{
+  return std::string{widgetInstanceId};
+}
+
 void Accessibility::Accessible::EmitStateChanged(Accessibility::State state, int newValue, int reserved)
 {
 }
@@ -2,7 +2,7 @@
 #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.
@@ -193,6 +193,18 @@ struct DummyBridge : Dali::Accessibility::Bridge
   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
old mode 100755 (executable)
new mode 100644 (file)
index 14a6ba8..c7fbade
@@ -65,11 +65,11 @@ SET( adaptor_accessibility_atspi_bridge_src_files
     ${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
index bc58d3d..dbe7fb7 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
 
 namespace Dali
 {
index 5afb7bd..ffe9a7c 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -23,8 +23,8 @@
 #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
 {
index 8a1acfe..ff5994f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index 44229f8..052128e 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index dbfd0fd..d177a00 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -23,7 +23,7 @@
 #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
index 811a0d3..8177eff 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
 {
index 3fa7b9f..e5eabbb 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index b422114..aee428c 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
 {
index 93e6c4d..49cd985 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index b91a538..3cfa457 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 2a32581..80449a6 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index ed4aa59..1e96ffa 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 7d49ddb..4276c05 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index 19176b7..be28231 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 7c2d22b..d13ab05 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
index 1aecdf7..b5d9a6a 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
index 5b3e9b8..3c7d920 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
index d14a676..0ff36f8 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 0f65e17..9ea4b22 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
index 1f58daf..82d9143 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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>
 
index 7cb48a8..bfbc41d 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 983478d..3ed0c36 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 0d87c45..2b9f148 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index 630a9e6..8a4aa6a 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
index b200585..a7fbda7 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -27,8 +27,8 @@
 #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>
index fccc857..16bfa41 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -26,7 +26,7 @@
 #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
index b37ae2d..970c150 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,8 +25,8 @@
 #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>
 
index 717a948..cf9aba4 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,8 +25,8 @@
 #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>
 
index 74b79fb..0d1dd35 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -26,7 +26,7 @@
 #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
index 3ceae49..5bfd62c 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index 430dfe5..61b4f64 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index 3c43c48..5272fa0 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index 2436d82..e766d12 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -27,8 +27,8 @@
 #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>
index 5652501..9efae26 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -26,7 +26,7 @@
 #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
index 742ff74..81177ea 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,8 +25,8 @@
 #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>
 
index 02d3196..d13e685 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,8 +25,8 @@
 #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>
 
index d735328..97b5b3f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -26,7 +26,7 @@
 #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
index 3c2f796..42ae8fb 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index efee704..929cb00 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index a459a35..36b9267 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -25,7 +25,7 @@
 #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
index d7b8d33..2456deb 100644 (file)
@@ -316,7 +316,10 @@ void EglGraphicsController::ActivateResourceContext()
   if(!mSharedContext)
   {
     auto eglGraphics = dynamic_cast<Dali::Internal::Adaptor::EglGraphics*>(mGraphics);
-    mSharedContext   = eglGraphics->GetEglImplementation().GetContext();
+    if(eglGraphics)
+    {
+      mSharedContext = eglGraphics->GetEglImplementation().GetContext();
+    }
   }
 }
 
index dc90a98..836439d 100644 (file)
@@ -210,35 +210,11 @@ struct GLTextureFormatType
 
       // 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);
@@ -349,35 +325,11 @@ struct GLTextureFormatType
 
       // 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);
@@ -386,160 +338,40 @@ struct GLTextureFormatType
 
       // 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);
@@ -552,75 +384,19 @@ struct GLTextureFormatType
         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);
@@ -632,75 +408,23 @@ struct GLTextureFormatType
         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);
@@ -712,10 +436,6 @@ struct GLTextureFormatType
         break;
       }
       case Graphics::Format::B10G11R11_UFLOAT_PACK32:
-      {
-        Assign(0, 0);
-        break;
-      }
       case Graphics::Format::E5B9G9R9_UFLOAT_PACK32:
       {
         Assign(0, 0);
@@ -739,10 +459,6 @@ struct GLTextureFormatType
         break;
       }
       case Graphics::Format::S8_UINT:
-      {
-        Assign(0, 0);
-        break;
-      }
       case Graphics::Format::D16_UNORM_S8_UINT:
       {
         Assign(0, 0);
@@ -760,80 +476,20 @@ struct GLTextureFormatType
         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);
@@ -1078,30 +734,10 @@ struct GLTextureFormatType
         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);
index dc39f24..5af46e6 100644 (file)
@@ -36,6 +36,7 @@
 #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>
@@ -50,6 +51,18 @@ const unsigned int DECODED_L8       = 1;
 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
@@ -74,6 +87,22 @@ struct JpegErrorState
   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.
@@ -819,8 +848,8 @@ bool DecodeJpeg(const Dali::ImageLoader::Input& input, std::vector<Dali::Devel::
 
   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];
 
index efe9f16..5e03ef1 100644 (file)
 #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
@@ -65,8 +70,18 @@ void WidgetImplTizen::SetUsingKeyEvent(bool flag)
 
 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
index 867fb26..4d04419 100644 (file)
@@ -11,6 +11,7 @@ SET( adaptor_text_common_src_files
     ${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
index 0656765..1a13802 100644 (file)
@@ -152,18 +152,18 @@ void FontClient::GetDefaultPlatformFontDescription(FontDescription& fontDescript
   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)
@@ -246,10 +246,10 @@ FontId FontClient::GetFontId(const FontPath& path, PointSize26Dot6 requestedPoin
 {
   CreatePlugin();
 
-  return mPlugin->GetFontId(path,
-                            requestedPointSize,
-                            faceIndex,
-                            true);
+  return mPlugin->GetFontIdByPath(path,
+                                  requestedPointSize,
+                                  faceIndex,
+                                  true);
 }
 
 FontId FontClient::GetFontId(const FontDescription& fontDescription,
index 7b158ef..d93a053 100644 (file)
@@ -106,12 +106,12 @@ public: // API for Dali::TextAbstraction::FontClient used.
   /**
    * @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()
index 972f323..248bf82 100644 (file)
@@ -27,9 +27,10 @@ extern Dali::Integration::Log::Filter* gFontClientLogFilter;
 
 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());
index 1799eb2..c763c84 100644 (file)
@@ -39,7 +39,7 @@ struct BitmapFontCacheItem : public FontCacheItemInterface
    * @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
index 9785a6d..4f58b8b 100644 (file)
@@ -1,8 +1,8 @@
-#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.
@@ -29,6 +29,12 @@ namespace Dali::TextAbstraction::Internal
  */
 struct EmbeddedItem
 {
+  // Default constructor.
+  EmbeddedItem() = default;
+
+  // Default destructor.
+  ~EmbeddedItem() = default;
+
   /**
    * Get metrics for glyph from image
    * @param[in] item The embedded image
@@ -45,11 +51,12 @@ struct EmbeddedItem
   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
diff --git a/dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.cpp b/dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.cpp
new file mode 100644 (file)
index 0000000..acaec1d
--- /dev/null
@@ -0,0 +1,984 @@
+/*
+ * 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
diff --git a/dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.h b/dali/internal/text/text-abstraction/plugin/font-client-plugin-cache-handler.h
new file mode 100644 (file)
index 0000000..740ac51
--- /dev/null
@@ -0,0 +1,419 @@
+#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
index 4ac6bd0..f119b5e 100644 (file)
 
 // 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>
@@ -82,33 +81,16 @@ namespace
 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
  *
@@ -227,59 +209,17 @@ int SearchOnProperPointSize(FT_Face& ftFace, const unsigned int& horizontalDpi,
   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)
@@ -294,58 +234,19 @@ FontClient::Plugin::Plugin(unsigned int horizontalDpi,
 
 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,
@@ -355,249 +256,59 @@ 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;
@@ -608,7 +319,7 @@ void FontClient::Plugin::GetDescription(FontId           id,
       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:
@@ -620,16 +331,16 @@ void FontClient::Plugin::GetDescription(FontId           id,
     }
   }
 
-  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();
@@ -639,7 +350,7 @@ PointSize26Dot6 FontClient::Plugin::GetPointSize(FontId id)
   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);
@@ -656,21 +367,20 @@ bool FontClient::Plugin::IsCharacterSupportedByFont(FontId fontId, Character cha
   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:
       {
@@ -685,7 +395,7 @@ FontId FontClient::Plugin::FindFontForCharacter(const FontList&         fontList
                                                 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);
@@ -721,10 +431,9 @@ FontId FontClient::Plugin::FindFontForCharacter(const FontList&         fontList
 
       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;
         }
@@ -746,7 +455,7 @@ FontId FontClient::Plugin::FindFontForCharacter(const FontList&         fontList
 
 FontId FontClient::Plugin::FindDefaultFont(Character       charcode,
                                            PointSize26Dot6 requestedPointSize,
-                                           bool            preferColor)
+                                           bool            preferColor) const
 {
   DALI_LOG_TRACE_METHOD(gFontClientLogFilter);
   FONT_LOG_REQUEST(charcode, requestedPointSize, preferColor);
@@ -754,21 +463,12 @@ FontId FontClient::Plugin::FindDefaultFont(Character       charcode,
   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;
@@ -777,7 +477,7 @@ FontId FontClient::Plugin::FindDefaultFont(Character       charcode,
 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);
@@ -788,7 +488,7 @@ FontId FontClient::Plugin::FindFallbackFont(Character              charcode,
   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);
@@ -803,30 +503,9 @@ FontId FontClient::Plugin::FindFallbackFont(Character              charcode,
   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)
@@ -838,10 +517,10 @@ FontId FontClient::Plugin::FindFallbackFont(Character              charcode,
   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());
@@ -852,7 +531,7 @@ FontId FontClient::Plugin::GetFontId(const FontPath& path,
   if(nullptr != mFreeTypeLibrary)
   {
     FontId foundId = 0u;
-    if(FindFont(path, requestedPointSize, faceIndex, foundId))
+    if(mCacheHandler->FindFontByPath(path, requestedPointSize, faceIndex, foundId))
     {
       id = foundId;
     }
@@ -868,15 +547,15 @@ FontId FontClient::Plugin::GetFontId(const FontPath& path,
 
 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,
@@ -908,7 +587,7 @@ FontId FontClient::Plugin::GetFontId(const FontDescription& fontDescription,
   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;
   }
@@ -916,120 +595,55 @@ FontId FontClient::Plugin::GetFontId(const FontDescription& fontDescription,
   // 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)
@@ -1039,7 +653,7 @@ void FontClient::Plugin::GetFontMetrics(FontId       fontId,
 }
 
 GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId    fontId,
-                                             Character charcode)
+                                             Character charcode) const
 {
   const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
   if(fontCacheItem != nullptr)
@@ -1052,7 +666,7 @@ GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId    fontId,
 
 GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId    fontId,
                                              Character charcode,
-                                             Character variantSelector)
+                                             Character variantSelector) const
 {
   const FontCacheItemInterface* fontCacheItem = GetCachedFontItem(fontId);
   if(fontCacheItem != nullptr)
@@ -1066,7 +680,7 @@ GlyphIndex FontClient::Plugin::GetGlyphIndex(FontId    fontId,
 bool FontClient::Plugin::GetGlyphMetrics(GlyphInfo* array,
                                          uint32_t   size,
                                          GlyphType  type,
-                                         bool       horizontal)
+                                         bool       horizontal) const
 {
   if(VECTOR_GLYPH == type)
   {
@@ -1078,9 +692,9 @@ bool FontClient::Plugin::GetGlyphMetrics(GlyphInfo* array,
 
 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)
   {
@@ -1089,13 +703,16 @@ bool FontClient::Plugin::GetBitmapMetrics(GlyphInfo* array,
     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;
     }
   }
 
@@ -1104,7 +721,7 @@ bool FontClient::Plugin::GetBitmapMetrics(GlyphInfo* array,
 
 bool FontClient::Plugin::GetVectorMetrics(GlyphInfo* array,
                                           uint32_t   size,
-                                          bool       horizontal)
+                                          bool       horizontal) const
 {
 #ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
   bool success(true);
@@ -1114,9 +731,9 @@ bool FontClient::Plugin::GetVectorMetrics(GlyphInfo* array,
     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)
       {
@@ -1145,7 +762,7 @@ bool FontClient::Plugin::GetVectorMetrics(GlyphInfo* array,
 #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;
@@ -1154,19 +771,34 @@ void FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex, bool
   {
     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,
@@ -1175,74 +807,69 @@ PixelData FontClient::Plugin::CreateBitmap(FontId fontId, GlyphIndex glyphIndex,
                         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)
@@ -1252,13 +879,12 @@ FT_FaceRec_* FontClient::Plugin::GetFreetypeFace(FontId fontId)
   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;
 }
@@ -1269,7 +895,7 @@ bool FontClient::Plugin::AddCustomFontDirectory(const FontPath& path)
   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)
@@ -1279,7 +905,7 @@ HarfBuzzFontHandle FontClient::Plugin::GetHarfBuzzFont(FontId fontId)
   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;
 
@@ -1292,43 +918,17 @@ GlyphIndex FontClient::Plugin::CreateEmbeddedItem(const TextAbstraction::FontCli
   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)
@@ -1350,22 +950,12 @@ GlyphIndex FontClient::Plugin::CreateEmbeddedItem(const TextAbstraction::FontCli
   }
 
   // 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)
@@ -1414,165 +1004,16 @@ uint32_t FontClient::Plugin::GetNumberOfPointsPerOneUnitOfPointSize() const
   ;
 }
 
-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;
@@ -1587,7 +1028,6 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
     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"));
@@ -1641,23 +1081,7 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
         // 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
@@ -1699,23 +1123,7 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
         // 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
       {
@@ -1723,11 +1131,12 @@ FontId FontClient::Plugin::CreateFont(const FontPath& path,
       }
     }
 
-    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);
       }
     }
   }
@@ -1736,176 +1145,16 @@ FontId FontClient::Plugin::CreateFont(const FontPath& 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);
@@ -1918,10 +1167,15 @@ bool FontClient::Plugin::IsScalable(const FontPath& path)
     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.
@@ -1951,13 +1205,13 @@ bool FontClient::Plugin::IsScalable(const FontDescription& fontDescription)
   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);
@@ -1966,18 +1220,23 @@ void FontClient::Plugin::GetFixedSizes(const FontPath& path, Vector<PointSize26D
     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.
@@ -2014,88 +1273,4 @@ bool FontClient::Plugin::HasItalicStyle(FontId fontId) const
   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
index bef0f89..8961200 100644 (file)
@@ -70,85 +70,7 @@ typedef Vector<_FcCharSet*> CharacterSetList;
  */
 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.
    *
@@ -170,7 +92,7 @@ public:
   /**
    * @copydoc Dali::TextAbstraction::FontClient::ClearCache()
    */
-  void ClearCache();
+  void ClearCache() const;
 
   /**
    * @copydoc Dali::TextAbstraction::FontClient::SetDpi()
@@ -180,73 +102,44 @@ public:
   /**
    * @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()
@@ -254,50 +147,50 @@ public:
   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()
@@ -307,62 +200,62 @@ public:
   /**
    * @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)
@@ -400,75 +293,50 @@ public:
   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.
@@ -483,109 +351,7 @@ private:
   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;
@@ -597,39 +363,14 @@ private:
   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
index fbe76aa..445e026 100644 (file)
 
 #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
@@ -104,10 +131,15 @@ const FontSlant::Type IntToSlantType(int slant)
   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);
@@ -394,4 +426,67 @@ FcCharSet* CreateCharacterSetFromDescription(const FontDescription& description)
   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
index c73e3da..17ff1d7 100644 (file)
@@ -1,5 +1,5 @@
-#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.
@@ -65,6 +65,40 @@ FcPattern* CreateFontFamilyPattern(const FontDescription& fontDescription);
  */
 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)
@@ -124,10 +158,11 @@ const FontWeight::Type IntToWeightType(int weight);
  */
 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
index 35a5c72..5ece316 100644 (file)
@@ -113,7 +113,7 @@ inline const GlyphCacheManager::CompressionPolicyType GetRenderedGlyphCompressPo
 }
 } // namespace
 
-FontFaceCacheItem::FontFaceCacheItem(FT_Library&        freeTypeLibrary,
+FontFaceCacheItem::FontFaceCacheItem(const FT_Library&  freeTypeLibrary,
                                      FT_Face            ftFace,
                                      const FontPath&    path,
                                      PointSize26Dot6    requestedPointSize,
@@ -138,7 +138,7 @@ FontFaceCacheItem::FontFaceCacheItem(FT_Library&        freeTypeLibrary,
 {
 }
 
-FontFaceCacheItem::FontFaceCacheItem(FT_Library&        freeTypeLibrary,
+FontFaceCacheItem::FontFaceCacheItem(const FT_Library&  freeTypeLibrary,
                                      FT_Face            ftFace,
                                      const FontPath&    path,
                                      PointSize26Dot6    requestedPointSize,
index 08baff7..c6bc1b8 100644 (file)
@@ -1,5 +1,5 @@
-#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.
@@ -41,14 +41,14 @@ namespace Dali::TextAbstraction::Internal
  */
 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,
@@ -129,8 +129,8 @@ struct FontFaceCacheItem : public FontCacheItemInterface
   }
 
 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.
@@ -151,4 +151,4 @@ public:
 
 } // namespace Dali::TextAbstraction::Internal
 
-#endif //DALI_TEST_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
+#endif //DALI_TEXT_ABSTRACTION_INTERNAL_FONT_FACE_CACHE_ITEM_H
index 28086b6..60a0a71 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -31,6 +31,7 @@ struct PixelBufferCacheItem
 {
   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
index dba0217..0116570 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -106,9 +106,9 @@ bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t&
   return mPlugin.GetMarkerInfo(marker, startFrame, endFrame);
 }
 
-void VectorAnimationRenderer::IgnoreRenderedFrame()
+void VectorAnimationRenderer::InvalidateBuffer()
 {
-  mPlugin.IgnoreRenderedFrame();
+  mPlugin.InvalidateBuffer();
 }
 
 Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
index b0de095..1924cf4 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -98,9 +98,9 @@ public:
   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()
index 78b747a..d5d0f0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -163,6 +163,11 @@ void VectorAnimationRendererPluginProxy::GetDefaultSize(uint32_t& width, uint32_
   {
     mPlugin->GetDefaultSize(width, height);
   }
+  else
+  {
+    width  = 0;
+    height = 0;
+  }
 }
 
 void VectorAnimationRendererPluginProxy::GetLayerInfo(Property::Map& map) const
@@ -182,11 +187,11 @@ bool VectorAnimationRendererPluginProxy::GetMarkerInfo(const std::string& marker
   return false;
 }
 
-void VectorAnimationRendererPluginProxy::IgnoreRenderedFrame()
+void VectorAnimationRendererPluginProxy::InvalidateBuffer()
 {
   if(mPlugin)
   {
-    mPlugin->IgnoreRenderedFrame();
+    mPlugin->InvalidateBuffer();
   }
 }
 
index ef4f016..c71dc87 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -94,9 +94,9 @@ public:
   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()
index feb8b5a..88414b7 100644 (file)
@@ -74,6 +74,7 @@ VectorImageRenderer::VectorImageRenderer()
 
 VectorImageRenderer::~VectorImageRenderer()
 {
+  Mutex::ScopedLock lock(mMutex);
 #ifdef THORVG_SUPPORT
 
   //NOTE: Initializer::term() will call clear() internally.
@@ -116,6 +117,7 @@ void VectorImageRenderer::Initialize()
 
 bool VectorImageRenderer::Load(const Vector<uint8_t>& data, float dpi)
 {
+  Mutex::ScopedLock lock(mMutex);
 #ifdef THORVG_SUPPORT
   if(!mSwCanvas)
   {
@@ -204,6 +206,8 @@ bool VectorImageRenderer::IsLoaded() const
 
 Dali::Devel::PixelBuffer VectorImageRenderer::Rasterize(uint32_t width, uint32_t height)
 {
+  Mutex::ScopedLock lock(mMutex);
+
   if(width == 0)
   {
     if(mDefaultWidth == 0)
index 19ae0c1..e2c2cee 100644 (file)
  */
 
 // 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
@@ -105,8 +107,9 @@ private:
   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
index 808e9c9..ed91a6b 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // 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>
index 0423b6b..3034d0f 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -23,8 +23,8 @@
 
 // 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
 {
index fa8c7c1..f298a76 100644 (file)
@@ -884,6 +884,9 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
   {
     Uint16Pair newSize(newRect.width, newRect.height);
 
+    mWindowWidth   = newRect.width;
+    mWindowHeight  = newRect.height;
+
     SurfaceResized();
 
     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
index d71af85..301fb5b 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 30;
+const unsigned int ADAPTOR_MICRO_VERSION = 31;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 58fa8a4..78d2b5e 100644 (file)
@@ -17,7 +17,7 @@
 
 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