summaryrefslogtreecommitdiff
path: root/src/modules/evas
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2015-09-02 18:55:43 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-02 18:55:43 +0900
commit8fe5e277e5bea32b8547385963a1664d46279ecd (patch)
treeaf58e44806dd23968762a7c51a019e799a1460fd /src/modules/evas
parent1df1b23e21a9afdd8d761c68719c2e079c39bc2c (diff)
evas - fix texture context bind reset in gl common using wrong texture
evas gl common was simply resetting to the wrong texture id in the gl context struct - it was using pipe[0] not state.current. why i don't know. i know i wrote the pipe[0] code many years ago - really don';t know. it may have been a transitional piece of code that just happened t6o work 99% of the time that never got fixe when i added pipes. @fix
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c42
1 files changed, 21 insertions, 21 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 7e54283e11..f2451c3c5f 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -392,7 +392,7 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum
392 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);
393 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);
394 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);
395 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 395 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex);
396 if (!ok) 396 if (!ok)
397 { 397 {
398 glDeleteTextures(1, &(pt->texture)); 398 glDeleteTextures(1, &(pt->texture));
@@ -624,7 +624,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
624 } 624 }
625 625
626 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum); 626 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
627 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 627 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex);
628 628
629 if (!ok) 629 if (!ok)
630 { 630 {
@@ -692,7 +692,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
692 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 692 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
693 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 693 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
694 glBindTexture(im->native.target, 0); 694 glBindTexture(im->native.target, 0);
695 glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex); 695 glBindTexture(im->native.target, gc->state.current.cur_tex);
696 696
697 texinfo.n.num++; 697 texinfo.n.num++;
698 texinfo.n.pix += pt->w * pt->h; 698 texinfo.n.pix += pt->w * pt->h;
@@ -840,7 +840,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
840 goto error; 840 goto error;
841 } 841 }
842 842
843 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 843 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex);
844#else 844#else
845 if (gc + w + h + intformat + format) return pt; 845 if (gc + w + h + intformat + format) return pt;
846#endif 846#endif
@@ -927,8 +927,8 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
927#endif 927#endif
928 928
929 glDeleteTextures(1, &(pt->texture)); 929 glDeleteTextures(1, &(pt->texture));
930 if (pt->gc->pipe[0].shader.cur_tex == pt->texture) 930 if (pt->gc->state.current.cur_tex == pt->texture)
931 pt->gc->pipe[0].shader.cur_tex = 0; 931 pt->gc->state.current.cur_tex = 0;
932 if (pt->fb) 932 if (pt->fb)
933 { 933 {
934 glsym_glDeleteFramebuffers(1, &(pt->fb)); 934 glsym_glDeleteFramebuffers(1, &(pt->fb));
@@ -1163,8 +1163,8 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1163 tpix); 1163 tpix);
1164 } 1164 }
1165 //glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1165 //glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1166 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1166 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1167 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1167 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1168} 1168}
1169 1169
1170void 1170void
@@ -1262,9 +1262,9 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1262 im->image.data); 1262 im->image.data);
1263 } 1263 }
1264 1264
1265 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1265 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1266 { 1266 {
1267 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1267 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1268 } 1268 }
1269 return; 1269 return;
1270 } 1270 }
@@ -1383,8 +1383,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1383 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out); 1383 _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out);
1384 1384
1385 // Switch back to current texture 1385 // Switch back to current texture
1386 if (tex->ptt->texture != tex->gc->pipe[0].shader.cur_tex) 1386 if (tex->ptt->texture != tex->gc->state.current.cur_tex)
1387 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1387 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1388 1388
1389 // Now prepare uploading the main texture before returning; 1389 // Now prepare uploading the main texture before returning;
1390 async = malloc(sizeof (Evas_GL_Texture_Async_Preload)); 1390 async = malloc(sizeof (Evas_GL_Texture_Async_Preload));
@@ -1521,8 +1521,8 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
1521 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1521 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1522 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format, 1522 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
1523 tex->pt->dataformat, pixels); 1523 tex->pt->dataformat, pixels);
1524 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1524 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1525 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1525 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1526} 1526}
1527 1527
1528Evas_GL_Texture * 1528Evas_GL_Texture *
@@ -1696,7 +1696,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1696 } 1696 }
1697 } 1697 }
1698on_error: 1698on_error:
1699 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1699 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1700} 1700}
1701 1701
1702Evas_GL_Texture * 1702Evas_GL_Texture *
@@ -1878,8 +1878,8 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1878 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]); 1878 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
1879 } 1879 }
1880 } 1880 }
1881 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1881 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1882 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1882 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1883} 1883}
1884 1884
1885static Evas_GL_Texture * 1885static Evas_GL_Texture *
@@ -2047,8 +2047,8 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2047 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]); 2047 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
2048 } 2048 }
2049 2049
2050 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 2050 if (tex->pt->texture != tex->gc->state.current.cur_tex)
2051 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 2051 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
2052} 2052}
2053 2053
2054void 2054void
@@ -2102,8 +2102,8 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2102 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]); 2102 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
2103 } 2103 }
2104 } 2104 }
2105 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 2105 if (tex->pt->texture != tex->gc->state.current.cur_tex)
2106 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 2106 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
2107} 2107}
2108 2108
2109void 2109void