evas: pass disable atlas flag between Evas_3D_Texture and Evas_GL_Image
authorOleksandr Shcherbina <o.shcherbina@samsung.com>
Sun, 10 May 2015 20:55:56 +0000 (22:55 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Sun, 10 May 2015 20:55:59 +0000 (22:55 +0200)
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>
src/examples/evas/evas-3d-shadows.c
src/modules/evas/engines/gl_common/evas_gl_3d.c

index 5177043a69b520c6a9af9543e6d671a674560b4d..1ae4ee59225b65e9e816d960f3da858c174a49a0 100644 (file)
@@ -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,
index 9f8e742f5a3f905e6c88fd82d9caf1518a3432d7..1c393159e97dc39c8b83db4f3d61be5b65014c71 100644 (file)
@@ -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 *