[dali_2.3.27] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / event / size-negotiation / memory-pool-relayout-container.h
index 87e7176..38e7601 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_MEMORY_POOL_RELAYOUT_CONTAINER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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 @@
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 
+#include <dali/integration-api/ordered-set.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
-#include <dali/internal/common/ordered-set.h>
 
 namespace Dali
 {
@@ -48,6 +48,15 @@ public:
   {
     Dali::Actor actor; ///< The actor to relayout
     Vector2     size;  ///< The desired size of the actor
+#if defined(LOW_SPEC_MEMORY_MANAGEMENT_ENABLED)
+    struct RelayoutInfoCompareLess
+    {
+      bool operator()(const RelayoutInfo* lhs, const RelayoutInfo* rhs) const noexcept
+      {
+        return lhs->actor < rhs->actor;
+      }
+    };
+#else
     struct RelayoutInfoHash
     {
       std::size_t operator()(const RelayoutInfo* x) const noexcept
@@ -62,6 +71,7 @@ public:
         return lhs->actor == rhs->actor;
       }
     };
+#endif
   };
 
   /**
@@ -124,7 +134,11 @@ private:
   bool Contains(const Dali::Actor& actor);
 
 private:
-  using RelayoutInfoContainer = Dali::Internal::OrderedSet<RelayoutInfo, false, RelayoutInfo::RelayoutInfoHash, RelayoutInfo::RelayoutInfoCompare>;
+#if defined(LOW_SPEC_MEMORY_MANAGEMENT_ENABLED)
+  using RelayoutInfoContainer = Dali::Integration::OrderedSet<RelayoutInfo, false, RelayoutInfo::RelayoutInfoCompareLess>;
+#else
+  using RelayoutInfoContainer = Dali::Integration::OrderedSet<RelayoutInfo, false, RelayoutInfo::RelayoutInfoHash, RelayoutInfo::RelayoutInfoCompare>;
+#endif
 
   RelayoutInfoContainer mRelayoutInfos; ///< The list of relayout infos