cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b85713a0a494a1db778a24dc01b0a6dcdc00e4bc
commit b85713a0a494a1db778a24dc01b0a6dcdc00e4bc Author: Oleksandr Shcherbina <[email protected]> Date: Sun May 10 22:55:56 2015 +0200 evas: pass disable atlas flag between Evas_3D_Texture and Evas_GL_Image Summary: Bind flag atlas_enable. Build adjusting matrix only in case getting texture unit with atlas. Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2473 Signed-off-by: Cedric BAIL <[email protected]> --- src/examples/evas/evas-3d-shadows.c | 2 ++ src/modules/evas/engines/gl_common/evas_gl_3d.c | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index 5177043..1ae4ee5 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -247,6 +247,7 @@ _fence_setup(Body_3D *fence) { Eo *texture = eo_add(EVAS_3D_TEXTURE_CLASS, evas); + eo_do(texture, evas_3d_texture_atlas_enable_set(EINA_FALSE)); eo_do(texture, evas_3d_texture_file_set(PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid.png", NULL), evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, @@ -254,6 +255,7 @@ _fence_setup(Body_3D *fence) evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT)); Eo *texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, evas); + eo_do(texture1, evas_3d_texture_atlas_enable_set(EINA_FALSE)); eo_do(texture1, evas_3d_texture_file_set(PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/grid_n.png", NULL), evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, diff --git a/src/modules/evas/engines/gl_common/evas_gl_3d.c b/src/modules/evas/engines/gl_common/evas_gl_3d.c index 9f8e742..1c39315 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_3d.c +++ b/src/modules/evas/engines/gl_common/evas_gl_3d.c @@ -99,7 +99,7 @@ e3d_texture_set(Evas_Engine_GL_Context *gc, texture->surface = im; evas_gl_common_image_ref(im); - + im->disable_atlas = !texture->atlas_enable; evas_gl_common_image_update(gc, im); texture->tex = im->tex->pt->texture; @@ -107,16 +107,18 @@ e3d_texture_set(Evas_Engine_GL_Context *gc, texture->h = im->h; texture->x = im->tex->x; texture->y = im->tex->y; - - pt_x = im->tex->pt->w ? (im->tex->x/(Evas_Real)im->tex->pt->w) : 0; - pt_y = im->tex->pt->h ? (im->tex->y/(Evas_Real)im->tex->pt->h) : 0; - - st_x = im->tex->pt->w ? (im->w/(Evas_Real)im->tex->pt->w) : 1.0; - st_y = im->tex->pt->h ? (im->h/(Evas_Real)im->tex->pt->h) : 1.0; - /*Build adjusting matrix for texture unit coordinates*/ - evas_mat3_set_position_transform(&pt, pt_x, pt_y); - evas_mat3_set_scale_transform(&st, st_x, st_y); - evas_mat3_multiply(&texture->trans, &st, &pt); + if (texture->atlas_enable) + { + pt_x = im->tex->pt->w ? (im->tex->x/(Evas_Real)im->tex->pt->w) : 0; + pt_y = im->tex->pt->h ? (im->tex->y/(Evas_Real)im->tex->pt->h) : 0; + + st_x = im->tex->pt->w ? (im->w/(Evas_Real)im->tex->pt->w) : 1.0; + st_y = im->tex->pt->h ? (im->h/(Evas_Real)im->tex->pt->h) : 1.0; + /*Build adjusting matrix for texture unit coordinates*/ + evas_mat3_set_position_transform(&pt, pt_x, pt_y); + evas_mat3_set_scale_transform(&st, st_x, st_y); + evas_mat3_multiply(&texture->trans, &st, &pt); + } } Evas_GL_Image * --
