summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-02-25 11:54:57 +0900
committerHermet Park <hermetpark@gmail.com>2020-02-25 11:55:14 +0900
commit6de0ed7b5d221506756bde36888e7c4c4f69c9f3 (patch)
tree535a1249692931edfecd00588006376e31b63c6d
parentad001028424f6f4036c1ba244b3c777c1650b14b (diff)
vg_common_json: Fix to duplication of mask and matte.
Summary: There is a case that uses a mask and a mat at the same time. One of them did not apply. This patch modifies two attributes to be parent-child. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11399
-rw-r--r--src/static_libs/vg_common/vg_common_json.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index 2092b852a5..f7b3e9d2f5 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -311,7 +311,7 @@ _construct_mask_nodes(Efl_Canvas_Vg_Container *parent, LOTMask *mask, int depth
311 efl_gfx_color_set(shape, r, g, b, a); 311 efl_gfx_color_set(shape, r, g, b, a);
312} 312}
313 313
314static void 314static Efl_Canvas_Vg_Container*
315_construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int mask_cnt, int depth) 315_construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int mask_cnt, int depth)
316{ 316{
317 char *key = NULL; 317 char *key = NULL;
@@ -329,7 +329,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
329 329
330#if DEBUG 330#if DEBUG
331 for (int i = 0; i < depth; i++) printf(" "); 331 for (int i = 0; i < depth; i++) printf(" ");
332 printf("%s (%p), mask => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mtarget); 332 printf("%s (%p), base mask => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mtarget);
333 depth++; 333 depth++;
334#endif 334#endif
335 335
@@ -356,7 +356,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
356 356
357#if DEBUG 357#if DEBUG
358 for (int i = 0; i < depth; i++) printf(" "); 358 for (int i = 0; i < depth; i++) printf(" ");
359 printf("%s (%p), mask:%d => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mask->mMode, mtarget); 359 printf("%s (%p), real mask:%d => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mask->mMode, mtarget);
360#endif 360#endif
361 361
362 _construct_mask_nodes(msource, mask, depth + 1); 362 _construct_mask_nodes(msource, mask, depth + 1);
@@ -381,6 +381,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
381 efl_canvas_vg_node_comp_method_set(mtarget, msource, mask_mode); 381 efl_canvas_vg_node_comp_method_set(mtarget, msource, mask_mode);
382 mtarget = msource; 382 mtarget = msource;
383 } 383 }
384 return mtarget;
384} 385}
385 386
386static void 387static void
@@ -432,7 +433,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
432 } 433 }
433#if DEBUG 434#if DEBUG
434 for (int i = 0; i < depth; i++) printf(" "); 435 for (int i = 0; i < depth; i++) printf(" ");
435 printf("%s (%p) matte:%d => %p\n", efl_class_name_get(efl_class_get(ctree)), ctree, matte_mode, ptree); 436 printf("%s (%p) matte:%d => %p %s\n", efl_class_name_get(efl_class_get(ctree)), ctree, matte_mode, ptree, clayer->keypath);
436#endif 437#endif
437 _update_vg_tree(ctree, clayer, depth+1); 438 _update_vg_tree(ctree, clayer, depth+1);
438 439
@@ -448,6 +449,8 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
448 mlayer = clayer; 449 mlayer = clayer;
449 if (!mtarget) mtarget = ctree; 450 if (!mtarget) mtarget = ctree;
450 } 451 }
452 else
453 mtarget = NULL;
451 454
452 ptree = ctree; 455 ptree = ctree;
453 456
@@ -475,15 +478,16 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
475 matte_mode = 0; 478 matte_mode = 0;
476 break; 479 break;
477 } 480 }
481
482 //Construct node that have mask.
483 if (mlayer && mtarget)
484 ptree = _construct_masks(mtarget, mlayer->mMaskList.ptr, mlayer->mMaskList.size, depth + 1);
478 } 485 }
479 486
480 //Construct drawable nodes. 487 //Construct drawable nodes.
481 if (layer->mNodeList.size > 0) 488 if (layer->mNodeList.size > 0)
482 _construct_drawable_nodes(root, layer, depth); 489 _construct_drawable_nodes(root, layer, depth);
483 490
484 //Construct node that have mask.
485 if (mlayer)
486 _construct_masks(mtarget, mlayer->mMaskList.ptr, mlayer->mMaskList.size, depth);
487} 491}
488#endif 492#endif
489 493