summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
authorDmytro Dadyka <d.dadyka@samsung.com>2014-12-01 07:39:36 +0100
committerCedric BAIL <cedric@osg.samsung.com>2014-12-01 08:09:29 +0100
commit6762af0beb5f53e299a65bca38dcb0739dd6c6cc (patch)
tree7a88064f8bd519549dbbb89bf8853fcb8234e77d /src/lib/evas/canvas
parent30a44d91006ca7dbcce3f00b5ebd4192ebfa40ef (diff)
evas: Evas_3D - add mesh blending mode.
Reviewers: Hermet, raster, cedric Subscribers: Oleksander, cedric @feature Differential Revision: https://phab.enlightenment.org/D1548 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r--src/lib/evas/canvas/evas_3d_mesh.c32
-rw-r--r--src/lib/evas/canvas/evas_3d_mesh.eo44
2 files changed, 76 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_3d_mesh.c b/src/lib/evas/canvas/evas_3d_mesh.c
index f72d959dd2..81b9117628 100644
--- a/src/lib/evas/canvas/evas_3d_mesh.c
+++ b/src/lib/evas/canvas/evas_3d_mesh.c
@@ -117,6 +117,9 @@ _mesh_init(Evas_3D_Mesh_Data *pd)
117 pd->assembly = EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES; 117 pd->assembly = EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES;
118 118
119 pd->nodes = NULL; 119 pd->nodes = NULL;
120 pd->blend_sfactor = EVAS_3D_BLEND_ONE;
121 pd->blend_dfactor = EVAS_3D_BLEND_ZERO;
122 pd->blending = EINA_FALSE;
120} 123}
121 124
122static inline void 125static inline void
@@ -770,6 +773,35 @@ _evas_3d_mesh_fog_enable_get(Eo *obj EINA_UNUSED, Evas_3D_Mesh_Data *pd)
770} 773}
771 774
772EOLIAN static void 775EOLIAN static void
776_evas_3d_mesh_blending_enable_set(Eo *obj, Evas_3D_Mesh_Data *pd, Eina_Bool blending)
777{
778 pd->blending = blending;
779 eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_MESH_BLENDING, NULL));
780}
781
782EOLIAN static Eina_Bool
783_evas_3d_mesh_blending_enable_get(Eo *obj EINA_UNUSED, Evas_3D_Mesh_Data *pd)
784{
785 return pd->blending;
786}
787
788EOLIAN static void
789_evas_3d_mesh_blending_func_set(Eo *obj, Evas_3D_Mesh_Data *pd, Evas_3D_Blend_Func sfactor, Evas_3D_Blend_Func dfactor)
790{
791 pd->blend_sfactor = sfactor;
792 pd->blend_dfactor = dfactor;
793 eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_MESH_BLENDING, NULL));
794}
795
796EOLIAN static void
797_evas_3d_mesh_blending_func_get(Eo *obj EINA_UNUSED, Evas_3D_Mesh_Data *pd,
798 Evas_3D_Blend_Func *sfactor, Evas_3D_Blend_Func *dfactor)
799{
800 if (sfactor) *sfactor = pd->blend_sfactor;
801 if (dfactor) *dfactor = pd->blend_dfactor;
802}
803
804EOLIAN static void
773_evas_3d_mesh_file_set(Eo *obj, Evas_3D_Mesh_Data *pd, Evas_3D_Mesh_File_Type type, const char *file, const char *key EINA_UNUSED) 805_evas_3d_mesh_file_set(Eo *obj, Evas_3D_Mesh_Data *pd, Evas_3D_Mesh_File_Type type, const char *file, const char *key EINA_UNUSED)
774{ 806{
775 _mesh_fini(pd); 807 _mesh_fini(pd);
diff --git a/src/lib/evas/canvas/evas_3d_mesh.eo b/src/lib/evas/canvas/evas_3d_mesh.eo
index 66d4f69fa8..0fdf1a2517 100644
--- a/src/lib/evas/canvas/evas_3d_mesh.eo
+++ b/src/lib/evas/canvas/evas_3d_mesh.eo
@@ -330,6 +330,27 @@ class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface)
330 @out Evas_Real a; /*@ Pointer to receive transparency of fog.*/ 330 @out Evas_Real a; /*@ Pointer to receive transparency of fog.*/
331 } 331 }
332 } 332 }
333 blending_func_set {
334 /*
335 Set the blending function for given mesh
336 @ingroup Evas_3D_Mesh
337 */
338 params {
339 @in Evas_3D_Blend_Func sfactor; /*@ Specifies how the red, green, blue, and alpha source blending factors are computed.*/
340 @in Evas_3D_Blend_Func dfactor; /*@ Specifies how the red, green, blue, and alpha destination blending factors are computed.*/
341 }
342 }
343 blending_func_get {
344 /*
345 Get blending blending function for given mesh
346 @see eavs_3d_mesh_blending_func_set()
347 @ingroup Evas_3D_Mesh
348 */
349 params {
350 @out Evas_3D_Blend_Func sfactor; /*@ Pointer to receive source blendin factors key.*/
351 @out Evas_3D_Blend_Func dfactor; /*@ Pointer to receive destination blendin factors key.*/
352 }
353 }
333 fog_enable_set { 354 fog_enable_set {
334 /* 355 /*
335 Enable or disable fog effect for given mesh. 356 Enable or disable fog effect for given mesh.
@@ -373,6 +394,29 @@ class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface)
373 Evas_3D_Shade_Mode mode; /*@ The shade mode.*/ 394 Evas_3D_Shade_Mode mode; /*@ The shade mode.*/
374 } 395 }
375 } 396 }
397 blending_enable {
398 set {
399 /**
400 * Enable or disable blending for given mesh.
401 *
402 * Default blending disabled.
403 *
404 * @ingroup Evas_3D_Mesh
405 */
406 }
407 get {
408 /**
409 * Get blending enable status for given mesh.
410 *
411 * @see eavs_3d_mesh_blending_enable_set()
412 *
413 * @ingroup Evas_3D_Mesh
414 */
415 }
416 values {
417 Eina_Bool blending; /*@ The blending state.*/
418 }
419 }
376 420
377 frame_material { 421 frame_material {
378 set { 422 set {