{
namespace Internal
{
-
CustomShaderFactory::CustomShaderFactory()
{
}
bool CustomShaderFactory::AddPrecompiledShader(PrecompileShaderOption& option)
{
- auto shaderName = option.GetShaderName();
- auto vertexShader = option.GetVertexShader();
+ auto shaderName = option.GetShaderName();
+ auto vertexShader = option.GetVertexShader();
auto fragmentShader = option.GetFragmentShader();
return SavePrecompileShader(shaderName, vertexShader, fragmentShader);
}
shaders.shaderCount = 0;
// precompile requested shader first
- for(uint32_t i = 0; i < mRequestedPrecompileShader.size(); i++ )
+ for(uint32_t i = 0; i < mRequestedPrecompileShader.size(); i++)
{
vertexPrefix.push_back(mRequestedPrecompileShader[i].vertexPrefix);
fragmentPrefix.push_back(mRequestedPrecompileShader[i].fragmentPrefix);
shaders.vertexShader = ""; // Custom shader use prefix shader only. No need to set vertexShader and fragmentShader.
shaders.fragmentShader = ""; // Custom shader use prefix shader only. No need to set vertexShader and fragmentShader.
shaders.shaderCount = std::move(shaderCount);
- shaders.custom = true;
+ shaders.custom = true;
}
bool CustomShaderFactory::SavePrecompileShader(std::string& shaderName, std::string& vertexShader, std::string& fragmentShader)
{
RequestShaderInfo info;
- info.name = shaderName;
- info.vertexPrefix = vertexShader;
+ info.type = VisualFactoryCache::SHADER_TYPE_MAX; ///< Not be used
+ info.name = shaderName;
+ info.vertexPrefix = vertexShader;
info.fragmentPrefix = fragmentShader;
mRequestedPrecompileShader.push_back(info);
- DALI_LOG_RELEASE_INFO("Add precompile shader success!!(%s)",shaderName.c_str());
+ DALI_LOG_RELEASE_INFO("Add precompile shader success!!(%s)", shaderName.c_str());
return true;
}
WIREFRAME_SHADER,
ARC_BUTT_CAP_SHADER,
ARC_ROUND_CAP_SHADER,
- SHADER_TYPE_MAX = ARC_ROUND_CAP_SHADER
+ SHADER_TYPE_MAX
};
/**
NINE_PATCH_GEOMETRY,
NINE_PATCH_BORDER_GEOMETRY,
WIREFRAME_GEOMETRY,
- GEOMETRY_TYPE_MAX = WIREFRAME_GEOMETRY
+ GEOMETRY_TYPE_MAX
};
public:
uint32_t height;
};
- Geometry mGeometry[GEOMETRY_TYPE_MAX + 1];
- Shader mShader[SHADER_TYPE_MAX + 1];
+ Geometry mGeometry[GEOMETRY_TYPE_MAX];
+ Shader mShader[SHADER_TYPE_MAX];
bool mLoadYuvPlanes; ///< A global flag to specify if the image should be loaded as yuv planes
#include <dali-toolkit/internal/visuals/color/color-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/color/color-visual.h>
#include <dali-toolkit/internal/visuals/custom-shader-factory.h>
-#include <dali-toolkit/internal/visuals/npatch-shader-factory.h>
#include <dali-toolkit/internal/visuals/gradient/gradient-visual.h>
#include <dali-toolkit/internal/visuals/image/image-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/image/image-visual.h>
#include <dali-toolkit/internal/visuals/mesh/mesh-visual.h>
+#include <dali-toolkit/internal/visuals/npatch-shader-factory.h>
#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
#include <dali-toolkit/internal/visuals/primitive/primitive-visual.h>
#include <dali-toolkit/internal/visuals/svg/svg-visual.h>
bool VisualFactory::AddPrecompileShader(const Property::Map& map)
{
PrecompileShaderOption shaderOption(map);
- auto type = shaderOption.GetShaderType();
+ auto type = shaderOption.GetShaderType();
if(type == PrecompileShaderOption::ShaderType::UNKNOWN)
{
DALI_LOG_ERROR("AddPrecompileShader is failed. we can't find shader type");
bool VisualFactory::AddPrecompileShader(PrecompileShaderOption& option)
{
auto type = option.GetShaderType();
- bool ret = false;
+ bool ret = false;
switch(type)
{
case PrecompileShaderOption::ShaderType::COLOR:
case PrecompileShaderOption::ShaderType::NPATCH:
{
ret = GetNpatchShaderFactory().AddPrecompiledShader(option);
+ break;
}
case PrecompileShaderOption::ShaderType::MODEL_3D:
{
}
default:
{
- DALI_LOG_ERROR("AddPrecompileShader is failed. we can't find shader factory type:%d",type);
+ DALI_LOG_ERROR("AddPrecompileShader is failed. we can't find shader factory type:%d", type);
break;
}
}