namespace Tizen { namespace Ui { namespace Animations
{
+enum ShaderProgramIndex{
+ SHADER_PROGRAM_INDEX_WHITHOUT_SKINING = 0,
+ SHADER_PROGRAM_INDEX_WHITH_SKINING,
+ MAX_SHADER_PROGRAM_INDEX
+};
+
class ShaderProgram;
class _ShaderProgramImpl;
struct TextureInfo;
unsigned int __fboId;
_ShaderProgramImpl* __pCurrentShader;
- ShaderProgram* __pColorShader[2];
- ShaderProgram* __pUniformColorShader[2];
- ShaderProgram* __pTextureShader[2];
- ShaderProgram* __pTextureOpacityShader[2];
- ShaderProgram* __pLightShader[2];
- ShaderProgram* __pLightShaderWithoutTextures[2];
-
- ShaderProgram* __pTextureShaderExtra1[2];
- ShaderProgram* __pTextureShaderExtra2[2];
- ShaderProgram* __pTextureShadeAlphaMask[2];
- ShaderProgram* __pTextureShaderAlphaMaskExtra1[2];
- ShaderProgram* __pTextureShaderAlphaMaskExtra2[2];
+ ShaderProgram* __pColorShader[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pUniformColorShader[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureShader[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureOpacityShader[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pLightShader[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pLightShaderWithoutTextures[MAX_SHADER_PROGRAM_INDEX];
+
+ ShaderProgram* __pTextureShaderExtra1[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureShaderExtra2[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureShadeAlphaMask[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureShaderAlphaMaskExtra1[MAX_SHADER_PROGRAM_INDEX];
+ ShaderProgram* __pTextureShaderAlphaMaskExtra2[MAX_SHADER_PROGRAM_INDEX];
/*
ShaderProgram* __pColorShader;
ShaderProgram* __pUniformColorShader;
bool alphaMask = false;
bool extraSurface[2] = {false, false};
bool skining = false;
+ ShaderProgramIndex shaderProgramIndex = SHADER_PROGRAM_INDEX_WHITHOUT_SKINING;
////////////////////////////////////////////////// Parsing input parameters
if (type & SHADER_TYPE_UNIFORM_COLOR)
{
if (type & SHADER_TYPE_SKINING)
{
skining = true;
+ shaderProgramIndex = SHADER_PROGRAM_INDEX_WHITH_SKINING;
}
/////////////////////////////////////////////////////
if (u_color)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pUniformColorShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pUniformColorShader[shaderProgramIndex];
}
else if (color)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pColorShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pColorShader[shaderProgramIndex];
}
else if (texture && ! light_perPixel)
{
{
if (alphaMask)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderAlphaMaskExtra2[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderAlphaMaskExtra2[shaderProgramIndex];
}
else
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderExtra2[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderExtra2[shaderProgramIndex];
}
}
else if(extraSurface[0])
{
if (alphaMask)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderAlphaMaskExtra1[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderAlphaMaskExtra1[shaderProgramIndex];
}
else
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderExtra1[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShaderExtra1[shaderProgramIndex];
}
}
else if (alphaMask)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShadeAlphaMask[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShadeAlphaMask[shaderProgramIndex];
}
else
{
if (!opacity)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureShader[shaderProgramIndex];
}
else
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pTextureOpacityShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pTextureOpacityShader[shaderProgramIndex];
}
}
}
else if (texture && light_perPixel)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pLightShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pLightShader[shaderProgramIndex];
}
else if (!texture && light_perPixel)
{
- return _GlRenderManager::GetInstance()->__pGlContext->__pLightShaderWithoutTextures[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pLightShaderWithoutTextures[shaderProgramIndex];
}
// WARNING : is null right? or return default shader program ?
//return null;
SysLog(NID_UI_ANIM, "Shader program is not selected. So RenderManager choose the default shader(color).");
- return _GlRenderManager::GetInstance()->__pGlContext->__pColorShader[0 + static_cast<int>(skining)];
+ return _GlRenderManager::GetInstance()->__pGlContext->__pColorShader[shaderProgramIndex];
}
void
{
memset(__textureId, 0, sizeof(unsigned int) * (EXTRA_SURFACE_MAX+2));
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < MAX_SHADER_PROGRAM_INDEX; i++)
{
__pColorShader[i] = null;
void
_GlContext::TerminateGL(void)
{
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < MAX_SHADER_PROGRAM_INDEX; i++)
{
delete __pColorShader[i];
__pColorShader[i] = null;