1 #ifndef DALI_TOOLKIT_IMAGE_VISUAL_SHADER_FACTORY_H
2 #define DALI_TOOLKIT_IMAGE_VISUAL_SHADER_FACTORY_H
5 * Copyright (c) 2021 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.
23 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
24 #include <string_view>
33 * @brief Whether use texture with atlas, or not
35 enum class TextureAtlas
37 DISABLED = 0, ///< Image visual use ATLAS
38 ENABLED ///< Image visual doesn't use ATLAS
42 * @brief Whether apply to texture wraping in default, or not
44 enum class DefaultTextureWrapMode
46 DO_NOT_APPLY = 0, ///< Image visual doesn't apply to wraping texture in default
47 APPLY ///< Image visual apply to wraping texture in default
51 * @brief Whether use rounded corner, or not
53 enum class RoundedCorner
55 DISABLED = 0, ///< Image visual doesn't use rounded corner
56 ENABLED ///< Image visual use rounded corner
60 * @brief Whether use borderline, or not
64 DISABLED = 0, ///< Image visual doesn't use borderline
65 ENABLED ///< Image visual use borderline
69 * ImageVisualShaderFactory is an object that provides and shares shaders between image visuals
71 class ImageVisualShaderFactory
78 ImageVisualShaderFactory();
83 ~ImageVisualShaderFactory();
86 * Get the standard image rendering shader.
87 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
88 * @param[in] atlasing Whether texture atlasing is applied.
89 * @param[in] defaultTextureWrapping Whether the default texture wrap mode is applied.
90 * @param[in] roundedCorner Whether the rounded corder is applied.
91 * @param[in] borderline Whether the borderline of visual is applied.
93 Shader GetShader(VisualFactoryCache& factoryCache, TextureAtlas atlasing, DefaultTextureWrapMode defaultTextureWrapping, RoundedCorner roundedCorner, Borderline borderline);
96 * Request the default vertex shader source.
97 * @return The default vertex shader source.
99 std::string_view GetVertexShaderSource();
102 * Request the default fragment shader source.
103 * @return The default fragment shader source.
105 std::string_view GetFragmentShaderSource();
109 * Undefined copy constructor.
111 ImageVisualShaderFactory(const ImageVisualShaderFactory&);
114 * Undefined assignment operator.
116 ImageVisualShaderFactory& operator=(const ImageVisualShaderFactory& rhs);
121 } // namespace Internal
123 } // namespace Toolkit
127 #endif // DALI_TOOLKIT_IMAGE_VISUAL_SHADER_FACTORY_H