jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=748e6ad1b9f3345250a727178eed5e1ca3e9444a

commit 748e6ad1b9f3345250a727178eed5e1ca3e9444a
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed May 13 10:17:12 2015 +0900

    Evas GL common: Add very basic GL calls tracing method
    
    Rewrap the GL calls to print them out. The arguments are not
    interpreted. See the GL_ERRORS #define.
---
 .../evas/engines/gl_common/evas_gl_common.h        | 126 +++++++++++++--------
 .../evas/engines/gl_common/evas_gl_context.c       |  45 ++++++--
 .../evas/engines/gl_common/evas_gl_shader.c        |   8 +-
 .../evas/engines/gl_common/evas_gl_texture.c       |  25 ++--
 4 files changed, 123 insertions(+), 81 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h 
b/src/modules/evas/engines/gl_common/evas_gl_common.h
index adc2ba2..1875624 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -966,7 +966,10 @@ void evas_gl_preload_target_unregister(Evas_GL_Texture 
*tex, Eo *target);
 
 void pt_unref(Evas_GL_Texture_Pool *pt);
 
+// Enable GL errors logging
 //#define GL_ERRORS 1
+// Enable very basic GL calls logging (requires GL_ERRORS)
+//#define GL_ERRORS_TRACE 1
 
 #ifdef GL_ERRORS
 #include <dlfcn.h>
@@ -985,56 +988,79 @@ __evas_gl_errdyn(int err, const char *file, const char 
*func, int line, const ch
    }
 /* Redefine common gl funcs */
 # ifndef GL_ERRORS_NODEF
-#  define glActiveTexture(...) do { glActiveTexture(__VA_ARGS__); 
GLERRV("glActiveTexture"); } while(0)
-#  define glBindAttribLocation(...) do { glBindAttribLocation(__VA_ARGS__); 
GLERRV("glBindAttribLocation"); } while(0)
-#  define glBindBuffer(...) do { glBindBuffer(__VA_ARGS__); 
GLERRV("glBindBuffer"); } while(0)
-#  define glBindTexture(...) do { glBindTexture(__VA_ARGS__); 
GLERRV("glBindTexture"); } while(0)
-#  define glBlendFunc(...) do { glBlendFunc(__VA_ARGS__); 
GLERRV("glBlendFunc"); } while(0)
-#  define glBufferData(...) do { glBufferData(__VA_ARGS__); 
GLERRV("glBufferData"); } while(0)
-#  define glCompressedTexSubImage2D(...) do { 
glCompressedTexSubImage2D(__VA_ARGS__); GLERRV("glCompressedTexSubImage2D"); } 
while(0)
-#  define glDeleteBuffers(...) do { glDeleteBuffers(__VA_ARGS__); 
GLERRV("glDeleteBuffers"); } while(0)
-#  define glDepthMask(...) do { glDepthMask(__VA_ARGS__); 
GLERRV("glDepthMask"); } while(0)
-#  define glDisable(...) do { glDisable(__VA_ARGS__); GLERRV("glDisable"); } 
while(0)
-#  define glDisableVertexAttribArray(...) do { 
glDisableVertexAttribArray(__VA_ARGS__); GLERRV("glDisableVertexAttribArray"); 
} while(0)
-#  define glDrawArrays(...) do { glDrawArrays(__VA_ARGS__); 
GLERRV("glDrawArrays"); } while(0)
-#  define glEnable(...) do { glEnable(__VA_ARGS__); GLERRV("glEnable"); } 
while(0)
-#  define glEnableVertexAttribArray(...) do { 
glEnableVertexAttribArray(__VA_ARGS__); GLERRV("glEnableVertexAttribArray"); } 
while(0)
-#  define glGenBuffers(...) do { glGenBuffers(__VA_ARGS__); 
GLERRV("glGenBuffers"); } while(0)
-#  define glGetFloatv(...) do { glGetFloatv(__VA_ARGS__); 
GLERRV("glGetFloatv"); } while(0)
-#  define glGetIntegerv(...) do { glGetIntegerv(__VA_ARGS__); 
GLERRV("glGetIntegerv"); } while(0)
-#  define glGetUniformLocation(...) ({ GLint _x = 
glGetUniformLocation(__VA_ARGS__); GLERRV("glGetUniformLocation"); _x; })
-#  define glHint(...) do { glHint(__VA_ARGS__); GLERRV("glHint"); } while(0)
-#  define glReadPixels(...) do { glReadPixels(__VA_ARGS__); 
GLERRV("glReadPixels"); } while(0)
-#  define glScissor(...) do { glScissor(__VA_ARGS__); GLERRV("glScissor"); } 
while(0)
-#  define glGenFramebuffers(...) do { glGenFramebuffers(__VA_ARGS__); 
GLERRV("glGenFramebuffers"); } while(0)
-#  define glBindFramebuffer(...) do { glBindFramebuffer(__VA_ARGS__); 
GLERRV("glBindFramebuffer"); } while(0)
-#  define glEndTiling(...) do { glEndTiling(__VA_ARGS__); 
GLERRV("glEndTiling"); } while(0)
-#  define glGetProgramBinary(...) do { glGetProgramBinary(__VA_ARGS__); 
GLERRV("glGetProgramBinary"); } while(0)
-#  define glMapBuffer(...) ({ void *_x = glMapBuffer(__VA_ARGS__); 
GLERRV("glMapBuffer"); _x; })
-#  define glStartTiling(...) do { glStartTiling(__VA_ARGS__); 
GLERRV("glStartTiling"); } while(0)
-#  define glUnmapBuffer(...) do { glUnmapBuffer(__VA_ARGS__); 
GLERRV("glUnmapBuffer"); } while(0)
-#  define glTexParameterf(...) do { glTexParameterf(__VA_ARGS__); 
GLERRV("glTexParameterf"); } while(0)
-#  define glTexParameteri(...) do { glTexParameteri(__VA_ARGS__); 
GLERRV("glTexParameteri"); } while(0)
-#  define glTexSubImage2D(...) do { glTexSubImage2D(__VA_ARGS__); 
GLERRV("glTexSubImage2D"); } while(0)
-#  define glUniform1f(...) do { glUniform1f(__VA_ARGS__); 
GLERRV("glUniform1f"); } while(0)
-#  define glUniform1i(...) do { glUniform1i(__VA_ARGS__); 
GLERRV("glUniform1i"); } while(0)
-#  define glUniform2fv(...) do { glUniform2fv(__VA_ARGS__); 
GLERRV("glUniform2fv"); } while(0)
-#  define glUniform4fv(...) do { glUniform4fv(__VA_ARGS__); 
GLERRV("glUniform4fv"); } while(0)
-#  define glUniformMatrix4fv(...) do { glUniformMatrix4fv(__VA_ARGS__); 
GLERRV("glUniformMatrix4fv"); } while(0)
-#  define glUseProgram(...) do { glUseProgram(__VA_ARGS__); 
GLERRV("glUseProgram"); } while(0)
-#  define glVertexAttribPointer(...) do { glVertexAttribPointer(__VA_ARGS__); 
GLERRV("glVertexAttribPointer"); } while(0)
-#  define glViewport(...) do { glViewport(__VA_ARGS__); GLERRV("glViewport"); 
} while(0)
-#  define glPixelStorei(...) do { glPixelStorei(__VA_ARGS__); 
GLERRV("glPixelStorei"); } while(0)
-#  define glCompressedTexImage2D(...) do { 
glCompressedTexImage2D(__VA_ARGS__); GLERRV("glCompressedTexImage2D"); } 
while(0)
-#  define glCreateShader(...) ({ GLuint _x = glCreateShader(__VA_ARGS__); 
GLERRV("glCreateShader"); _x; })
-#  define glCreateProgram(...) ({ GLuint _x = glCreateProgram(__VA_ARGS__); 
GLERRV("glCreateProgram"); _x; })
-#  define glAttachShader(...) do { glAttachShader(__VA_ARGS__); 
GLERRV("glAttachShader"); } while(0)
-#  define glLinkProgram(...) do { glLinkProgram(__VA_ARGS__); 
GLERRV("glLinkProgram"); } while(0)
-#  define glGetProgramiv(...) do { glGetProgramiv(__VA_ARGS__); 
GLERRV("glGetProgramiv"); } while(0)
-#  define glGetProgramInfoLog(...) do { glGetProgramInfoLog(__VA_ARGS__); 
GLERRV("glGetProgramInfoLog"); } while(0)
-#  define glGetShaderiv(...) do { glGetShaderiv(__VA_ARGS__); 
GLERRV("glGetShaderiv"); } while(0)
-#  define glShaderSource(...) do { glShaderSource(__VA_ARGS__); 
GLERRV("glShaderSource"); } while(0)
-#  define glCompileShader(...) do { glCompileShader(__VA_ARGS__); 
GLERRV("glCompileShader"); } while(0)
+#  ifndef GL_ERRORS_TRACE
+#   define GL_ERROR_TRACE(f, _args, ...) do { f(__VA_ARGS__); GLERRV(#f); } 
while(0)
+#   define GL_ERROR_TRACE_RET(t, f, _args, ...) ({ t _r = f(__VA_ARGS__); 
GLERRV(#f); _r; })
+#  else
+#   define GL_ERROR_TRACE(f, _args, ...) do { DBG("%s(%s);", #f, _args); 
f(__VA_ARGS__); GLERRV(#f); } while(0)
+#   define GL_ERROR_TRACE_RET(t, f, _args, ...) ({ t _r; DBG("%s(%s);", #f, 
_args); _r = f(__VA_ARGS__); GLERRV(#f); _r; })
+#  endif
+#  define glActiveTexture(...) GL_ERROR_TRACE(glActiveTexture, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glBindAttribLocation(...) GL_ERROR_TRACE(glBindAttribLocation, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glBindBuffer(...) GL_ERROR_TRACE(glBindBuffer, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glBindTexture(...) GL_ERROR_TRACE(glBindTexture, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glBlendFunc(...) GL_ERROR_TRACE(glBlendFunc, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glBufferData(...) GL_ERROR_TRACE(glBufferData, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glCompressedTexSubImage2D(...) 
GL_ERROR_TRACE(glCompressedTexSubImage2D, #__VA_ARGS__, __VA_ARGS__)
+#  define glDeleteBuffers(...) GL_ERROR_TRACE(glDeleteBuffers, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glDepthMask(...) GL_ERROR_TRACE(glDepthMask, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glDisable(...) GL_ERROR_TRACE(glDisable, #__VA_ARGS__, __VA_ARGS__)
+#  define glDisableVertexAttribArray(...) 
GL_ERROR_TRACE(glDisableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
+#  define glDrawArrays(...) GL_ERROR_TRACE(glDrawArrays, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glEnable(...) GL_ERROR_TRACE(glEnable, #__VA_ARGS__, __VA_ARGS__)
+#  define glEnableVertexAttribArray(...) 
GL_ERROR_TRACE(glEnableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
+#  define glGenBuffers(...) GL_ERROR_TRACE(glGenBuffers, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetFloatv(...) GL_ERROR_TRACE(glGetFloatv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetIntegerv(...) GL_ERROR_TRACE(glGetIntegerv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetUniformLocation(...) GL_ERROR_TRACE_RET(GLuint, 
glGetUniformLocation, #__VA_ARGS__, __VA_ARGS__)
+#  define glHint(...) GL_ERROR_TRACE(glHint, #__VA_ARGS__, __VA_ARGS__)
+#  define glReadPixels(...) GL_ERROR_TRACE(glReadPixels, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glScissor(...) GL_ERROR_TRACE(glScissor, #__VA_ARGS__, __VA_ARGS__)
+#  define glGenFramebuffers(...) GL_ERROR_TRACE(glGenFramebuffers, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glBindFramebuffer(...) GL_ERROR_TRACE(glBindFramebuffer, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glEndTiling(...) GL_ERROR_TRACE(glEndTiling, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetProgramBinary(...) GL_ERROR_TRACE(glGetProgramBinary, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glMapBuffer, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glStartTiling(...) GL_ERROR_TRACE(glStartTiling, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUnmapBuffer(...) GL_ERROR_TRACE(glUnmapBuffer, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glTexParameterf(...) GL_ERROR_TRACE(glTexParameterf, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glTexParameteri(...) GL_ERROR_TRACE(glTexParameteri, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glTexSubImage2D(...) GL_ERROR_TRACE(glTexSubImage2D, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUniform1f(...) GL_ERROR_TRACE(glUniform1f, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUniform1i(...) GL_ERROR_TRACE(glUniform1i, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUniform2fv(...) GL_ERROR_TRACE(glUniform2fv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUniform4fv(...) GL_ERROR_TRACE(glUniform4fv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glUniformMatrix4fv(...) GL_ERROR_TRACE(glUniformMatrix4fv, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glUseProgram(...) GL_ERROR_TRACE(glUseProgram, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glVertexAttribPointer(...) GL_ERROR_TRACE(glVertexAttribPointer, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glViewport(...) GL_ERROR_TRACE(glViewport, #__VA_ARGS__, __VA_ARGS__)
+#  define glPixelStorei(...) GL_ERROR_TRACE(glPixelStorei, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glCompressedTexImage2D(...) GL_ERROR_TRACE(glCompressedTexImage2D, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glCreateShader(...) GL_ERROR_TRACE_RET(GLuint, glCreateShader, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glCreateProgram(...) GL_ERROR_TRACE_RET(GLuint, glCreateProgram, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glAttachShader(...) GL_ERROR_TRACE(glAttachShader, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glLinkProgram(...) GL_ERROR_TRACE(glLinkProgram, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetProgramiv(...) GL_ERROR_TRACE(glGetProgramiv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glGetProgramInfoLog(...) GL_ERROR_TRACE(glGetProgramInfoLog, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glGetShaderiv(...) GL_ERROR_TRACE(glGetShaderiv, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glShaderSource(...) GL_ERROR_TRACE(glShaderSource, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glCompileShader(...) GL_ERROR_TRACE(glCompileShader, #__VA_ARGS__, 
__VA_ARGS__)
+#  define glsym_glGenFramebuffers(...) GL_ERROR_TRACE(glsym_glGenFramebuffers, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glBindFramebuffer(...) GL_ERROR_TRACE(glsym_glBindFramebuffer, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glFramebufferTexture2D(...) 
GL_ERROR_TRACE(glsym_glFramebufferTexture2D, #__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glDeleteFramebuffers(...) 
GL_ERROR_TRACE(glsym_glDeleteFramebuffers, #__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glGetProgramBinary(...) 
GL_ERROR_TRACE(glsym_glGetProgramBinary, #__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glProgramBinary(...) GL_ERROR_TRACE(glsym_glProgramBinary, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glProgramParameteri(...) 
GL_ERROR_TRACE(glsym_glProgramParameteri, #__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glReleaseShaderCompiler(...) 
GL_ERROR_TRACE(glsym_glReleaseShaderCompiler, #__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glsym_glMapBuffer, 
#__VA_ARGS__, __VA_ARGS__)
+#  define glsym_glUnmapBuffer(...) GL_ERROR_TRACE_RET(unsigned int, 
glsym_glUnmapBuffer, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_eglCreateImage(...) GL_ERROR_TRACE_RET(void *, 
secsym_eglCreateImage, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_eglDestroyImage(...) GL_ERROR_TRACE_RET(unsigned int, 
secsym_eglDestroyImage, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_glEGLImageTargetTexture2DOES(...) 
GL_ERROR_TRACE(secsym_glEGLImageTargetTexture2DOES, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_eglMapImageSEC(...) GL_ERROR_TRACE_RET(void *, 
secsym_eglMapImageSEC, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_eglUnmapImageSEC(...) GL_ERROR_TRACE_RET(unsigned int, 
secsym_eglUnmapImageSEC, #__VA_ARGS__, __VA_ARGS__)
+#  define secsym_eglGetImageAttribSEC(...) GL_ERROR_TRACE_RET(unsigned int, 
secsym_eglGetImageAttribSEC, #__VA_ARGS__, __VA_ARGS__)
 # endif
 #else
 # define GLERRV(op)
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c 
b/src/modules/evas/engines/gl_common/evas_gl_context.c
index 97d5c32..e37306a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -271,6 +271,39 @@ __evas_gl_err(int err, const char *file, const char *func, 
int line, const char
      case GL_OUT_OF_MEMORY:
         errmsg = "GL_OUT_OF_MEMORY";
         break;
+#ifdef GL_INVALID_FRAMEBUFFER_OPERATION
+     case GL_INVALID_FRAMEBUFFER_OPERATION:
+        {
+           GLenum e = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+           switch (e)
+             {
+#ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+              case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
+                errmsg = "GL_INVALID_FRAMEBUFFER_OPERATION: 
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT";
+                break;
+#endif
+#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
+              case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
+                errmsg = "GL_INVALID_FRAMEBUFFER_OPERATION: 
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS";
+                break;
+#endif
+#ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
+              case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
+                errmsg = "GL_INVALID_FRAMEBUFFER_OPERATION: 
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";
+                break;
+#endif
+#ifdef GL_FRAMEBUFFER_UNSUPPORTED
+              case GL_FRAMEBUFFER_UNSUPPORTED:
+                errmsg = "GL_INVALID_FRAMEBUFFER_OPERATION: 
GL_FRAMEBUFFER_UNSUPPORTED";
+                break;
+#endif
+              default:
+                errmsg = "GL_INVALID_FRAMEBUFFER_OPERATION";
+                break;
+             }
+           break;
+        }
+#endif
      default:
         snprintf(buf, sizeof(buf), "%#x", err);
         errmsg = buf;
@@ -1204,15 +1237,9 @@ 
evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
 # endif
 #endif
    if (gc->pipe[0].shader.surface == gc->def_surface)
-     {
-        glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
-        GLERRV("glsym_glBindFramebuffer");
-     }
+     glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
    else
-     {
-        glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
-        GLERRV("glsym_glBindFramebuffer");
-     }
+      glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
    _evas_gl_common_viewport_set(gc);
 }
 
@@ -3174,7 +3201,6 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
              gc->pipe[i].array.buffer_use++;
 
              x = glsym_glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
-             GLERRV("glsym_glMapBuffer");
              if (x)
                {
                   if (gc->pipe[i].array.use_vertex)
@@ -3209,7 +3235,6 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                           gc->pipe[i].array.use_texm);
  */
                   glsym_glUnmapBuffer(GL_ARRAY_BUFFER);
-                  GLERRV("glsym_glUnmapBuffer");
                }
           }
         else
diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c 
b/src/modules/evas/engines/gl_common/evas_gl_shader.c
index 4b87779..d8f430a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_shader.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c
@@ -70,7 +70,6 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
    glAttachShader(p->prog, p->frag);
 #endif
    glsym_glProgramBinary(p->prog, formats[0], data, length);
-   GLERRV("glsym_glProgramBinary");
 
    glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
    glBindAttribLocation(p->prog, SHAD_COLOR,  "color");
@@ -120,7 +119,6 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program 
*p,
    if (!data) return 0;
 
    glsym_glGetProgramBinary(p->prog, length, &size, &format, data);
-   GLERRV("glsym_glGetProgramBinary");
 
    if (length != size)
      {
@@ -178,7 +176,6 @@ _evas_gl_common_shader_program_source_init(Evas_GL_Program 
*p,
      {
         glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
                                   GL_TRUE);
-        GLERRV("glsym_glProgramParameteri");
      }
 #endif
    glAttachShader(p->prog, p->vert);
@@ -340,10 +337,7 @@ evas_gl_common_shader_program_init_done(void)
    glReleaseShaderCompiler();
 #else
    if (glsym_glReleaseShaderCompiler)
-     {
-        glsym_glReleaseShaderCompiler();
-        GLERRV("glsym_glReleaseShaderCompiler");
-     }
+     glsym_glReleaseShaderCompiler();
 #endif
 }
 
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c 
b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index c92a374..20105cd 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -604,15 +604,15 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, 
int h, int intformat, in
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
 
-   glsym_glGenFramebuffers(1, &(pt->fb));
-   GLERRV("glsym_glGenFramebuffers");
-   glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
-   GLERRV("glsym_glBindFramebuffer");
-   glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D, pt->texture, 0);
-   GLERRV("glsym_glFramebufferTexture2D");
-   glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
-   GLERRV("glsym_glBindFramebuffer");
+   if (ok)
+     {
+        glsym_glGenFramebuffers(1, &(pt->fb));
+        glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
+        glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D, pt->texture, 0);
+        // note: should check fbo completeness
+     }
 
+   glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
    glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
 
    if (!ok)
@@ -798,7 +798,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, 
int h, int intformat, i
                                             EGL_NO_CONTEXT,
                                             EGL_MAP_GL_TEXTURE_2D_SEC,
                                             0, attr);
-        GLERRV("secsym_eglCreateImage");
         if (!pt->dyn.img) goto error;
 
         if (secsym_eglGetImageAttribSEC(egldisplay,
@@ -842,7 +841,6 @@ error:
   if (pt->dyn.img)
     {
        secsym_eglDestroyImage(egldisplay, pt->dyn.img);
-       GLERRV("secsym_eglDestroyImage");
        pt->dyn.img = NULL;
     }
   glBindTexture(GL_TEXTURE_2D, 0);
@@ -923,7 +921,6 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
    if (pt->fb)
      {
         glsym_glDeleteFramebuffers(1, &(pt->fb));
-        GLERRV("glsym_glDeleteFramebuffers");
         pt->fb = 0;
      }
     EINA_LIST_FREE(pt->allocations, apt)
@@ -1044,9 +1041,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, 
RGBA_Image *im, unsigned int
    fmt = tex->pt->format;
    glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
    if (tex->gc->shared->info.unpack_row_length)
-     {
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-     }
+     glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
    glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
 
 //   printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
@@ -1117,6 +1112,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, 
RGBA_Image *im, unsigned int
                     1, im->cache_entry.h,
                     fmt, tex->pt->dataformat,
                     im->image.data8 + (im->cache_entry.w - 1) * bytes_count);
+        //glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
      }
    else
      {
@@ -1155,6 +1151,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, 
RGBA_Image *im, unsigned int
                     fmt, tex->pt->dataformat,
                     tpix);
      }
+   //glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
    if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
      glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
 }

-- 


Reply via email to