1 #ifndef DALI_TEST_ACTOR_UTILS_H
2 #define DALI_TEST_ACTOR_UTILS_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/rendering/texture-set.h>
23 #include <dali/public-api/rendering/texture.h>
24 #include <set> // For std::multiset
34 * @brief Creates a simple renderable-actor with solid colored quad.
35 * @return An actor with a renderer.
37 Actor CreateRenderableActor();
40 * @brief Creates a renderable-actor with a texture.
41 * @param[in] texture Texture to set.
42 * @return An actor with a renderer.
44 Actor CreateRenderableActor(Texture texture);
47 * @brief Creates a renderable-actor with a texture and custom shaders.
48 * @param[in] texture Texture to set.
49 * @param[in] vertexShader The vertex-shader.
50 * @param[in] fragmentShader The fragment-shader.
51 * @return An actor with a renderer.
53 Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader);
56 * @brief Creates a renderable-actor with a texture and custom shaders.
57 * @param[in] textures TextureSet to set.
58 * @param[in] vertexShader The vertex-shader.
59 * @param[in] fragmentShader The fragment-shader.
60 * @return An actor with a renderer.
62 Actor CreateRenderableActor2(TextureSet textures, const std::string& vertexShader, const std::string& fragmentShader);
64 Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height);
65 TextureSet CreateTextureSet(Pixel::Format format, int width, int height);
67 // Check dirtyRect is equal with expected multiset.
68 // Note that the order of damagedRect is not important
71 bool operator()(const Rect<int>& lhs, const Rect<int>& rhs) const
81 if(lhs.width != rhs.width)
83 return lhs.width < rhs.width;
85 return lhs.height < rhs.height;
89 void DirtyRectChecker(const std::vector<Rect<int>>& damagedRects, std::multiset<Rect<int>, RectSorter> expectedRectList, bool checkRectsExact, const char* testLocation);
93 #endif // DALI_TEST_ACTOR_UTILS_H