summaryrefslogtreecommitdiff
path: root/src/lib/evas/include
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2015-04-22 15:19:02 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-07 09:53:09 +0200
commitd88ccf06a5f6ebcfc68dcc21e55a241f64ff9aa9 (patch)
treec161bdf705243e99217f689e42458a0de2edb9f9 /src/lib/evas/include
parent0f6d101ad5ec8327088e448c347e1f4054a5c8d7 (diff)
evas: use Evas_GL_image for generate texture unit for Evas_3D_Texture.
Summary: Used engine function for load image/data and use texture unit through Evas_GL_Image object Used Evas_ColorSpace format instead Evas_3D_Color/Pixel format Added transformation matrix for adjusting texture unit coordinates in shader Added property in Evas_3D_Texture for mark possibility get texture without atlas (see https://phab.enlightenment.org/conpherence/54/, I suppose it will done after this patch) Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2371 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/evas/include/evas_3d_utils.h30
-rw-r--r--src/lib/evas/include/evas_private.h12
2 files changed, 36 insertions, 6 deletions
diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h
index d11533ff6e..87bf70867d 100644
--- a/src/lib/evas/include/evas_3d_utils.h
+++ b/src/lib/evas/include/evas_3d_utils.h
@@ -1150,6 +1150,36 @@ evas_mat3_invserse(Evas_Mat3 *out, const Evas_Mat3 *mat)
1150 } 1150 }
1151} 1151}
1152 1152
1153static inline void
1154evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x, const Evas_Real p_y)
1155{
1156 Evas_Real *d = &out->m[0];
1157 memset(d, 0x00, sizeof(Evas_Mat3));
1158 d[0] = 1;
1159 d[2] = p_x;
1160 d[4] = 1;
1161 d[5] = p_y;
1162 d[8] = 1;
1163 if (p_x || p_y)
1164 out->flags = 0;
1165 else
1166 out->flags = EVAS_MATRIX_IS_IDENTITY;
1167}
1168
1169static inline void
1170evas_mat3_set_scale_transform(Evas_Mat3 *out, Evas_Real s_x, Evas_Real s_y)
1171{
1172 Evas_Real *d = &out->m[0];
1173 memset(d, 0x00, sizeof(Evas_Mat3));
1174 d[0] = s_x;
1175 d[4] = s_y;
1176 d[8] = 1;
1177 if (s_x != 1.0 || s_y != 1.0)
1178 out->flags = 0;
1179 else
1180 out->flags = EVAS_MATRIX_IS_IDENTITY;
1181}
1182
1153/* 2x2 matrix */ 1183/* 2x2 matrix */
1154static inline void 1184static inline void
1155evas_mat2_identity_set(Evas_Mat2 *m) 1185evas_mat2_identity_set(Evas_Mat2 *m)
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index af2592bc1a..427a71de0d 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -369,9 +369,11 @@ struct _Evas_3D_Texture
369 Evas_Object *source; 369 Evas_Object *source;
370 Eina_Bool proxy_rendering; 370 Eina_Bool proxy_rendering;
371 void *proxy_surface; 371 void *proxy_surface;
372
373 /* Engine-side object. */ 372 /* Engine-side object. */
374 void *engine_data; 373 void *engine_data;
374
375 /*Use atlases, @EINA_TRUE by default*/
376 Eina_Bool atlas_enable :1;
375}; 377};
376 378
377struct _Evas_3D_Material 379struct _Evas_3D_Material
@@ -389,7 +391,7 @@ struct _Evas_3D_Material
389 391
390struct _Evas_3D_Scene_Public_Data 392struct _Evas_3D_Scene_Public_Data
391{ 393{
392 Evas_Color bg_color; 394 Evas_Color bg_color;
393 Evas_3D_Node *camera_node; 395 Evas_3D_Node *camera_node;
394 Eina_List *light_nodes; 396 Eina_List *light_nodes;
395 Eina_List *mesh_nodes; 397 Eina_List *mesh_nodes;
@@ -1360,17 +1362,15 @@ struct _Evas_Func
1360 int (*drawable_texture_color_pick_id_get) (void *drawable); 1362 int (*drawable_texture_color_pick_id_get) (void *drawable);
1361 double (*drawable_texture_pixel_color_get) (unsigned int tex EINA_UNUSED, int x, int y, void *drawable); 1363 double (*drawable_texture_pixel_color_get) (unsigned int tex EINA_UNUSED, int x, int y, void *drawable);
1362 1364
1363 void *(*texture_new) (void *data); 1365 void *(*texture_new) (void *data, Eina_Bool use_atlas);
1364 void (*texture_free) (void *data, void *texture); 1366 void (*texture_free) (void *data, void *texture);
1365 void (*texture_data_set) (void *data, void *texture, Evas_3D_Color_Format format, Evas_3D_Pixel_Format pixel_format, int w, int h, const void *pixels);
1366 void (*texture_file_set) (void *data, void *texture, const char *file, const char *key);
1367 void (*texture_color_format_get) (void *data, void *texture, Evas_3D_Color_Format *format);
1368 void (*texture_size_get) (void *data, void *texture, int *w, int *h); 1367 void (*texture_size_get) (void *data, void *texture, int *w, int *h);
1369 void (*texture_wrap_set) (void *data, void *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mode t); 1368 void (*texture_wrap_set) (void *data, void *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mode t);
1370 void (*texture_wrap_get) (void *data, void *texture, Evas_3D_Wrap_Mode *s, Evas_3D_Wrap_Mode *t); 1369 void (*texture_wrap_get) (void *data, void *texture, Evas_3D_Wrap_Mode *s, Evas_3D_Wrap_Mode *t);
1371 void (*texture_filter_set) (void *data, void *texture, Evas_3D_Texture_Filter min, Evas_3D_Texture_Filter mag); 1370 void (*texture_filter_set) (void *data, void *texture, Evas_3D_Texture_Filter min, Evas_3D_Texture_Filter mag);
1372 void (*texture_filter_get) (void *data, void *texture, Evas_3D_Texture_Filter *min, Evas_3D_Texture_Filter *mag); 1371 void (*texture_filter_get) (void *data, void *texture, Evas_3D_Texture_Filter *min, Evas_3D_Texture_Filter *mag);
1373 void (*texture_image_set) (void *data, void *texture, void *image); 1372 void (*texture_image_set) (void *data, void *texture, void *image);
1373 void *(*texture_image_get) (void *data, void *texture);
1374 1374
1375 Ector_Surface *(*ector_get) (void *data); 1375 Ector_Surface *(*ector_get) (void *data);
1376 void (*ector_begin) (void *data, void *context, void *surface, int x, int y, Eina_Bool do_async); 1376 void (*ector_begin) (void *data, void *context, void *surface, int x, int y, Eina_Bool do_async);