summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-09-06 17:41:52 +0900
committerHermet Park <hermetpark@gmail.com>2019-09-06 17:56:02 +0900
commit690dd5d33a39aec8537dbab3321a75e506b306de (patch)
tree0d4d160caf4b55ecadd3b3934da2546eaa0b2ade /src/static_libs
parentae29408b86eaf8f6f324baff0312b336d56b1efc (diff)
ector: code refactoring.
Current vector drawing requires several methods for compositing, it's shouldnt have only masking but other blending functions such as matte in lottie, porter&duff in android, etc. Previously we didn't specify this method name, just reserved the options and now we started to define the methods with ector_renderer_composite_method() with Efl.Gfx.VG_Composite_Method instead of mask_set().
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/vg_common/vg_common_json.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index 27fc86e..910a405 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -9,21 +9,6 @@
9 9
10#include <rlottie_capi.h> 10#include <rlottie_capi.h>
11 11
12//FIXME: This enum add temporarily to help understanding of additional code
13//related to masking in prepare_mask.
14//This needs to be formally declared through the eo class.
15typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE
16{
17 EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0,
18 EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA,
19 EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV,
20 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD,
21 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT,
22 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT,
23 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE
24}EFL_CANVAS_VG_NODE_BLEND_TYPE;
25//
26
27static char* 12static char*
28_get_key_val(void *key) 13_get_key_val(void *key)
29{ 14{
@@ -311,10 +296,10 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
311 efl_key_data_set(mtarget, key, msource); 296 efl_key_data_set(mtarget, key, msource);
312 } 297 }
313 298
314 //FIXME : EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA option is temporary 299 //FIXME : EFL_GFX_VG_COMPOSITE_METHOD_ALPHA option is temporary
315 //Currently matte alpha implemtnes is same the mask intersect impletment. 300 //Currently matte alpha implements is same the mask intersect implement.
316 //It has been implemented as a multiplication calculation. 301 //It has been implemented as a multiplication calculation.
317 efl_canvas_vg_node_mask_set(mtarget, msource, EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA); 302 efl_canvas_vg_node_comp_method_set(mtarget, msource, EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA);
318 303
319 mtarget = msource; 304 mtarget = msource;
320 305
@@ -332,24 +317,24 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
332 } 317 }
333 _construct_mask_nodes(msource, mask, depth + 1); 318 _construct_mask_nodes(msource, mask, depth + 1);
334 319
335 EFL_CANVAS_VG_NODE_BLEND_TYPE mask_mode; 320 Efl_Gfx_Vg_Composite_Method mask_mode;
336 switch (mask->mMode) 321 switch (mask->mMode)
337 { 322 {
338 case MaskSubstract: 323 case MaskSubstract:
339 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT; 324 mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_SUBSTRACT;
340 break; 325 break;
341 case MaskIntersect: 326 case MaskIntersect:
342 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT; 327 mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT;
343 break; 328 break;
344 case MaskDifference: 329 case MaskDifference:
345 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE; 330 mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_DIFFERENCE;
346 break; 331 break;
347 case MaskAdd: 332 case MaskAdd:
348 default: 333 default:
349 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD; 334 mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_ADD;
350 break; 335 break;
351 } 336 }
352 efl_canvas_vg_node_mask_set(mtarget, msource, mask_mode); 337 efl_canvas_vg_node_comp_method_set(mtarget, msource, mask_mode);
353 mtarget = msource; 338 mtarget = msource;
354 } 339 }
355} 340}
@@ -397,7 +382,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
397 382
398 if (matte_mode != 0) 383 if (matte_mode != 0)
399 { 384 {
400 efl_canvas_vg_node_mask_set(ptree, ctree, matte_mode); 385 efl_canvas_vg_node_comp_method_set(ptree, ctree, matte_mode);
401 mtarget = ctree; 386 mtarget = ctree;
402 } 387 }
403 matte_mode = (int) clayer->mMatte; 388 matte_mode = (int) clayer->mMatte;
@@ -417,10 +402,10 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
417 matte_mode = 0; 402 matte_mode = 0;
418 break; 403 break;
419 case MatteAlpha: 404 case MatteAlpha:
420 matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA; 405 matte_mode = EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA;
421 break; 406 break;
422 case MatteAlphaInv: 407 case MatteAlphaInv:
423 matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV; 408 matte_mode = EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE;
424 break; 409 break;
425 case MatteLuma: 410 case MatteLuma:
426 matte_mode = 0; 411 matte_mode = 0;