summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_texture.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-05-13 10:17:12 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-05-13 10:24:24 +0900
commit748e6ad1b9f3345250a727178eed5e1ca3e9444a (patch)
tree65d4c32236a71eb73784805ac9a829a38a97130d /src/modules/evas/engines/gl_common/evas_gl_texture.c
parent3e31ad27da01044aba2568a6f7678e4f2f9dd74e (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c25
1 files changed, 11 insertions, 14 deletions
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 c92a37442c..20105cde51 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
604 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 604 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
605 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat); 605 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
606 606
607 glsym_glGenFramebuffers(1, &(pt->fb)); 607 if (ok)
608 GLERRV("glsym_glGenFramebuffers"); 608 {
609 glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb); 609 glsym_glGenFramebuffers(1, &(pt->fb));
610 GLERRV("glsym_glBindFramebuffer"); 610 glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
611 glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0); 611 glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
612 GLERRV("glsym_glFramebufferTexture2D"); 612 // note: should check fbo completeness
613 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum); 613 }
614 GLERRV("glsym_glBindFramebuffer");
615 614
615 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
616 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 616 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
617 617
618 if (!ok) 618 if (!ok)
@@ -798,7 +798,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
798 EGL_NO_CONTEXT, 798 EGL_NO_CONTEXT,
799 EGL_MAP_GL_TEXTURE_2D_SEC, 799 EGL_MAP_GL_TEXTURE_2D_SEC,
800 0, attr); 800 0, attr);
801 GLERRV("secsym_eglCreateImage");
802 if (!pt->dyn.img) goto error; 801 if (!pt->dyn.img) goto error;
803 802
804 if (secsym_eglGetImageAttribSEC(egldisplay, 803 if (secsym_eglGetImageAttribSEC(egldisplay,
@@ -842,7 +841,6 @@ error:
842 if (pt->dyn.img) 841 if (pt->dyn.img)
843 { 842 {
844 secsym_eglDestroyImage(egldisplay, pt->dyn.img); 843 secsym_eglDestroyImage(egldisplay, pt->dyn.img);
845 GLERRV("secsym_eglDestroyImage");
846 pt->dyn.img = NULL; 844 pt->dyn.img = NULL;
847 } 845 }
848 glBindTexture(GL_TEXTURE_2D, 0); 846 glBindTexture(GL_TEXTURE_2D, 0);
@@ -923,7 +921,6 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
923 if (pt->fb) 921 if (pt->fb)
924 { 922 {
925 glsym_glDeleteFramebuffers(1, &(pt->fb)); 923 glsym_glDeleteFramebuffers(1, &(pt->fb));
926 GLERRV("glsym_glDeleteFramebuffers");
927 pt->fb = 0; 924 pt->fb = 0;
928 } 925 }
929 EINA_LIST_FREE(pt->allocations, apt) 926 EINA_LIST_FREE(pt->allocations, apt)
@@ -1044,9 +1041,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1044 fmt = tex->pt->format; 1041 fmt = tex->pt->format;
1045 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1042 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1046 if (tex->gc->shared->info.unpack_row_length) 1043 if (tex->gc->shared->info.unpack_row_length)
1047 { 1044 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1048 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1049 }
1050 glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count); 1045 glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
1051 1046
1052// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h); 1047// 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
1117 1, im->cache_entry.h, 1112 1, im->cache_entry.h,
1118 fmt, tex->pt->dataformat, 1113 fmt, tex->pt->dataformat,
1119 im->image.data8 + (im->cache_entry.w - 1) * bytes_count); 1114 im->image.data8 + (im->cache_entry.w - 1) * bytes_count);
1115 //glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1120 } 1116 }
1121 else 1117 else
1122 { 1118 {
@@ -1155,6 +1151,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1155 fmt, tex->pt->dataformat, 1151 fmt, tex->pt->dataformat,
1156 tpix); 1152 tpix);
1157 } 1153 }
1154 //glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1158 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1155 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1159 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1156 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1160} 1157}