X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-actor-utils.h;h=03a65c1813b4905d0c68d5395161d17ffbc88d09;hb=68ccbab5d60836876403e44fa3f606ff5014756f;hp=4a8716e2018559077cf695de2d93c31c92c05a37;hpb=2b051f9220d4e28225a57d5dabc98e093357cad6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h index 4a8716e..03a65c1 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h @@ -2,7 +2,7 @@ #define DALI_TEST_ACTOR_UTILS_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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,11 +19,14 @@ */ // EXTERNAL INCLUDES +#include +#include +#include +#include // For std::multiset #include namespace Dali { - class Actor; class Image; class Texture; @@ -39,7 +42,7 @@ Actor CreateRenderableActor(); * @param[in] texture Texture to set. * @return An actor with a renderer. */ -Actor CreateRenderableActor( Texture texture ); +Actor CreateRenderableActor(Texture texture); /** * @brief Creates a renderable-actor with a texture and custom shaders. @@ -48,7 +51,43 @@ Actor CreateRenderableActor( Texture texture ); * @param[in] fragmentShader The fragment-shader. * @return An actor with a renderer. */ -Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader ); +Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader); + +/** + * @brief Creates a renderable-actor with a texture and custom shaders. + * @param[in] textures TextureSet to set. + * @param[in] vertexShader The vertex-shader. + * @param[in] fragmentShader The fragment-shader. + * @return An actor with a renderer. + */ +Actor CreateRenderableActor2(TextureSet textures, const std::string& vertexShader, const std::string& fragmentShader); + +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& lhs, const Rect& 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>& damagedRects, std::multiset, RectSorter> expectedRectList, bool checkRectsExact, const char* testLocation); } // namespace Dali