summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2015-09-02 18:55:43 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2015-09-02 17:27:55 +0530
commitfcd0d31235027641172c2735e0dea5e98fd42b5b (patch)
tree153f19030063d5a62615825c3cc722d7823d6f0a
parent6521c4128c9ec7015333e0c81487902e0ca7b4db (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
-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 f6d41dafa3..93eaabe9fc 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));
@@ -1509,8 +1509,8 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
1509 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1509 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1510 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format, 1510 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
1511 tex->pt->dataformat, pixels); 1511 tex->pt->dataformat, pixels);
1512 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1512 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1513 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1513 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1514} 1514}
1515 1515
1516Evas_GL_Texture * 1516Evas_GL_Texture *
@@ -1684,7 +1684,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1684 } 1684 }
1685 } 1685 }
1686on_error: 1686on_error:
1687 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1687 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1688} 1688}
1689 1689
1690Evas_GL_Texture * 1690Evas_GL_Texture *
@@ -1796,8 +1796,8 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1796 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]); 1796 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
1797 } 1797 }
1798 } 1798 }
1799 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1799 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1800 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1800 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1801} 1801}
1802 1802
1803static Evas_GL_Texture * 1803static Evas_GL_Texture *
@@ -1965,8 +1965,8 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
1965 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]); 1965 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
1966 } 1966 }
1967 1967
1968 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 1968 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1969 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 1969 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
1970} 1970}
1971 1971
1972void 1972void
@@ -2020,8 +2020,8 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2020 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]); 2020 _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
2021 } 2021 }
2022 } 2022 }
2023 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex) 2023 if (tex->pt->texture != tex->gc->state.current.cur_tex)
2024 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex); 2024 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex);
2025} 2025}
2026 2026
2027void 2027void