summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-10-17 16:59:14 +0900
committerHermet Park <hermetpark@gmail.com>2019-10-17 17:01:33 +0900
commit0e675e5cf1c78876e32bb72ef338f9478371e5c3 (patch)
treebddb1e90d9358effcdaad3e9ddb69c32a72ac529 /src
parent4885e0764d6ea0ed542b90f9e02dd1eb5d1fa8d7 (diff)
vector json: optimize logic.
if a layer is full transparent, skip it further processing.
Diffstat (limited to 'src')
-rw-r--r--src/static_libs/vg_common/vg_common_json.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index 4e203a0..138b85a 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -362,6 +362,10 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
362 return; 362 return;
363 } 363 }
364 efl_gfx_entity_visible_set(root, EINA_TRUE); 364 efl_gfx_entity_visible_set(root, EINA_TRUE);
365 efl_gfx_color_set(root, layer->mAlpha, layer->mAlpha, layer->mAlpha, layer->mAlpha);
366
367 //Don't need to update it anymore since its layer is invisible.
368 if (layer->mAlpha == 0) return;
365 369
366 Efl_Canvas_Vg_Container *ptree = NULL; 370 Efl_Canvas_Vg_Container *ptree = NULL;
367 371
@@ -388,10 +392,6 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
388 for (int i = 0; i < depth; i++) printf(" "); 392 for (int i = 0; i < depth; i++) printf(" ");
389 printf("%s (%p) matte:%d => %p\n", efl_class_name_get(efl_class_get(ctree)), ctree, matte_mode, ptree); 393 printf("%s (%p) matte:%d => %p\n", efl_class_name_get(efl_class_get(ctree)), ctree, matte_mode, ptree);
390#endif 394#endif
391
392 //Set Container's alpha color
393 efl_gfx_color_set(ctree, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha);
394
395 _update_vg_tree(ctree, clayer, depth+1); 395 _update_vg_tree(ctree, clayer, depth+1);
396 396
397 if (matte_mode != 0) 397 if (matte_mode != 0)
@@ -525,8 +525,6 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd)
525 if (tree->keypath) efl_key_data_set(root, "_lot_node_name", tree->keypath); 525 if (tree->keypath) efl_key_data_set(root, "_lot_node_name", tree->keypath);
526 vfd->root = root; 526 vfd->root = root;
527 } 527 }
528 efl_gfx_color_set(root, tree->mAlpha, tree->mAlpha, tree->mAlpha, tree->mAlpha);
529
530 _update_vg_tree(root, tree, 1); 528 _update_vg_tree(root, tree, 1);
531#else 529#else
532 return EINA_FALSE; 530 return EINA_FALSE;