Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-core.git] / dali / internal / render / shaders / program.cpp
index d36ff11..509d0d7 100644 (file)
@@ -140,7 +140,6 @@ void Program::Use()
     {
       LOG_GL( "UseProgram(%d)\n", mProgramId );
       CHECK_GL( mGlAbstraction, mGlAbstraction.UseProgram(mProgramId) );
-      INCREASE_COUNTER(PerformanceMonitor::SHADER_STATE_CHANGES);
 
       mCache.SetCurrentProgram( this );
     }
@@ -477,16 +476,14 @@ void Program::Load()
     {
       DALI_LOG_ERROR("Failed to load program binary \n");
 
-      char* szLog = NULL;
       GLint nLength;
       CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramiv( mProgramId, GL_INFO_LOG_LENGTH, &nLength) );
       if(nLength > 0)
       {
-        szLog = new char[ nLength ];
-        CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog ) );
-        DALI_LOG_ERROR( "Program Link Error: %s\n", szLog );
-
-        delete [] szLog;
+        Dali::Vector< char > szLog;
+        szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
+        CHECK_GL( mGlAbstraction, mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() ) );
+        DALI_LOG_ERROR( "Program Link Error: %s\n", szLog.Begin() );
       }
     }
     else
@@ -581,7 +578,7 @@ bool Program::CompileShader( GLenum shaderType, GLuint& shaderId, const char* sr
     if(nLength > 0)
     {
       Dali::Vector< char > szLog;
-      szLog.Resize( nLength );
+      szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
       mGlAbstraction.GetShaderInfoLog( shaderId, nLength, &nLength, szLog.Begin() );
       DALI_LOG_ERROR( "Shader Compiler Error: %s\n", szLog.Begin() );
     }
@@ -610,7 +607,7 @@ void Program::Link()
     if(nLength > 0)
     {
       Dali::Vector< char > szLog;
-      szLog.Resize( nLength );
+      szLog.Reserve( nLength ); // Don't call Resize as we don't want to initialise the data, just reserve a buffer
       mGlAbstraction.GetProgramInfoLog( mProgramId, nLength, &nLength, szLog.Begin() );
       DALI_LOG_ERROR( "Shader Link Error: %s\n", szLog.Begin() );
     }