Merge "Fix RemoveText issue in text controller" into devel/master
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 12 Jul 2022 08:32:54 +0000 (08:32 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 12 Jul 2022 08:32:54 +0000 (08:32 +0000)
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h
automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.h
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
dali-toolkit/internal/texture-manager/texture-manager-impl.cpp

index e44aa56..d3f4e25 100644 (file)
@@ -125,6 +125,8 @@ struct 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&, const std::string&) {} // no-op
+  virtual void eldbus_name_release_impl(const ConnectionPtr&, const std::string&) {} // no-op
 
   class StringStorage
   {
index e2ff409..d9fe5b7 100755 (executable)
@@ -43,6 +43,7 @@ const char* TEST_SVG_FILE_NAME    = TEST_RESOURCE_DIR "/svg1.svg";
 const char* TEST_GIF_FILE_NAME    = TEST_RESOURCE_DIR "/anim.gif";
 
 const std::string DEFAULT_FONT_DIR("/resources/fonts");
+const char* const DALI_DEBUG_RENDERING("DALI_DEBUG_RENDERING");
 
 void TestDebugVisual(Integration::Scene scene, Visual::Base& visual, DevelVisual::Type actualType, Vector2 expectedNaturalSize)
 {
@@ -96,7 +97,7 @@ void dali_debug_rendering_cleanup(void)
 
 int UtcDaliDebugRenderingGetVisual1(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("UtcDaliDebugRenderingGetVisual1:  Request visual with a Property::Map");
 
@@ -213,13 +214,13 @@ int UtcDaliDebugRenderingGetVisual1(void)
   DALI_TEST_CHECK(nPatchVisual);
   TestDebugVisual(application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO);
 
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
   END_TEST;
 }
 
 int UtcDaliDebugRenderingGetVisual2(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("UtcDaliDebugRenderingGetVisual2: Request visual with various parameters");
 
@@ -257,13 +258,13 @@ int UtcDaliDebugRenderingGetVisual2(void)
   DALI_TEST_CHECK(nPatchVisual);
   TestDebugVisual(application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO);
 
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
   END_TEST;
 }
 
 int UtcDaliDebugRenderingGetVisual3(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("UtcDaliDebugRenderingGetVisual3: Request visual with various parameters");
 
@@ -322,13 +323,13 @@ int UtcDaliDebugRenderingGetVisual3(void)
   DALI_TEST_EQUALS(imageView2.GetRendererCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(imageView3.GetRendererCount(), 0u, TEST_LOCATION);
 
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
   END_TEST;
 }
 
 int UtcDaliDebugRenderingGetVisual4(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("UtcDaliDebugRenderingGetVisual4: Request visual with empty URL and empty Array");
 
@@ -372,13 +373,13 @@ int UtcDaliDebugRenderingGetVisual4(void)
     DALI_TEST_CHECK(emptyVisual.GetObjectPtr() == &visualImpl);
   }
 
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
   END_TEST;
 }
 
 int UtcDaliDebugRenderingGetVisualObject01(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
 
   VisualFactory factory = VisualFactory::Get();
@@ -400,7 +401,7 @@ int UtcDaliDebugRenderingGetVisualObject01(void)
   tet_infoline("Compare the returned TextVisual with the visual implementation, should differ");
   DALI_TEST_CHECK(textVisual.GetObjectPtr() != &visualImpl);
 
-  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
   END_TEST;
 }
 
@@ -457,7 +458,7 @@ int UtcDaliDebugRenderingGetVisualObject03(void)
 
 int UtcDaliDebugRenderingRenderText(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("Ensure we can render text when in debug mode");
 
index 5d8d143..4fc6cf2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -18,8 +18,7 @@
 #include "toolkit-environment-variable.h"
 
 // EXTERNAL INCLUDE
-#include <cstddef>
-#include <string>
+#include <map>
 
 namespace Dali
 {
@@ -27,36 +26,22 @@ namespace EnvironmentVariable
 {
 namespace
 {
-const char* gReturnValue = NULL;
-std::string gEnvironmentVariableName;
-std::string gEnvironmentVariableValue;
+std::map<std::string, std::string> gEnvironmentVariables;
 } // namespace
 
 const char* GetEnvironmentVariable(const char* variable)
 {
-  if(gEnvironmentVariableName == variable)
+  auto value = gEnvironmentVariables.find(variable);
+  if(value != gEnvironmentVariables.end())
   {
-    return gEnvironmentVariableValue.c_str();
-  }
-  return gReturnValue;
-}
-
-void SetTestingEnvironmentVariable(bool testing)
-{
-  if(testing)
-  {
-    gReturnValue = "1";
-  }
-  else
-  {
-    gReturnValue = NULL;
+    return value->second.c_str();
   }
+  return nullptr;
 }
 
 void SetTestEnvironmentVariable(const char* variable, const char* value)
 {
-  gEnvironmentVariableName  = variable;
-  gEnvironmentVariableValue = value;
+  gEnvironmentVariables[variable] = value;
 }
 
 } // namespace EnvironmentVariable
index 43b0758..96c9c88 100644 (file)
@@ -27,8 +27,6 @@ namespace EnvironmentVariable
 {
 const char* GetEnvironmentVariable(const char* variable);
 
-void SetTestingEnvironmentVariable(bool);
-
 void SetTestEnvironmentVariable(const char* variable, const char* value);
 
 } // namespace EnvironmentVariable
index ba39604..2bfef0a 100644 (file)
@@ -64,7 +64,8 @@ const char* TEST_ROTATED_IMAGE            = TEST_RESOURCE_DIR "/keyboard-Landsca
 const char* TEST_YUV420_IMAGE_FILE_NAME   = TEST_RESOURCE_DIR "/gallery-small-1-yuv420.jpg";
 const char* TEST_N_PATCH_IMAGE_FILE_NAME  = TEST_RESOURCE_DIR "/heartsframe.9.png";
 
-constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES_ENV";
+constexpr auto LOAD_IMAGE_YUV_PLANES_ENV         = "DALI_LOAD_IMAGE_YUV_PLANES";
+constexpr auto ENABLE_DECODE_JPEG_TO_YUV_420_ENV = "DALI_ENABLE_DECODE_JPEG_TO_YUV_420";
 
 bool             gResourceReadySignalFired = false;
 std::vector<int> gReadyIds                 = {};
@@ -2989,6 +2990,7 @@ int UtcDaliImageVisualLoadReady01(void)
 int UtcDaliImageVisualLoadImagePlanes01(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
@@ -3034,6 +3036,7 @@ int UtcDaliImageVisualLoadImagePlanes01(void)
 int UtcDaliImageVisualLoadImagePlanes02(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
@@ -3077,6 +3080,7 @@ int UtcDaliImageVisualLoadImagePlanes02(void)
 int UtcDaliImageVisualLoadImagePlanes03(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
index 223208a..e23ee49 100644 (file)
@@ -39,7 +39,7 @@ constexpr auto DEFAULT_NUMBER_OF_REMOTE_LOADER_THREADS = size_t{8u};
 
 constexpr auto NUMBER_OF_LOCAL_LOADER_THREADS_ENV  = "DALI_TEXTURE_LOCAL_THREADS";
 constexpr auto NUMBER_OF_REMOTE_LOADER_THREADS_ENV = "DALI_TEXTURE_REMOTE_THREADS";
-constexpr auto LOAD_IMAGE_YUV_PLANES_ENV           = "DALI_LOAD_IMAGE_YUV_PLANES_ENV";
+constexpr auto LOAD_IMAGE_YUV_PLANES_ENV           = "DALI_LOAD_IMAGE_YUV_PLANES";
 
 size_t GetNumberOfThreads(const char* environmentVariable, size_t defaultValue)
 {