forked from enlightenment/efl
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 <cedric@osg.samsung.com>
This commit is contained in:
parent
db6a1af45e
commit
b85713a0a4
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
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;
|
||||
|
||||
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);
|
||||
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 *
|
||||
|
|
Loading…
Reference in New Issue