From 836f24e2ba9b963f93dd50ca62ac74577be5e8a7 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 14 Dec 2018 17:28:33 +0900 Subject: [PATCH] evas json: optimize by applying path reserving. We can measure the path command and points count in advance. Skip the growing up path buffer by reserving buffer. Change-Id: I77887ae2c2fad283c359527287964644ed60209d --- src/static_libs/vg_common/vg_common_json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 44e920b..c7f8ca9 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -17,16 +17,17 @@ _construct_drawable_nodes(Efl_VG *root, const LOTLayerNode *layer, int depth EIN const LOTNode *node = layer->mNodeList.ptr[i]; if (!node) continue; + const float *data = node->mPath.ptPtr; + if (!data) continue; + Efl_VG* shape = evas_vg_shape_add(parent); if (!shape) continue; #if 0 for (int i = 0; i < depth; i++) printf(" "); printf("%s (%p)\n", efl_class_name_get(efl_class_get(shape)), shape); #endif - //0: Path - const float *data = node->mPath.ptPtr; - if (!data) continue; + efl_gfx_path_reserve(shape, node->mPath.elmCount, node->mPath.ptCount); for (int i = 0; i < node->mPath.elmCount; i++) { @@ -254,7 +255,6 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd) printf("%s (%p)\n", efl_class_name_get(efl_class_get(vfd->root)), vfd->root); #endif _update_vg_tree(root, tree, 1); - #else return EINA_FALSE; #endif -- 2.7.4