fix target build error
authorHyeJin Lee <hyejin79.lee@samsung.com>
Wed, 21 Aug 2013 12:14:48 +0000 (15:14 +0300)
committerHyeJin Lee <hyejin79.lee@samsung.com>
Wed, 21 Aug 2013 12:14:48 +0000 (15:14 +0300)
Change-Id: I027663e4e6148eb086db40ca9f5da0ee92e79624

src/ui/animations/FUiAnim_GlContext.cpp
src/ui/animations/FUiAnim_GlRenderManager.cpp
src/ui/animations/FUiAnim_GlRenderManager.h
src/ui/animations/FUiAnim_ShaderImpl.cpp
src/ui/animations/FUiAnim_ShaderProgramImpl.cpp
src/ui/animations/FUiAnim_ShaderProgramImpl.h

index 1b32673..851144d 100644 (file)
@@ -854,7 +854,6 @@ _GlContext::UseShaderProgram(ShaderProgram* pShaderProgram)
 //             __pCurrentShader->OnProgramReferenced();
 
                unsigned int program = _ShaderProgramImpl::GetInstance(*pShaderProgram)->__program;
-               AppLog("\n jinstar -- use program %d", program);
                glUseProgram(program);
        }
        else
@@ -875,16 +874,8 @@ _GlContext::BuildShader(GLuint type, const char* pShaderSource)
                type = GL_FRAGMENT_SHADER;
                break;
        default:
-               break;
-//             return 0;
-       };
-
-       if (type != GL_VERTEX_SHADER && type != GL_FRAGMENT_SHADER)
                return 0;
-
-#ifndef VE_USE_GL_MULTI_CONTEXT
-       CHECK_GL_CONTEXT();
-#endif
+       };
 
        GLuint shaderId = glCreateShader(type);
        if (shaderId == 0)
@@ -913,29 +904,12 @@ _GlContext::BuildShader(GLuint type, const char* pShaderSource)
                return 0;
        }
 
-       //for log
-       switch(type)
-       {
-       case GL_VERTEX_SHADER:
-               AppLog("\n jinstar -- BuildShader vertex %d", shaderId);
-               break;
-       case GL_FRAGMENT_SHADER:
-               AppLog("\n jinstar -- BuildShader fragment %d", shaderId);
-               break;
-       }
-
        return shaderId;
 }
 
 bool
 _GlContext::DeleteShader(GLuint shaderId)
 {
-#ifndef VE_USE_GL_MULTI_CONTEXT
-       CHECK_GL_CONTEXT();
-#endif
-
-       AppLog("\n jinstar -- Delete Shader %d", shaderId);
-
        glDeleteShader(shaderId);
 
        return true;
@@ -944,10 +918,6 @@ _GlContext::DeleteShader(GLuint shaderId)
 GLuint
 _GlContext::BuildShaderProgram(GLuint vertexShader, GLuint fragmentShader)
 {
-#ifndef VE_USE_GL_MULTI_CONTEXT
-       CHECK_GL_CONTEXT();
-#endif
-
        if (vertexShader <= 0 || fragmentShader <= 0)
        {
                return 0;
@@ -977,20 +947,12 @@ _GlContext::BuildShaderProgram(GLuint vertexShader, GLuint fragmentShader)
                return 0;
        }
 
-       AppLog("\n jinstar -- Build Program %d", programId);
-
        return programId;
 }
 
 bool
 _GlContext::DeleteShaderProgram(GLuint programId)
 {
-#ifndef VE_USE_GL_MULTI_CONTEXT
-       CHECK_GL_CONTEXT();
-#endif
-
-       AppLog("\n jinstar -- Delete Program %d", programId);
-
        glDeleteProgram(programId);
 
        return true;
@@ -999,23 +961,13 @@ _GlContext::DeleteShaderProgram(GLuint programId)
 int
 _GlContext::GetAttribLocation(int program, const char* name)
 {
-       int location = glGetAttribLocation(program, name);
-
-       AppLog("\n jinstar -- GetAttribLocation %d %s %d [error:%d]", program, name, location, glGetError());
-
-       return location;
-//     return glGetAttribLocation(program, name);
+       return glGetAttribLocation(program, name);
 }
 
 int
 _GlContext::GetUniformLocation(int program, const char* name)
 {
-       int location = glGetUniformLocation(program, name);
-
-       AppLog("\n jinstar -- GetUniformLocation %d %s %d [error:%d]", program, name, location, glGetError());
-
-       return location;
-//     return glGetUniformLocation(program, name);
+       return glGetUniformLocation(program, name);
 }
 
 
@@ -1025,9 +977,6 @@ _GlContext::EnableVertexAttribArray(GLuint program, int index)
        glUseProgram(program);
 
        glEnableVertexAttribArray(index);
-
-       AppLog("\n jinstar -- EnableVertexAttribArray %d %d [error:%d]", program, index, glGetError());
-       //TODO: Need to return glGetError()
 }
 
 void
@@ -1036,8 +985,6 @@ _GlContext::DisableVertexAttribArray(GLuint program, int index)
        glUseProgram(program);
 
        glDisableVertexAttribArray(index);
-
-       AppLog("\n jinstar -- EnableVertexAttribArray %d %d [error:%d]", program, index, glGetError());
 }
 
 
index 064ec47..1124291 100644 (file)
@@ -701,7 +701,6 @@ _GlRenderManager::FlushRenderQueue(void)
                {
                        if (__pRenderQueue[i].__pColors)
                        {
-                               glEnableVertexAttribArray(__pRenderQueue[i].__aColor);
                                glVertexAttribPointer(__pRenderQueue[i].__aColor, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), __pRenderQueue[i].__pColors);
                        }
                        else
@@ -1402,62 +1401,6 @@ _GlRenderManager::DeleteShaderProgram(_ShaderProgramImpl* pShaderProgram)
        return (__commandResult == E_SUCCESS);
 }
 
-bool
-_GlRenderManager::GetAttribLocation(_ShaderProgramImpl* pShaderProgram)
-{
-       _AutoMutex commandTransactionLock(__commandTransaction);
-       _AutoMutex commandLock(__commandLock);
-
-       __commandId = COMMAND_GET_ATTRIBUTE_LOCATION;
-       __commandArg.__pCommandShaderProgram = pShaderProgram;
-       __commandRequest.SendSignal();
-       __commandReply.WaitForSignal(&__commandLock);
-
-       return (__commandResult == E_SUCCESS);
-}
-
-bool
-_GlRenderManager::GetUniformLocation(_ShaderProgramImpl* pShaderProgram)
-{
-       _AutoMutex commandTransactionLock(__commandTransaction);
-       _AutoMutex commandLock(__commandLock);
-
-       __commandId = COMMAND_GET_UNIFORM_LOCATION;
-       __commandArg.__pCommandShaderProgram = pShaderProgram;
-       __commandRequest.SendSignal();
-       __commandReply.WaitForSignal(&__commandLock);
-
-       return (__commandResult == E_SUCCESS);
-}
-
-bool
-_GlRenderManager::EnableVertexAttribArray(_ShaderProgramImpl* pShaderProgram)
-{
-       _AutoMutex commandTransactionLock(__commandTransaction);
-       _AutoMutex commandLock(__commandLock);
-
-       __commandId = COMMAND_ENABLE_VERTEX_ATTRIB_ARRAY;
-       __commandArg.__pCommandShaderProgram = pShaderProgram;
-       __commandRequest.SendSignal();
-       __commandReply.WaitForSignal(&__commandLock);
-
-       return (__commandResult == E_SUCCESS);
-}
-
-bool
-_GlRenderManager::DisableVertexAttribArray(_ShaderProgramImpl* pShaderProgram)
-{
-       _AutoMutex commandTransactionLock(__commandTransaction);
-       _AutoMutex commandLock(__commandLock);
-
-       __commandId = COMMAND_DISABLE_VERTEX_ATTRIB_ARRAY;
-       __commandArg.__pCommandShaderProgram = pShaderProgram;
-       __commandRequest.SendSignal();
-       __commandReply.WaitForSignal(&__commandLock);
-
-       return (__commandResult == E_SUCCESS);
-}
-
 //temp
 unsigned int
 _GlRenderManager::BuildShader(int type, const char* pShaderSource)
index 6bc343e..5656119 100644 (file)
@@ -71,11 +71,7 @@ public:
                COMMAND_BUILD_SHADER,
                COMMAND_DELETE_SHADER,
                COMMAND_BUILD_SHADER_PROGRAM,
-               COMMAND_DELETE_SHADER_PROGRAM,
-               COMMAND_GET_UNIFORM_LOCATION,
-               COMMAND_GET_ATTRIBUTE_LOCATION,
-               COMMAND_ENABLE_VERTEX_ATTRIB_ARRAY,
-               COMMAND_DISABLE_VERTEX_ATTRIB_ARRAY
+               COMMAND_DELETE_SHADER_PROGRAM
        };
 
        static _GlRenderManager* GetInstance(void)
@@ -106,11 +102,6 @@ public:
        bool DeleteShader(_ShaderImpl* pShader);
        bool BuildShaderProgram(_ShaderProgramImpl* pShaderProgram);
        bool DeleteShaderProgram(_ShaderProgramImpl* pShaderProgram);
-       bool GetAttribLocation(_ShaderProgramImpl* pShaderProgram);
-       bool GetUniformLocation(_ShaderProgramImpl* pShaderProgram);
-
-       bool EnableVertexAttribArray(_ShaderProgramImpl* pShaderProgram);
-       bool DisableVertexAttribArray(_ShaderProgramImpl* pShaderProgram);
 
        unsigned int BuildShader(int type, const char* pShaderSource);
        bool DeleteShader(GLuint shaderId);
index 7229a43..801dbd3 100644 (file)
@@ -52,11 +52,6 @@ _ShaderImpl::Construct(Shader::ShaderType type, const char* pShaderSource)
 
        _GlRenderManager::GetInstance()->BuildShader(this);
 
-       if (__type == Shader::SHADER_VERTEX)
-               AppLog("\n jinstar : vertex shader   : %d", __shaderId);
-       else
-               AppLog("\n jinstar : fragment shader : %d", __shaderId);
-
        SysTryReturnResult(NID_UI_ANIM, __shaderId > 0, E_SYSTEM, "Failed to build shader.");
 
        return E_SUCCESS;
index 3949753..88e6017 100644 (file)
@@ -75,38 +75,15 @@ _ShaderProgramImpl::Construct(Shader& vertexShader, Shader& fragmentShader)
 
        _GlRenderManager::GetInstance()->BuildShaderProgram(this);
 
-       AppLog("\n jinstar : shader program : %d", __program);
-
        SysTryReturnResult(NID_UI_ANIM, __program > 0, E_SYSTEM, "Failed to build shader program.");
 
-       // temp
-       __request.name = UniformMVP;
-       _GlRenderManager::GetInstance()->GetUniformLocation(this);
-       __locationId[UNIFORM_MVP] = __request.location;
-
-       __request.name= UniformColor;
-       _GlRenderManager::GetInstance()->GetUniformLocation(this);
-       __locationId[UNIFORM_COLOR] = __request.location;
-
-       __request.name = AttributePosition;
-       _GlRenderManager::GetInstance()->GetAttribLocation(this);
-       __locationId[ATTRIBUTE_POSITION] = __request.location;
-
-       __request.name = AttributeTexCoord;
-       _GlRenderManager::GetInstance()->GetAttribLocation(this);
-       __locationId[ATTRIBUTE_TEXTURE_COORD] = __request.location;
-
-       __request.name = AttributeColor;
-       _GlRenderManager::GetInstance()->GetAttribLocation(this);
-       __locationId[ATTRIBUTE_COLOR] = __request.location;
-
        return E_SUCCESS;
 }
 
 Variant
 _ShaderProgramImpl::GetUniform(const Tizen::Base::String& name) const
 {
-
+       return Variant();
 }
 
 result
@@ -121,12 +98,10 @@ _ShaderProgramImpl::GetUniformLocation(const Tizen::Base::String& name)
 {
        if (name == UniformMVP)
        {
-               AppLog("\n jinstar : [%d] u_mvp %d", __program, __locationId[UNIFORM_MVP]);
                return __locationId[UNIFORM_MVP];
        }
        else if (name == UniformColor)
        {
-               AppLog("\n jinstar : [%d] u_color %d", __program, __locationId[ATTRIBUTE_COLOR]);
                return __locationId[ATTRIBUTE_COLOR];
        }
 
@@ -138,85 +113,20 @@ _ShaderProgramImpl::GetAttribLocation(const Tizen::Base::String& name)
 {
        if (name == AttributePosition)
        {
-               AppLog("\n jinstar : [%d] a_position %d", __program, __locationId[ATTRIBUTE_POSITION]);
                return __locationId[ATTRIBUTE_POSITION];
        }
        else if (name == AttributeTexCoord)
        {
-               AppLog("\n jinstar : [%d] a_texcoord %d", __program, __locationId[ATTRIBUTE_TEXTURE_COORD]);
                return __locationId[ATTRIBUTE_TEXTURE_COORD];
        }
        else if (name == AttributeColor)
        {
-               AppLog("\n jinstar : [%d] a_color %d", __program, __locationId[ATTRIBUTE_COLOR]);
                return __locationId[ATTRIBUTE_COLOR];
        }
 
        return 0;//GetLocation(ATTRIBUTE_TYPE, name);
 }
 
-#if 0
-int
-_ShaderProgramImpl::GetLocation(PROGRAM_LOCATION_TYPE type, const Tizen::Base::String& name)
-{
-       int location = __locations.GetLocation(name);
-
-       if (location < 0)
-       {
-               __request.name = name;
-
-               switch(type)
-               {
-               case UNIFORM_TYPE:
-                       location = _GlRenderManager::GetInstance()->GetUniformLocation(this);
-                       break;
-
-               case ATTRIBUTE_TYPE:
-                       location = _GlRenderManager::GetInstance()->GetAttribLocation(this);
-                       break;
-               }
-
-               __locations.Add(name, location);
-       }
-
-       AppLog("\n jinstar : [%d] %s %d", __program, name.GetPointer(), location);
-
-       return location;
-}
-#endif
-
-void
-_ShaderProgramImpl::EnableVertexAttribArray(int location)
-{
-       SysTryReturnVoidResult(NID_UI_ANIM, location >= 0, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. location = %d", location);
-
-       __request.location = location;
-
-       _GlRenderManager::GetInstance()->EnableVertexAttribArray(this);
-}
-
-void
-_ShaderProgramImpl::DisableVertexAttibArray(int location)
-{
-       SysTryReturnVoidResult(NID_UI_ANIM, location >= 0, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. location = %d", location);
-
-       __request.location = location;
-
-       _GlRenderManager::GetInstance()->DisableVertexAttribArray(this);
-}
-
-void
-_ShaderProgramImpl::SetUniform(int location, const Tizen::Ui::Variant& value)
-{
-
-}
-
-void
-_ShaderProgramImpl::SetVertexAttrib(int location, const Tizen::Ui::Variant& value)
-{
-
-}
-
 _ShaderProgramImpl*
 _ShaderProgramImpl::GetInstance(ShaderProgram& program)
 {
index 322a87a..0d31b57 100644 (file)
@@ -62,12 +62,6 @@ public:
        int GetUniformLocation(const Tizen::Base::String& name);
        int GetAttribLocation(const Tizen::Base::String& name);
 
-       void EnableVertexAttribArray(int location);
-       void DisableVertexAttibArray(int location);
-
-       void SetUniform(int location, const Tizen::Ui::Variant& value);
-       void SetVertexAttrib(int location, const Tizen::Ui::Variant& value);
-
        static _ShaderProgramImpl* GetInstance(ShaderProgram& program);
        static const _ShaderProgramImpl* GetInstance(const ShaderProgram& program);