"#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n", // VisualFactoryCache::IMAGE_SHADER_YUV_AND_RGB,
"#define IS_REQUIRED_UNIFIED_YUV_AND_RGB\n#define IS_REQUIRED_ROUNDED_CORNER\n", // VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_YUV_AND_RGB,
};
+constexpr VisualFactoryCache::ShaderType ShaderTypePredefines[SHADER_TYPE_COUNT]{
+ VisualFactoryCache::ShaderType::IMAGE_SHADER,
+ VisualFactoryCache::ShaderType::IMAGE_SHADER_ROUNDED_CORNER,
+ VisualFactoryCache::ShaderType::IMAGE_SHADER_YUV_TO_RGB,
+ VisualFactoryCache::ShaderType::IMAGE_SHADER_ROUNDED_CORNER_YUV_TO_RGB,
+ VisualFactoryCache::ShaderType::IMAGE_SHADER_YUV_AND_RGB,
+ VisualFactoryCache::ShaderType::IMAGE_SHADER_ROUNDED_CORNER_YUV_AND_RGB,
+};
} // unnamed namespace
ImageVisualShaderFactory::ImageVisualShaderFactory()
{
std::vector<std::string_view> vertexPrefix;
std::vector<std::string_view> fragmentPrefix;
+ std::vector<std::string_view> shaderName;
shaders.shaderCount = 0;
int shaderCount = 0;
for(uint32_t i = 0; i < SHADER_TYPE_COUNT; ++i)
{
vertexPrefix.push_back(VertexPredefines[i]);
fragmentPrefix.push_back(FragmentPredefines[i]);
+ shaderName.push_back(Scripting::GetLinearEnumerationName<VisualFactoryCache::ShaderType>(ShaderTypePredefines[i], VISUAL_SHADER_TYPE_TABLE, VISUAL_SHADER_TYPE_TABLE_COUNT));
shaderCount++;
}
shaders.vertexPrefix = vertexPrefix;
shaders.fragmentPrefix = fragmentPrefix;
+ shaders.shaderName = shaderName;
shaders.vertexShader = SHADER_IMAGE_VISUAL_SHADER_VERT;
shaders.fragmentShader = SHADER_IMAGE_VISUAL_SHADER_FRAG;
shaders.shaderCount = shaderCount;
VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE_AND_OVERLAY,
};
-static constexpr auto SHADER_TYPE_COUNT = 1u;
-const std::string_view VertexPredefines[SHADER_TYPE_COUNT]{
+static constexpr auto SHADER_TYPE_COUNT = 1u;
+constexpr std::string_view VertexPredefines[SHADER_TYPE_COUNT]{
"", // VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT
};
-const std::string_view FragmentPredefines[SHADER_TYPE_COUNT]{
+constexpr std::string_view FragmentPredefines[SHADER_TYPE_COUNT]{
"", // VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT
};
+constexpr VisualFactoryCache::ShaderType ShaderTypePredefines[SHADER_TYPE_COUNT]{
+ VisualFactoryCache::ShaderType::TEXT_SHADER_SINGLE_COLOR_TEXT,
+};
} // unnamed namespace
{
std::vector<std::string_view> vertexPrefix;
std::vector<std::string_view> fragmentPrefix;
+ std::vector<std::string_view> shaderName;
int shaderCount = 0;
for(uint32_t i = 0; i < SHADER_TYPE_COUNT; ++i)
{
vertexPrefix.push_back(VertexPredefines[i]);
fragmentPrefix.push_back(FragmentPredefines[i]);
+ shaderName.push_back(Scripting::GetLinearEnumerationName<VisualFactoryCache::ShaderType>(ShaderTypePredefines[i], VISUAL_SHADER_TYPE_TABLE, VISUAL_SHADER_TYPE_TABLE_COUNT));
shaderCount++;
}
shaders.vertexPrefix = vertexPrefix;
shaders.fragmentPrefix = fragmentPrefix;
+ shaders.shaderName = shaderName;
shaders.vertexShader = SHADER_TEXT_VISUAL_SHADER_VERT;
shaders.fragmentShader = SHADER_TEXT_VISUAL_SHADER_FRAG;
shaders.shaderCount = shaderCount;
DALI_TYPE_REGISTRATION_END()
const char* const BROKEN_IMAGE_FILE_NAME = "broken.png"; ///< The file name of the broken image.
-static constexpr auto SHADER_TYPE_COUNT = 2u;
-const std::string_view VertexPredefines[SHADER_TYPE_COUNT]{
+static constexpr auto SHADER_TYPE_COUNT = 2u;
+
+constexpr std::string_view VertexPredefines[SHADER_TYPE_COUNT]{
"", //VisualFactoryCache::COLOR_SHADER
"#define IS_REQUIRED_ROUNDED_CORNER\n", //VisualFactoryCache::COLOR_SHADER_ROUNDED_CORNER
};
-const std::string_view FragmentPredefines[SHADER_TYPE_COUNT]{
+constexpr std::string_view FragmentPredefines[SHADER_TYPE_COUNT]{
"", //VisualFactoryCache::COLOR_SHADER
"#define IS_REQUIRED_ROUNDED_CORNER\n", //VisualFactoryCache::COLOR_SHADER_ROUNDED_CORNER
};
+constexpr VisualFactoryCache::ShaderType ShaderTypePredefines[SHADER_TYPE_COUNT]{
+ VisualFactoryCache::ShaderType::COLOR_SHADER,
+ VisualFactoryCache::ShaderType::COLOR_SHADER_ROUNDED_CORNER,
+};
} // namespace
{
std::vector<std::string_view> vertexPrefix;
std::vector<std::string_view> fragmentPrefix;
+ std::vector<std::string_view> shaderName;
int shaderCount = 0;
shaders.shaderCount = 0;
for(uint32_t i = 0u; i < SHADER_TYPE_COUNT; ++i)
{
vertexPrefix.push_back(VertexPredefines[i]);
fragmentPrefix.push_back(FragmentPredefines[i]);
+ shaderName.push_back(Scripting::GetLinearEnumerationName<VisualFactoryCache::ShaderType>(ShaderTypePredefines[i], VISUAL_SHADER_TYPE_TABLE, VISUAL_SHADER_TYPE_TABLE_COUNT));
shaderCount++;
}
shaders.vertexPrefix = vertexPrefix;
shaders.fragmentPrefix = fragmentPrefix;
+ shaders.shaderName = shaderName;
shaders.vertexShader = SHADER_COLOR_VISUAL_SHADER_VERT;
shaders.fragmentShader = SHADER_COLOR_VISUAL_SHADER_FRAG;
shaders.shaderCount = shaderCount;