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-02-11 21:45:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-12 11:23:03 +0900
commit651f0ae2411cea5373bef091ac3b189adf98815a (patch)
tree5b135f4eb22c27e42162b92b9477640383bcdf6c /src/modules/evas/engines/gl_common/evas_gl_texture.c
parent9eaadb2eb764d1a9fac0ebdabca5432d0b0edf7d (diff)
Evas GL common: Improve code readability (simplify macro)
The exact same ugly macro would appear hundreds of times in the GL code: GLERR(__FUNCTION__, __FILE__, __LINE__, ""); Instead, override the common GL functions iif GL_ERRORS is defined. This greatly simplifies code and removes tons of useless lines. Also, this will give better debugging output as the exact code line is printed, and the function name is also printed. Also, fix linking to the glerr function. This is a code cleanup. Hopefully I didn't break anything with this big operation of find & replace.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c139
1 files changed, 23 insertions, 116 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 cee054afc2..c2af7f349b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -303,7 +303,6 @@ _tex_2d(Evas_Engine_GL_Context *gc, int intfmt, int w, int h, int fmt, int type)
303 glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL); 303 glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
304 else 304 else
305 glCompressedTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, sz, NULL); 305 glCompressedTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, sz, NULL);
306 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
307#ifdef GL_TEXTURE_INTERNAL_FORMAT 306#ifdef GL_TEXTURE_INTERNAL_FORMAT
308# ifdef GL_GLES 307# ifdef GL_GLES
309# else 308# else
@@ -387,20 +386,13 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum
387 pt->eina_pool = eina_rectangle_pool_new(w, h); 386 pt->eina_pool = eina_rectangle_pool_new(w, h);
388 387
389 glGenTextures(1, &(pt->texture)); 388 glGenTextures(1, &(pt->texture));
390 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
391 glBindTexture(GL_TEXTURE_2D, pt->texture); 389 glBindTexture(GL_TEXTURE_2D, pt->texture);
392 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
393 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 390 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
394 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
395 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 391 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
396 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
397 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 392 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
398 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
399 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 393 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
400 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
401 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat); 394 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
402 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 395 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
403 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
404 if (!ok) 396 if (!ok)
405 { 397 {
406 glDeleteTextures(1, &(pt->texture)); 398 glDeleteTextures(1, &(pt->texture));
@@ -602,30 +594,23 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
602#endif 594#endif
603 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fnum); 595 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fnum);
604 glGenTextures(1, &(pt->texture)); 596 glGenTextures(1, &(pt->texture));
605 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
606 glBindTexture(GL_TEXTURE_2D, pt->texture); 597 glBindTexture(GL_TEXTURE_2D, pt->texture);
607 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
608 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 598 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
609 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
610 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 599 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
611 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
612 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 600 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
613 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
614 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 601 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
615 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
616 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat); 602 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
617 603
618 glsym_glGenFramebuffers(1, &(pt->fb)); 604 glsym_glGenFramebuffers(1, &(pt->fb));
619 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 605 GLERRV("glsym_glGenFramebuffers");
620 glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb); 606 glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
621 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 607 GLERRV("glsym_glBindFramebuffer");
622 glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0); 608 glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
623 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 609 GLERRV("glsym_glFramebufferTexture2D");
624 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum); 610 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
625 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 611 GLERRV("glsym_glBindFramebuffer");
626 612
627 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 613 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
628 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
629 614
630 if (!ok) 615 if (!ok)
631 { 616 {
@@ -677,9 +662,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
677 pt->native = 1; 662 pt->native = 1;
678 pt->eina_pool = eina_rectangle_pool_new(w, h); 663 pt->eina_pool = eina_rectangle_pool_new(w, h);
679 glGenTextures(1, &(pt->texture)); 664 glGenTextures(1, &(pt->texture));
680 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
681 glBindTexture(im->native.target, pt->texture); 665 glBindTexture(im->native.target, pt->texture);
682 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
683 666
684#ifdef GL_GLES 667#ifdef GL_GLES
685#else 668#else
@@ -691,17 +674,11 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
691#endif 674#endif
692 675
693 glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 676 glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
694 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
695 glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 677 glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
696 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
697 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 678 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
698 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
699 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 679 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
700 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
701 glBindTexture(im->native.target, 0); 680 glBindTexture(im->native.target, 0);
702 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
703 glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex); 681 glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
704 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
705 682
706 texinfo.n.num++; 683 texinfo.n.num++;
707 texinfo.n.pix += pt->w * pt->h; 684 texinfo.n.pix += pt->w * pt->h;
@@ -760,17 +737,11 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
760 _print_tex_count(); 737 _print_tex_count();
761 738
762 glGenTextures(1, &(pt->texture)); 739 glGenTextures(1, &(pt->texture));
763 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
764 glBindTexture(GL_TEXTURE_2D, pt->texture); 740 glBindTexture(GL_TEXTURE_2D, pt->texture);
765 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
766 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 741 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
767 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
768 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 742 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
769 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
770 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 743 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
771 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
772 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 744 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
773 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
774 745
775 egldisplay = pt->gc->egldisp; 746 egldisplay = pt->gc->egldisp;
776 747
@@ -783,13 +754,11 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
783 EGL_NO_CONTEXT, 754 EGL_NO_CONTEXT,
784 EGL_MAP_GL_TEXTURE_2D_SEC, 755 EGL_MAP_GL_TEXTURE_2D_SEC,
785 0, attr); 756 0, attr);
786 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 757 GLERRV("secsym_eglCreateImage");
787 if (!pt->dyn.img) 758 if (!pt->dyn.img)
788 { 759 {
789 glBindTexture(GL_TEXTURE_2D, 0); 760 glBindTexture(GL_TEXTURE_2D, 0);
790 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
791 glDeleteTextures(1, &(pt->texture)); 761 glDeleteTextures(1, &(pt->texture));
792 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
793 if (pt->eina_pool) 762 if (pt->eina_pool)
794 eina_rectangle_pool_free(pt->eina_pool); 763 eina_rectangle_pool_free(pt->eina_pool);
795 free(pt); 764 free(pt);
@@ -820,7 +789,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
820 if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error; 789 if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error;
821 790
822 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 791 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
823 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
824#else 792#else
825 if (gc + w + h + intformat + format) return pt; 793 if (gc + w + h + intformat + format) return pt;
826#endif 794#endif
@@ -830,12 +798,10 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
830#ifdef GL_GLES 798#ifdef GL_GLES
831error: 799error:
832 secsym_eglDestroyImage(egldisplay, pt->dyn.img); 800 secsym_eglDestroyImage(egldisplay, pt->dyn.img);
833 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 801 GLERRV("secsym_eglDestroyImage");
834 pt->dyn.img = NULL; 802 pt->dyn.img = NULL;
835 glBindTexture(GL_TEXTURE_2D, 0); 803 glBindTexture(GL_TEXTURE_2D, 0);
836 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
837 glDeleteTextures(1, &(pt->texture)); 804 glDeleteTextures(1, &(pt->texture));
838 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
839 if (pt->eina_pool) 805 if (pt->eina_pool)
840 eina_rectangle_pool_free(pt->eina_pool); 806 eina_rectangle_pool_free(pt->eina_pool);
841 free(pt); 807 free(pt);
@@ -899,13 +865,12 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
899#endif 865#endif
900 866
901 glDeleteTextures(1, &(pt->texture)); 867 glDeleteTextures(1, &(pt->texture));
902 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
903 if (pt->gc->pipe[0].shader.cur_tex == pt->texture) 868 if (pt->gc->pipe[0].shader.cur_tex == pt->texture)
904 pt->gc->pipe[0].shader.cur_tex = 0; 869 pt->gc->pipe[0].shader.cur_tex = 0;
905 if (pt->fb) 870 if (pt->fb)
906 { 871 {
907 glsym_glDeleteFramebuffers(1, &(pt->fb)); 872 glsym_glDeleteFramebuffers(1, &(pt->fb));
908 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 873 GLERRV("glsym_glDeleteFramebuffers");
909 pt->fb = 0; 874 pt->fb = 0;
910 } 875 }
911 EINA_LIST_FREE(pt->allocations, apt) 876 EINA_LIST_FREE(pt->allocations, apt)
@@ -1025,14 +990,11 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1025 990
1026 fmt = tex->pt->format; 991 fmt = tex->pt->format;
1027 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 992 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1028 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1029 if (tex->gc->shared->info.unpack_row_length) 993 if (tex->gc->shared->info.unpack_row_length)
1030 { 994 {
1031 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 995 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1032 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1033 } 996 }
1034 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 997 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1035 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1036 998
1037// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h); 999// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
1038 // +-+ 1000 // +-+
@@ -1088,7 +1050,6 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1088 if (tex->gc->shared->info.unpack_row_length) 1050 if (tex->gc->shared->info.unpack_row_length)
1089 { 1051 {
1090 glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w); 1052 glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
1091 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1092 // |xxx 1053 // |xxx
1093 // |xxx 1054 // |xxx
1094 // 1055 //
@@ -1142,10 +1103,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1142 tpix); 1103 tpix);
1143 } 1104 }
1144 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1105 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1145 { 1106 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1146 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1147 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1148 }
1149} 1107}
1150 1108
1151void 1109void
@@ -1208,7 +1166,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1208 EINA_SAFETY_ON_FALSE_RETURN(!(width & 0x3) && !(height & 0x3)); 1166 EINA_SAFETY_ON_FALSE_RETURN(!(width & 0x3) && !(height & 0x3));
1209 1167
1210 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1168 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1211 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1212 1169
1213 if ((tex->gc->shared->info.etc1_subimage || 1170 if ((tex->gc->shared->info.etc1_subimage ||
1214 (im->cache_entry.space != EVAS_COLORSPACE_ETC1)) 1171 (im->cache_entry.space != EVAS_COLORSPACE_ETC1))
@@ -1226,7 +1183,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1226 err = glGetError(); 1183 err = glGetError();
1227 if (err != GL_NO_ERROR) 1184 if (err != GL_NO_ERROR)
1228 { 1185 {
1229 glerr(err, __FILE__, __FUNCTION__, __LINE__, "glCompressedTexSubImage2D"); 1186 __evas_gl_err(err, __FILE__, __FUNCTION__, __LINE__,
1187 "glCompressedTexSubImage2D");
1230 1188
1231 // FIXME: Changing settings on the fly. 1189 // FIXME: Changing settings on the fly.
1232 // The first texture will be black. 1190 // The first texture will be black.
@@ -1241,13 +1199,11 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1241 width, height, 0, 1199 width, height, 0,
1242 ((width * height) >> 4) * bsize, 1200 ((width * height) >> 4) * bsize,
1243 im->image.data); 1201 im->image.data);
1244 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1245 } 1202 }
1246 1203
1247 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1204 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1248 { 1205 {
1249 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1206 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1250 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1251 } 1207 }
1252 return; 1208 return;
1253 } 1209 }
@@ -1319,23 +1275,17 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1319 // Bind and upload ! Vooom ! 1275 // Bind and upload ! Vooom !
1320 fmt = tex->ptt->format; 1276 fmt = tex->ptt->format;
1321 glBindTexture(GL_TEXTURE_2D, tex->ptt->texture); 1277 glBindTexture(GL_TEXTURE_2D, tex->ptt->texture);
1322 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1323 if (tex->gc->shared->info.unpack_row_length) 1278 if (tex->gc->shared->info.unpack_row_length)
1324 { 1279 {
1325 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 1280 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1326 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1327 } 1281 }
1328 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1282 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1329 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1330 1283
1331 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out); 1284 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out);
1332 1285
1333 // Switch back to current texture 1286 // Switch back to current texture
1334 if (tex->ptt->texture != tex->gc->pipe[0].shader.cur_tex) 1287 if (tex->ptt->texture != tex->gc->pipe[0].shader.cur_tex)
1335 { 1288 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1336 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1337 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1338 }
1339 1289
1340 // Now prepare uploading the main texture before returning; 1290 // Now prepare uploading the main texture before returning;
1341 async = malloc(sizeof (Evas_GL_Texture_Async_Preload)); 1291 async = malloc(sizeof (Evas_GL_Texture_Async_Preload));
@@ -1453,21 +1403,15 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
1453{ 1403{
1454 if (!tex->pt) return; 1404 if (!tex->pt) return;
1455 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1405 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1456 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1457 if (tex->gc->shared->info.unpack_row_length) 1406 if (tex->gc->shared->info.unpack_row_length)
1458 { 1407 {
1459 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 1408 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1460 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1461 } 1409 }
1462 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1410 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1463 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1464 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format, 1411 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
1465 tex->pt->dataformat, pixels); 1412 tex->pt->dataformat, pixels);
1466 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1413 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1467 { 1414 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1468 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1469 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1470 }
1471} 1415}
1472 1416
1473Evas_GL_Texture * 1417Evas_GL_Texture *
@@ -1560,11 +1504,9 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1560 if (!subimage || tex->gc->shared->info.unpack_row_length) 1504 if (!subimage || tex->gc->shared->info.unpack_row_length)
1561 { 1505 {
1562 if (tex->gc->shared->info.unpack_row_length) 1506 if (tex->gc->shared->info.unpack_row_length)
1563 { 1507 glPixelStorei(GL_UNPACK_ROW_LENGTH, w);
1564 glPixelStorei(GL_UNPACK_ROW_LENGTH, w); GLERRLOG(); 1508 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1565 } 1509 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1566 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); GLERRLOG();
1567 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); GLERRLOG();
1568 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1510 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1569 goto on_error; 1511 goto on_error;
1570 if (upload) 1512 if (upload)
@@ -1574,7 +1516,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1574 else 1516 else
1575 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1); 1517 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
1576 } 1518 }
1577 glBindTexture(GL_TEXTURE_2D, tex->pta->texture); GLERRLOG(); 1519 glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
1578 if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format, tex->pta->dataformat)) 1520 if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format, tex->pta->dataformat))
1579 goto on_error; 1521 goto on_error;
1580 if (upload) 1522 if (upload)
@@ -1589,8 +1531,8 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1589 { 1531 {
1590 int y; 1532 int y;
1591 1533
1592 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); GLERRLOG(); 1534 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1593 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); GLERRLOG(); 1535 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1594 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, 1536 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format,
1595 tex->pt->dataformat)) 1537 tex->pt->dataformat))
1596 goto on_error; 1538 goto on_error;
@@ -1616,7 +1558,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1616 } 1558 }
1617 } 1559 }
1618 1560
1619 glBindTexture(GL_TEXTURE_2D, tex->pta->texture); GLERRLOG(); 1561 glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
1620 if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format, 1562 if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format,
1621 tex->pta->dataformat)) 1563 tex->pta->dataformat))
1622 goto on_error; 1564 goto on_error;
@@ -1643,7 +1585,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1643 } 1585 }
1644 } 1586 }
1645on_error: 1587on_error:
1646 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); GLERRLOG(); 1588 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1647} 1589}
1648 1590
1649Evas_GL_Texture * 1591Evas_GL_Texture *
@@ -1701,25 +1643,18 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1701 if (tex->gc->shared->info.unpack_row_length) 1643 if (tex->gc->shared->info.unpack_row_length)
1702 { 1644 {
1703 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]); 1645 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
1704 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1705 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 1646 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1706 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1707 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1647 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1708 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1709 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1648 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1710 return; 1649 return;
1711 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]); 1650 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1712 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture); 1651 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
1713 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1714 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]); 1652 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
1715 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1716 if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat)) 1653 if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat))
1717 return; 1654 return;
1718 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]); 1655 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
1719 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture); 1656 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
1720 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1721 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]); 1657 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
1722 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1723 if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat)) 1658 if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat))
1724 return; 1659 return;
1725 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]); 1660 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
@@ -1729,9 +1664,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1729 unsigned int y; 1664 unsigned int y;
1730 1665
1731 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 1666 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1732 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1733 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1667 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1734 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1735 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1668 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1736 return; 1669 return;
1737 if ((rows[1] - rows[0]) == (int)w) 1670 if ((rows[1] - rows[0]) == (int)w)
@@ -1743,7 +1676,6 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1743 } 1676 }
1744 1677
1745 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture); 1678 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
1746 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1747 if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat)) 1679 if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat))
1748 return; 1680 return;
1749 if ((rows[h + 1] - rows[h]) == (int)(w / 2)) 1681 if ((rows[h + 1] - rows[h]) == (int)(w / 2))
@@ -1755,7 +1687,6 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1755 } 1687 }
1756 1688
1757 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture); 1689 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
1758 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1759 if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat)) 1690 if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat))
1760 return; 1691 return;
1761 if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2)) 1692 if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
@@ -1767,10 +1698,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1767 } 1698 }
1768 } 1699 }
1769 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1700 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1770 { 1701 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1771 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1772 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1773 }
1774} 1702}
1775 1703
1776static Evas_GL_Texture * 1704static Evas_GL_Texture *
@@ -1910,9 +1838,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1910 tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source]; 1838 tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
1911 1839
1912 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 1840 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1913 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1914 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1841 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1915 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1916 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1842 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1917 return; 1843 return;
1918 if ((rows[1] - rows[0]) == (int)w * 4) 1844 if ((rows[1] - rows[0]) == (int)w * 4)
@@ -1924,7 +1850,6 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1924 } 1850 }
1925 1851
1926 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture); 1852 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1927 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1928 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat)) 1853 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat))
1929 return; 1854 return;
1930#if 0 1855#if 0
@@ -1942,10 +1867,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1942 } 1867 }
1943 1868
1944 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1869 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1945 { 1870 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1946 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1947 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1948 }
1949} 1871}
1950 1872
1951void 1873void
@@ -1961,18 +1883,13 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1961 if (tex->gc->shared->info.unpack_row_length) 1883 if (tex->gc->shared->info.unpack_row_length)
1962 { 1884 {
1963 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]); 1885 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
1964 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1965 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 1886 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1966 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1967 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1887 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1968 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1969 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1888 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1970 return; 1889 return;
1971 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]); 1890 _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1972 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture); 1891 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1973 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1974 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]); 1892 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
1975 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1976 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat)) 1893 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat))
1977 return; 1894 return;
1978 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]); 1895 _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
@@ -1982,9 +1899,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1982 unsigned int y; 1899 unsigned int y;
1983 1900
1984 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 1901 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1985 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1986 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1902 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1987 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1988 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 1903 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
1989 return; 1904 return;
1990 if ((rows[1] - rows[0]) == (int)w) 1905 if ((rows[1] - rows[0]) == (int)w)
@@ -1996,7 +1911,6 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1996 } 1911 }
1997 1912
1998 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture); 1913 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1999 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2000 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat)) 1914 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat))
2001 return; 1915 return;
2002 if ((rows[h + 1] - rows[h]) == (int)(w / 2)) 1916 if ((rows[h + 1] - rows[h]) == (int)(w / 2))
@@ -2008,10 +1922,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2008 } 1922 }
2009 } 1923 }
2010 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1924 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
2011 { 1925 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
2012 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
2013 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2014 }
2015} 1926}
2016 1927
2017void 1928void
@@ -2169,10 +2080,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
2169#endif 2080#endif
2170 2081
2171 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); 2082 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
2172 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2173
2174 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 2083 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
2175 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2176 2084
2177 // We are telling the driver to not swizzle back the buffer as we are going to replace all pixel 2085 // We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
2178 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat)) 2086 if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat))
@@ -2220,7 +2128,6 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
2220 } 2128 }
2221 2129
2222 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture); 2130 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
2223 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2224 2131
2225 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat)) 2132 if (!_tex_2d(tex->gc, tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat))
2226 return; 2133 return;