[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-actor-utils.h
index 94f1493..03a65c1 100644 (file)
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/public-api/rendering/texture.h>
+#include <set> // For std::multiset
 #include <string>
 
 namespace Dali
@@ -63,6 +65,30 @@ Actor CreateRenderableActor2(TextureSet textures, const std::string& vertexShade
 Texture    CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height);
 TextureSet CreateTextureSet(Pixel::Format format, int width, int height);
 
+// Check dirtyRect is equal with expected multiset.
+// Note that the order of damagedRect is not important
+struct RectSorter
+{
+  bool operator()(const Rect<int>& lhs, const Rect<int>& rhs) const
+  {
+    if(lhs.x != rhs.x)
+    {
+      return lhs.x < rhs.x;
+    }
+    if(lhs.y != rhs.y)
+    {
+      return lhs.y < rhs.y;
+    }
+    if(lhs.width != rhs.width)
+    {
+      return lhs.width < rhs.width;
+    }
+    return lhs.height < rhs.height;
+  }
+};
+
+void DirtyRectChecker(const std::vector<Rect<int>>& damagedRects, std::multiset<Rect<int>, RectSorter> expectedRectList, bool checkRectsExact, const char* testLocation);
+
 } // namespace Dali
 
 #endif // DALI_TEST_ACTOR_UTILS_H