summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongyeon Kim <dy5.kim@samsung.com>2015-11-12 13:56:17 +0900
committerDongyeon Kim <dy5.kim@samsung.com>2015-11-12 13:56:17 +0900
commit7db0e2066108c2ee78afd317727b581d1d7e8342 (patch)
tree91db9ede5484c2eb35447756efcd7d01f6fb3a5c
parent16eb3942bb1f81fc56e4314f0a09b6b00b7aa0d7 (diff)
evas/gl: Bind texture with external target for tbm surface
egl images created using tbm surface for native surface set use GL_TEXTURE_EXTERNAL_OES as texture target, so we should bind to this target when rendering. Dynamic hint set using tbm surface also creates egl images, but as we only use RGB* colorspace for this we can use GL_TEXTURE_2D. So, keep track of texture target in shader array, and bind to the appropriate one. This also fixes the bug that image_data_get only worked when BOTH sec_image_map and sec_tbm_surface extensions are supported.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h3
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c21
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c45
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c8
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c10
5 files changed, 48 insertions, 39 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 5fd8775093..202e81bc8a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -253,6 +253,7 @@ struct _Evas_Engine_GL_Context
253 struct { 253 struct {
254 Evas_GL_Program *prog; 254 Evas_GL_Program *prog;
255 GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm; 255 GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm;
256 int tex_target;
256 int render_op; 257 int render_op;
257 int cx, cy, cw, ch; 258 int cx, cy, cw, ch;
258 int smooth; 259 int smooth;
@@ -282,6 +283,7 @@ struct _Evas_Engine_GL_Context
282 Evas_GL_Image *surface; 283 Evas_GL_Image *surface;
283 GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm; 284 GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm;
284 void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn; 285 void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn;
286 int tex_target;
285 int render_op; 287 int render_op;
286 int cx, cy, cw, ch; 288 int cx, cy, cw, ch;
287 int smooth; 289 int smooth;
@@ -355,6 +357,7 @@ struct _Evas_GL_Texture_Pool
355 int w, h; 357 int w, h;
356 int stride; 358 int stride;
357 int checked_out; 359 int checked_out;
360 int target;
358 } dyn; 361 } dyn;
359 Eina_List *allocations; 362 Eina_List *allocations;
360 Eina_Rectangle_Pool *eina_pool; 363 Eina_Rectangle_Pool *eina_pool;
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 d39be5ae77..dc33384ffb 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -1071,6 +1071,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
1071 gc->state.current.cur_texv = 0; 1071 gc->state.current.cur_texv = 0;
1072 gc->state.current.cur_texa = 0; 1072 gc->state.current.cur_texa = 0;
1073 gc->state.current.cur_texm = 0; 1073 gc->state.current.cur_texm = 0;
1074 gc->state.current.tex_target = GL_TEXTURE_2D;
1074 gc->state.current.render_op = 0; 1075 gc->state.current.render_op = 0;
1075 gc->state.current.smooth = 0; 1076 gc->state.current.smooth = 0;
1076 gc->state.current.blend = 0; 1077 gc->state.current.blend = 0;
@@ -1099,6 +1100,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
1099 gc->pipe[i].shader.cur_texv = 0; 1100 gc->pipe[i].shader.cur_texv = 0;
1100 gc->pipe[i].shader.cur_texa = 0; 1101 gc->pipe[i].shader.cur_texa = 0;
1101 gc->pipe[i].shader.cur_texm = 0; 1102 gc->pipe[i].shader.cur_texm = 0;
1103 gc->pipe[i].shader.tex_target = GL_TEXTURE_2D;
1102 gc->pipe[i].shader.render_op = EVAS_RENDER_BLEND; 1104 gc->pipe[i].shader.render_op = EVAS_RENDER_BLEND;
1103 gc->pipe[i].shader.smooth = 0; 1105 gc->pipe[i].shader.smooth = 0;
1104 gc->pipe[i].shader.blend = 0; 1106 gc->pipe[i].shader.blend = 0;
@@ -1137,7 +1139,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
1137 glUseProgram(gc->state.current.prog->prog); 1139 glUseProgram(gc->state.current.prog->prog);
1138 1140
1139 glActiveTexture(GL_TEXTURE0); 1141 glActiveTexture(GL_TEXTURE0);
1140 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); 1142 glBindTexture(gc->pipe[0].shader.tex_target, gc->pipe[0].shader.cur_tex);
1141 1143
1142 _evas_gl_common_viewport_set(gc); 1144 _evas_gl_common_viewport_set(gc);
1143} 1145}
@@ -1222,6 +1224,7 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
1222 gc->state.current.cur_texv = 0; 1224 gc->state.current.cur_texv = 0;
1223 gc->state.current.cur_texa = 0; 1225 gc->state.current.cur_texa = 0;
1224 gc->state.current.cur_texm = 0; 1226 gc->state.current.cur_texm = 0;
1227 gc->state.current.tex_target = GL_TEXTURE_2D;
1225 gc->state.current.render_op = -1; 1228 gc->state.current.render_op = -1;
1226 gc->state.current.smooth = -1; 1229 gc->state.current.smooth = -1;
1227 gc->state.current.blend = -1; 1230 gc->state.current.blend = -1;
@@ -1917,9 +1920,15 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1917 Shader_Sampling sam = 0, masksam = 0; 1920 Shader_Sampling sam = 0, masksam = 0;
1918 int yinvert = 0; 1921 int yinvert = 0;
1919 Shader_Type shd_in = SHD_IMAGE; 1922 Shader_Type shd_in = SHD_IMAGE;
1923 int tex_target = GL_TEXTURE_2D;
1920 1924
1921 if ((tex->im) && (tex->im->native.data)) 1925 if (tex->im)
1922 shd_in = SHD_IMAGENATIVE; 1926 {
1927 if (tex->im->native.data)
1928 shd_in = SHD_IMAGENATIVE;
1929 if (tex->im->native.target == GL_TEXTURE_EXTERNAL_OES)
1930 tex_target = GL_TEXTURE_EXTERNAL_OES;
1931 }
1923 1932
1924 if (!!mtex) 1933 if (!!mtex)
1925 { 1934 {
@@ -1968,6 +1977,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1968 gc->pipe[pn].shader.prog = prog; 1977 gc->pipe[pn].shader.prog = prog;
1969 gc->pipe[pn].shader.cur_tex = pt->texture; 1978 gc->pipe[pn].shader.cur_tex = pt->texture;
1970 gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; 1979 gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0;
1980 gc->pipe[pn].shader.tex_target = tex_target;
1971 gc->pipe[pn].shader.smooth = smooth; 1981 gc->pipe[pn].shader.smooth = smooth;
1972 gc->pipe[pn].shader.mask_smooth = mask_smooth; 1982 gc->pipe[pn].shader.mask_smooth = mask_smooth;
1973 gc->pipe[pn].shader.blend = blend; 1983 gc->pipe[pn].shader.blend = blend;
@@ -2951,7 +2961,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2951 } 2961 }
2952#endif 2962#endif
2953 glActiveTexture(GL_TEXTURE0); 2963 glActiveTexture(GL_TEXTURE0);
2954 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex); 2964 glBindTexture(gc->pipe[i].shader.tex_target, gc->pipe[i].shader.cur_tex);
2955 } 2965 }
2956 if (gc->pipe[i].array.im) 2966 if (gc->pipe[i].array.im)
2957 { 2967 {
@@ -2959,7 +2969,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2959 if (gc->pipe[i].array.im->tex->pt->dyn.img) 2969 if (gc->pipe[i].array.im->tex->pt->dyn.img)
2960 { 2970 {
2961 secsym_glEGLImageTargetTexture2DOES 2971 secsym_glEGLImageTargetTexture2DOES
2962 (GL_TEXTURE_2D, gc->pipe[i].array.im->tex->pt->dyn.img); 2972 (gc->pipe[i].array.im->tex->pt->dyn.target, gc->pipe[i].array.im->tex->pt->dyn.img);
2963 } 2973 }
2964 else 2974 else
2965#endif 2975#endif
@@ -3524,6 +3534,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3524 gc->state.current.cur_texa = gc->pipe[i].shader.cur_texa; 3534 gc->state.current.cur_texa = gc->pipe[i].shader.cur_texa;
3525 gc->state.current.cur_texu = gc->pipe[i].shader.cur_texu; 3535 gc->state.current.cur_texu = gc->pipe[i].shader.cur_texu;
3526 gc->state.current.cur_texv = gc->pipe[i].shader.cur_texv; 3536 gc->state.current.cur_texv = gc->pipe[i].shader.cur_texv;
3537 gc->state.current.tex_target = gc->pipe[i].shader.tex_target;
3527 gc->state.current.render_op = gc->pipe[i].shader.render_op; 3538 gc->state.current.render_op = gc->pipe[i].shader.render_op;
3528// gc->state.current.cx = gc->pipe[i].shader.cx; 3539// gc->state.current.cx = gc->pipe[i].shader.cx;
3529// gc->state.current.cy = gc->pipe[i].shader.cy; 3540// gc->state.current.cy = gc->pipe[i].shader.cy;
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 b848c68c9a..3107507b8b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -400,7 +400,7 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum
400 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 400 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
401 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 401 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
402 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat); 402 ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat);
403 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex); 403 glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
404 if (!ok) 404 if (!ok)
405 { 405 {
406 glDeleteTextures(1, &(pt->texture)); 406 glDeleteTextures(1, &(pt->texture));
@@ -632,7 +632,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
632 } 632 }
633 633
634 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum); 634 glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
635 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex); 635 glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
636 636
637 if (!ok) 637 if (!ok)
638 { 638 {
@@ -700,7 +700,7 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
700 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 700 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
701 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 701 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
702 glBindTexture(im->native.target, 0); 702 glBindTexture(im->native.target, 0);
703 glBindTexture(im->native.target, gc->state.current.cur_tex); 703 glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
704 704
705 texinfo.n.num++; 705 texinfo.n.num++;
706 texinfo.n.pix += pt->w * pt->h; 706 texinfo.n.pix += pt->w * pt->h;
@@ -735,12 +735,14 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
735 735
736 _print_tex_count(); 736 _print_tex_count();
737 737
738 pt->dyn.target = GL_TEXTURE_2D;
739
738 glGenTextures(1, &(pt->texture)); 740 glGenTextures(1, &(pt->texture));
739 glBindTexture(GL_TEXTURE_2D, pt->texture); 741 glBindTexture(pt->dyn.target, pt->texture);
740 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 742 glTexParameteri(pt->dyn.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
741 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 743 glTexParameteri(pt->dyn.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
742 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 744 glTexParameteri(pt->dyn.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
743 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 745 glTexParameteri(pt->dyn.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
744 746
745 egldisplay = pt->gc->egldisp; 747 egldisplay = pt->gc->egldisp;
746 748
@@ -748,11 +750,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
748 { 750 {
749 tbm_format buffer_format = TBM_FORMAT_RGBA8888; 751 tbm_format buffer_format = TBM_FORMAT_RGBA8888;
750 tbm_surface_info_s info; 752 tbm_surface_info_s info;
751 int attr[] =
752 {
753 EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
754 EGL_NONE,
755 };
756 753
757 switch (intformat) 754 switch (intformat)
758 { 755 {
@@ -771,7 +768,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
771 pt->dyn.img = secsym_eglCreateImage(egldisplay, 768 pt->dyn.img = secsym_eglCreateImage(egldisplay,
772 EGL_NO_CONTEXT, 769 EGL_NO_CONTEXT,
773 EGL_NATIVE_SURFACE_TIZEN, 770 EGL_NATIVE_SURFACE_TIZEN,
774 pt->dyn.buffer, attr); 771 pt->dyn.buffer, NULL);
775 if (!pt->dyn.img) 772 if (!pt->dyn.img)
776 { 773 {
777 secsym_tbm_surface_destroy(pt->dyn.buffer); 774 secsym_tbm_surface_destroy(pt->dyn.buffer);
@@ -848,7 +845,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
848 goto error; 845 goto error;
849 } 846 }
850 847
851 glBindTexture(GL_TEXTURE_2D, gc->state.current.cur_tex); 848 glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
852#else 849#else
853 if (gc + w + h + intformat + format) return pt; 850 if (gc + w + h + intformat + format) return pt;
854#endif 851#endif
@@ -862,7 +859,7 @@ error:
862 secsym_eglDestroyImage(egldisplay, pt->dyn.img); 859 secsym_eglDestroyImage(egldisplay, pt->dyn.img);
863 pt->dyn.img = NULL; 860 pt->dyn.img = NULL;
864 } 861 }
865 glBindTexture(GL_TEXTURE_2D, 0); 862 glBindTexture(pt->dyn.target, 0);
866 glDeleteTextures(1, &(pt->texture)); 863 glDeleteTextures(1, &(pt->texture));
867 if (pt->eina_pool) 864 if (pt->eina_pool)
868 eina_rectangle_pool_free(pt->eina_pool); 865 eina_rectangle_pool_free(pt->eina_pool);
@@ -1171,7 +1168,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1171 } 1168 }
1172 //glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 1169 //glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1173 if (tex->pt->texture != tex->gc->state.current.cur_tex) 1170 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1174 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1171 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1175} 1172}
1176 1173
1177void 1174void
@@ -1271,7 +1268,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1271 1268
1272 if (tex->pt->texture != tex->gc->state.current.cur_tex) 1269 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1273 { 1270 {
1274 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1271 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1275 } 1272 }
1276 return; 1273 return;
1277 } 1274 }
@@ -1391,7 +1388,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
1391 1388
1392 // Switch back to current texture 1389 // Switch back to current texture
1393 if (tex->ptt->texture != tex->gc->state.current.cur_tex) 1390 if (tex->ptt->texture != tex->gc->state.current.cur_tex)
1394 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1391 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1395 1392
1396 // Now prepare uploading the main texture before returning; 1393 // Now prepare uploading the main texture before returning;
1397 async = malloc(sizeof (Evas_GL_Texture_Async_Preload)); 1394 async = malloc(sizeof (Evas_GL_Texture_Async_Preload));
@@ -1529,7 +1526,7 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
1529 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format, 1526 _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
1530 tex->pt->dataformat, pixels); 1527 tex->pt->dataformat, pixels);
1531 if (tex->pt->texture != tex->gc->state.current.cur_tex) 1528 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1532 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1529 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1533} 1530}
1534 1531
1535Evas_GL_Texture * 1532Evas_GL_Texture *
@@ -1703,7 +1700,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
1703 } 1700 }
1704 } 1701 }
1705on_error: 1702on_error:
1706 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1703 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1707} 1704}
1708 1705
1709Evas_GL_Texture * 1706Evas_GL_Texture *
@@ -1886,7 +1883,7 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
1886 } 1883 }
1887 } 1884 }
1888 if (tex->pt->texture != tex->gc->state.current.cur_tex) 1885 if (tex->pt->texture != tex->gc->state.current.cur_tex)
1889 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 1886 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
1890} 1887}
1891 1888
1892static Evas_GL_Texture * 1889static Evas_GL_Texture *
@@ -2055,7 +2052,7 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2055 } 2052 }
2056 2053
2057 if (tex->pt->texture != tex->gc->state.current.cur_tex) 2054 if (tex->pt->texture != tex->gc->state.current.cur_tex)
2058 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 2055 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
2059} 2056}
2060 2057
2061void 2058void
@@ -2110,7 +2107,7 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
2110 } 2107 }
2111 } 2108 }
2112 if (tex->pt->texture != tex->gc->state.current.cur_tex) 2109 if (tex->pt->texture != tex->gc->state.current.cur_tex)
2113 glBindTexture(GL_TEXTURE_2D, tex->gc->state.current.cur_tex); 2110 glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
2114} 2111}
2115 2112
2116void 2113void
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 8895f9bcdf..6adea19166 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -746,9 +746,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
746 re->window_use(re->software.ob); 746 re->window_use(re->software.ob);
747 747
748 if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && 748 if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) &&
749 (im->cs.space == EVAS_COLORSPACE_ARGB8888) && 749 (im->cs.space == EVAS_COLORSPACE_ARGB8888))
750 secsym_tbm_surface_map &&
751 secsym_eglMapImageSEC)
752 { 750 {
753 if (im->tex->pt->dyn.checked_out > 0) 751 if (im->tex->pt->dyn.checked_out > 0)
754 { 752 {
@@ -756,7 +754,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
756 *image_data = im->tex->pt->dyn.data; 754 *image_data = im->tex->pt->dyn.data;
757 return im; 755 return im;
758 } 756 }
759 if (im->gc->shared->info.sec_tbm_surface) 757 if ((im->gc->shared->info.sec_tbm_surface) && (secsym_tbm_surface_map))
760 { 758 {
761 tbm_surface_info_s info; 759 tbm_surface_info_s info;
762 secsym_tbm_surface_map(im->tex->pt->dyn.buffer, 760 secsym_tbm_surface_map(im->tex->pt->dyn.buffer,
@@ -764,7 +762,7 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
764 &info); 762 &info);
765 *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr; 763 *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr;
766 } 764 }
767 else if (im->gc->shared->info.sec_image_map) 765 else if ((im->gc->shared->info.sec_image_map) && (secsym_eglMapImageSEC))
768 { 766 {
769 void *disp = re->window_egl_display_get(re->software.ob); 767 void *disp = re->window_egl_display_get(re->software.ob);
770 *image_data = im->tex->pt->dyn.data = secsym_eglMapImageSEC(disp, 768 *image_data = im->tex->pt->dyn.data = secsym_eglMapImageSEC(disp,
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index ffb5a32b4f..ab45b76acc 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2037,7 +2037,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
2037 { 2037 {
2038 if (glsym_glEGLImageTargetTexture2DOES) 2038 if (glsym_glEGLImageTargetTexture2DOES)
2039 { 2039 {
2040 glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->surface); 2040 glsym_glEGLImageTargetTexture2DOES(im->native.target, n->surface);
2041 GLERRV("glsym_glEGLImageTargetTexture2DOES"); 2041 GLERRV("glsym_glEGLImageTargetTexture2DOES");
2042 } 2042 }
2043 else 2043 else
@@ -2060,7 +2060,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
2060 } 2060 }
2061 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) 2061 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
2062 { 2062 {
2063 glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id); 2063 glBindTexture(im->native.target, n->ns.data.opengl.texture_id);
2064 } 2064 }
2065 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM) 2065 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
2066 { 2066 {
@@ -2069,7 +2069,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
2069 { 2069 {
2070 if (glsym_glEGLImageTargetTexture2DOES) 2070 if (glsym_glEGLImageTargetTexture2DOES)
2071 { 2071 {
2072 glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, n->surface); 2072 glsym_glEGLImageTargetTexture2DOES(im->native.target, n->surface);
2073 GLERRV("glsym_glEGLImageTargetTexture2DOES"); 2073 GLERRV("glsym_glEGLImageTargetTexture2DOES");
2074 } 2074 }
2075 else 2075 else
@@ -2088,7 +2088,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
2088#ifdef GL_GLES 2088#ifdef GL_GLES
2089 if (glsym_glEGLImageTargetTexture2DOES) 2089 if (glsym_glEGLImageTargetTexture2DOES)
2090 { 2090 {
2091 glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, buffer); 2091 glsym_glEGLImageTargetTexture2DOES(im->native.target, buffer);
2092 GLERRV("glsym_glEGLImageTargetTexture2DOES"); 2092 GLERRV("glsym_glEGLImageTargetTexture2DOES");
2093 } 2093 }
2094 else 2094 else
@@ -2146,7 +2146,7 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
2146 } 2146 }
2147 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) 2147 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
2148 { 2148 {
2149 glBindTexture(GL_TEXTURE_2D, 0); 2149 glBindTexture(im->native.target, 0);
2150 } 2150 }
2151 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM) 2151 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
2152 { 2152 {