summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-08-20 18:18:31 +0900
committerHermet Park <hermetpark@gmail.com>2019-08-20 18:23:41 +0900
commitdad166f84a02cfffc2a07bc804e7b7e35ed4a40d (patch)
treeb52d551fa4fdb4adda62059f59f0ada461246cb4 /src/static_libs
parentead8a280570baded69686487a6dd27a8843fc95f (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() 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 47923c9..b0aac76 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{
@@ -309,10 +294,10 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
309 efl_key_data_set(mtarget, key, msource); 294 efl_key_data_set(mtarget, key, msource);
310 } 295 }
311 296
312 //FIXME : EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA option is temporary 297 //FIXME : ECTOR_RENDERER_COMPOSITE_METHOD_ALPHA option is temporary
313 //Currently matte alpha implemtnes is same the mask intersect impletment. 298 //Currently matte alpha implements is same the mask intersect implement.
314 //It has been implemented as a multiplication calculation. 299 //It has been implemented as a multiplication calculation.
315 efl_canvas_vg_node_mask_set(mtarget, msource, EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA); 300 efl_canvas_vg_node_comp_method_set(mtarget, msource, ECTOR_RENDERER_COMPOSITE_METHOD_MATTE_ALPHA);
316 301
317 mtarget = msource; 302 mtarget = msource;
318 303
@@ -330,24 +315,24 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
330 } 315 }
331 _construct_mask_nodes(msource, mask, depth + 1); 316 _construct_mask_nodes(msource, mask, depth + 1);
332 317
333 EFL_CANVAS_VG_NODE_BLEND_TYPE mask_mode; 318 Ector_Renderer_Composite_Method mask_mode;
334 switch (mask->mMode) 319 switch (mask->mMode)
335 { 320 {
336 case MaskSubstract: 321 case MaskSubstract:
337 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT; 322 mask_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MASK_SUBSTRACT;
338 break; 323 break;
339 case MaskIntersect: 324 case MaskIntersect:
340 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT; 325 mask_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MASK_INTERSECT;
341 break; 326 break;
342 case MaskDifference: 327 case MaskDifference:
343 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE; 328 mask_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MASK_DIFFERENCE;
344 break; 329 break;
345 case MaskAdd: 330 case MaskAdd:
346 default: 331 default:
347 mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD; 332 mask_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MASK_ADD;
348 break; 333 break;
349 } 334 }
350 efl_canvas_vg_node_mask_set(mtarget, msource, mask_mode); 335 efl_canvas_vg_node_comp_method_set(mtarget, msource, mask_mode);
351 mtarget = msource; 336 mtarget = msource;
352 } 337 }
353} 338}
@@ -395,7 +380,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
395 380
396 if (matte_mode != 0) 381 if (matte_mode != 0)
397 { 382 {
398 efl_canvas_vg_node_mask_set(ptree, ctree, matte_mode); 383 efl_canvas_vg_node_comp_method_set(ptree, ctree, matte_mode);
399 mtarget = ctree; 384 mtarget = ctree;
400 } 385 }
401 matte_mode = (int) clayer->mMatte; 386 matte_mode = (int) clayer->mMatte;
@@ -415,10 +400,10 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
415 matte_mode = 0; 400 matte_mode = 0;
416 break; 401 break;
417 case MatteAlpha: 402 case MatteAlpha:
418 matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA; 403 matte_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MATTE_ALPHA;
419 break; 404 break;
420 case MatteAlphaInv: 405 case MatteAlphaInv:
421 matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV; 406 matte_mode = ECTOR_RENDERER_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE;
422 break; 407 break;
423 case MatteLuma: 408 case MatteLuma:
424 matte_mode = 0; 409 matte_mode = 0;