Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
+void evas_gl_common_texture_shared_specific(Evas_Engine_GL_Context *gc, Evas_GL_Texture_Pool *pt, int i);
+void evas_gl_common_texture_shared_back(Evas_Engine_GL_Context *gc, Evas_GL_Texture_Pool *pt);
+
void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
glUseProgram(gc->state.current.prog->prog);
glActiveTexture(GL_TEXTURE0);
- glBindTexture(gc->pipe[0].shader.tex_target, gc->pipe[0].shader.cur_tex);
+ evas_gl_common_texture_shared_back(gc, NULL);
_evas_gl_common_viewport_set(gc,1);
}
}
#endif
glActiveTexture(GL_TEXTURE0);
- glBindTexture(gc->pipe[i].shader.tex_target, gc->pipe[i].shader.cur_tex);
+ evas_gl_common_texture_shared_specific(gc, NULL, i);
}
if (gc->pipe[i].array.im)
{
return -1;
}
+void
+evas_gl_common_texture_shared_specific(Evas_Engine_GL_Context *gc, Evas_GL_Texture_Pool *pt, int i)
+{
+ if (!pt || pt->texture != gc->pipe[i].shader.cur_tex)
+ {
+ if (gc->pipe[i].array.im)
+ {
+ if (gc->pipe[i].array.im->tex->pt->dyn.img)
+ gc->pipe[i].shader.tex_target = gc->pipe[i].array.im->tex->pt->dyn.target;
+ else
+ gc->pipe[i].shader.tex_target = gc->pipe[i].array.im->native.target;
+ }
+ else
+ gc->pipe[i].shader.tex_target = GL_TEXTURE_2D;
+
+ glBindTexture(gc->pipe[i].shader.tex_target, gc->pipe[i].shader.cur_tex);
+ }
+}
+
+void
+evas_gl_common_texture_shared_back(Evas_Engine_GL_Context *gc, Evas_GL_Texture_Pool *pt)
+{
+ evas_gl_common_texture_shared_specific(gc, pt, 0);
+}
+
static void
_print_tex_count(void)
{
_print_tex_count();
- pt->dyn.target = GL_TEXTURE_2D;
+ if (gc->shared->info.sec_tbm_surface)
+ pt->dyn.target = GL_TEXTURE_EXTERNAL_OES;
+ else
+ pt->dyn.target = GL_TEXTURE_2D;
glGenTextures(1, &(pt->texture));
glBindTexture(pt->dyn.target, pt->texture);