[EGIT] [core/efl] v-1.26.0 09/16: evas_vg_load_svg: Fix negative attrs length
raster pushed a commit to branch v-1.26.0. http://git.enlightenment.org/core/efl.git/commit/?id=76f698faf03be3812cc2220eb26ae5f5758fd1ec commit 76f698faf03be3812cc2220eb26ae5f5758fd1ec Author: JunsuChoi Date: Wed Jan 12 11:19:24 2022 +0900 evas_vg_load_svg: Fix negative attrs length Summary: After finding no attributes but spaces, attrsLength could be negative. This will cause a segfault in parser functions. So, change the position of attrs_length to prevent this. Test Plan: Example SVG ``` ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: #reviewers, cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12314 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 465b499505..8531aedbd3 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2276,12 +2276,12 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, { // find out the tag name starting from content till sz length sz = attrs - content; -attrs_length = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; if ((unsigned int)sz >= sizeof(tag_name)) return; strncpy(tag_name, content, sz); tag_name[sz] = '\0'; +attrs_length = length - sz; } if ((method = _find_group_factory(tag_name))) --
[EGIT] [core/efl] v-1.26.0 10/16: evas_vg_load_svg: Add check that stroke-dasharray is "none"
raster pushed a commit to branch v-1.26.0. http://git.enlightenment.org/core/efl.git/commit/?id=2c9f08f8cb43ed57fcead113c8e90b96bcf6f4c1 commit 2c9f08f8cb43ed57fcead113c8e90b96bcf6f4c1 Author: JunsuChoi Date: Wed Jan 12 11:33:43 2022 +0900 evas_vg_load_svg: Add check that stroke-dasharray is "none" Summary: "none" is the default value of dasharray and can actually be used. Currently using "none" causes a segfault. This patch prevents it. Test Plan: SVG image ``` http://www.w3.org/2000/svg;> ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12317 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 8531aedbd3..27f06e8cc7 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -267,6 +267,8 @@ _PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDI static inline void _parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length) { + if (strlen(str) >= 4 && !strncmp(str, "none", 4)) return; + // It is assumed that the length of the dasharray string is 255 or less. double tmp[255]; char *end = NULL; --
[EGIT] [core/efl] v-1.26.0 12/16: vg_common_svg: Fix when the number of polygon points is odd
raster pushed a commit to branch v-1.26.0. http://git.enlightenment.org/core/efl.git/commit/?id=a9dbba3f636481c9f60b8ae88328071bfc15e2b3 commit a9dbba3f636481c9f60b8ae88328071bfc15e2b3 Author: JunsuChoi Date: Wed Jan 12 11:35:31 2022 +0900 vg_common_svg: Fix when the number of polygon points is odd Summary: If the number of points is odd, an overflow occurs in array[i+1]. Test Plan: Test Svg image ``` http://www.w3.org/2000/svg; id="svg1" viewBox="0 0 200 200"> Not enough points Must contain at least 4 points ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12319 --- src/static_libs/vg_common/vg_common_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index d75486ed58..6efef669d6 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -832,7 +832,7 @@ _add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon) if (size < 2) return; efl_gfx_path_append_move_to(vg, array[0], array[1]); - for (i=2; i < size; i+=2) + for (i = 2; i < size - 1; i += 2) efl_gfx_path_append_line_to(vg, array[i], array[i+1]); if (polygon) --
[EGIT] [core/efl] v-1.26.0 07/16: evas_vg_load_svg: Prevent array overflow
raster pushed a commit to branch v-1.26.0. http://git.enlightenment.org/core/efl.git/commit/?id=1b64de1cca1ba268672ccb1bae0d882955a446f3 commit 1b64de1cca1ba268672ccb1bae0d882955a446f3 Author: JunsuChoi Date: Tue Jan 11 00:41:34 2022 + evas_vg_load_svg: Prevent array overflow Summary: sz must be less than 20 to append 'carriage return' Test Plan: Example SVG ``` ``` @fix Reviewers: Hermet, raster, kimcinoo Reviewed By: raster Subscribers: cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12313 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 1d93741ba3..465b499505 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2279,7 +2279,7 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, attrs_length = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; -if ((unsigned int)sz > sizeof(tag_name)) return; +if ((unsigned int)sz >= sizeof(tag_name)) return; strncpy(tag_name, content, sz); tag_name[sz] = '\0'; } --
[EGIT] [core/efl] v-1.26.0 11/16: evas_vg_load_svg: Fix colorstop offset parser
raster pushed a commit to branch v-1.26.0. http://git.enlightenment.org/core/efl.git/commit/?id=9dae699424ecfa5a1712004f0e8886e3ab40ccf7 commit 9dae699424ecfa5a1712004f0e8886e3ab40ccf7 Author: JunsuChoi Date: Wed Jan 12 11:34:29 2022 +0900 evas_vg_load_svg: Fix colorstop offset parser Summary: Values different from numbers and percentages should be ignored and the default values should be applied (zeros). And set the min and max of the offset value to be 0, 1. Also, this patch make that the offset is not input in the reverse order. Test Plan: Test SVG Image ``` http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink; > ``` Result {F4792365} Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12318 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 17 ++--- src/static_libs/vg_common/vg_common_svg.c | 11 +++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 27f06e8cc7..43a604d632 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -181,11 +181,22 @@ static inline double _to_offset(const char *str) { char *end = NULL; - + const char* str_end = str + strlen(str); double parsed_value = eina_convert_strtod_c(str, ); + char *ptr = strstr(str, "%"); - if (strstr(str, "%")) - parsed_value = parsed_value / 100.0; + end = _skip_space(end, NULL); + + if (ptr) + { +parsed_value = parsed_value / 100.0; +if (end != ptr || (end + 1) != str_end) + return 0; + } + else if (end != str_end) + { +return 0; + } return parsed_value; } diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 30fc0c0eb5..d75486ed58 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -696,6 +696,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F double fopacity = ((double) fill_opacity) / 255; //fill opacity if any exists. stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop)); i = 0; +double prevOffset = 0; EINA_LIST_FOREACH(g->stops, l, stop) { // Use premultiplied color @@ -705,6 +706,16 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F stops[i].b = (stop->b * opacity); stops[i].a = (stop->a * fopacity); stops[i].offset = stop->offset; + //NOTE: check the offset corner cases - refer to: https://svgwg.org/svg2-draft/pservers.html#StopNotes + if (stop->offset < prevOffset) + { + stops[i].offset = prevOffset; + } + else if (stop->offset > 1) + { + stops[i].offset = 1; + } + prevOffset = stops[i].offset; i++; } efl_gfx_gradient_stop_set(grad_obj, stops, stop_count); --
[EGIT] [core/efl] master 01/01: vg_common_svg: Fix when the number of polygon points is odd
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7b4c9284a91a8cc1dcb84f7008c82229995f6d89 commit 7b4c9284a91a8cc1dcb84f7008c82229995f6d89 Author: JunsuChoi Date: Wed Jan 12 11:35:31 2022 +0900 vg_common_svg: Fix when the number of polygon points is odd Summary: If the number of points is odd, an overflow occurs in array[i+1]. Test Plan: Test Svg image ``` http://www.w3.org/2000/svg; id="svg1" viewBox="0 0 200 200"> Not enough points Must contain at least 4 points ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12319 --- src/static_libs/vg_common/vg_common_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index d75486ed58..6efef669d6 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -832,7 +832,7 @@ _add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon) if (size < 2) return; efl_gfx_path_append_move_to(vg, array[0], array[1]); - for (i=2; i < size; i+=2) + for (i = 2; i < size - 1; i += 2) efl_gfx_path_append_line_to(vg, array[i], array[i+1]); if (polygon) --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Fix colorstop offset parser
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef784708b9278b8ef7131b2ee751e8c737fd3fa3 commit ef784708b9278b8ef7131b2ee751e8c737fd3fa3 Author: JunsuChoi Date: Wed Jan 12 11:34:29 2022 +0900 evas_vg_load_svg: Fix colorstop offset parser Summary: Values different from numbers and percentages should be ignored and the default values should be applied (zeros). And set the min and max of the offset value to be 0, 1. Also, this patch make that the offset is not input in the reverse order. Test Plan: Test SVG Image ``` http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink; > ``` Result {F4792365} Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12318 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 17 ++--- src/static_libs/vg_common/vg_common_svg.c | 11 +++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 27f06e8cc7..43a604d632 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -181,11 +181,22 @@ static inline double _to_offset(const char *str) { char *end = NULL; - + const char* str_end = str + strlen(str); double parsed_value = eina_convert_strtod_c(str, ); + char *ptr = strstr(str, "%"); - if (strstr(str, "%")) - parsed_value = parsed_value / 100.0; + end = _skip_space(end, NULL); + + if (ptr) + { +parsed_value = parsed_value / 100.0; +if (end != ptr || (end + 1) != str_end) + return 0; + } + else if (end != str_end) + { +return 0; + } return parsed_value; } diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 30fc0c0eb5..d75486ed58 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -696,6 +696,7 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F double fopacity = ((double) fill_opacity) / 255; //fill opacity if any exists. stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop)); i = 0; +double prevOffset = 0; EINA_LIST_FOREACH(g->stops, l, stop) { // Use premultiplied color @@ -705,6 +706,16 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F stops[i].b = (stop->b * opacity); stops[i].a = (stop->a * fopacity); stops[i].offset = stop->offset; + //NOTE: check the offset corner cases - refer to: https://svgwg.org/svg2-draft/pservers.html#StopNotes + if (stop->offset < prevOffset) + { + stops[i].offset = prevOffset; + } + else if (stop->offset > 1) + { + stops[i].offset = 1; + } + prevOffset = stops[i].offset; i++; } efl_gfx_gradient_stop_set(grad_obj, stops, stop_count); --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Add check that stroke-dasharray is "none"
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=92f77c512305dde21e25ca92baab138cfc498054 commit 92f77c512305dde21e25ca92baab138cfc498054 Author: JunsuChoi Date: Wed Jan 12 11:33:43 2022 +0900 evas_vg_load_svg: Add check that stroke-dasharray is "none" Summary: "none" is the default value of dasharray and can actually be used. Currently using "none" causes a segfault. This patch prevents it. Test Plan: SVG image ``` http://www.w3.org/2000/svg;> ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12317 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 8531aedbd3..27f06e8cc7 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -267,6 +267,8 @@ _PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDI static inline void _parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length) { + if (strlen(str) >= 4 && !strncmp(str, "none", 4)) return; + // It is assumed that the length of the dasharray string is 255 or less. double tmp[255]; char *end = NULL; --
[EGIT] [core/efl] master 01/01: Efl.Gfx.Path: Remove unnecessary optimization code for small arc
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5ebebe4698bf6618620a841b5af94afe1ea7a6fd commit 5ebebe4698bf6618620a841b5af94afe1ea7a6fd Author: JunsuChoi Date: Wed Jan 12 11:32:42 2022 +0900 Efl.Gfx.Path: Remove unnecessary optimization code for small arc Summary: This condition(optimization) is not a step suggested by arc implementation. https://www.w3.org/TR/SVG11/implnote.html#ArcCorrectionOutOfRangeRadii (Step2) This code is useful if the arc is too small to represent. However, scaling often occurs in vectors, which can create unnecessary problems. Test Plan: SVG Image ``` ``` image file {F4792225} result {F4792221} Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12316 --- src/lib/efl/interfaces/efl_gfx_path.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c index 4c20fb45b2..3b531a7eee 100644 --- a/src/lib/efl/interfaces/efl_gfx_path.c +++ b/src/lib/efl/interfaces/efl_gfx_path.c @@ -607,11 +607,6 @@ _efl_gfx_path_append_arc_to(Eo *obj, Efl_Gfx_Path_Data *pd, // Correction of out-of-range radii, see F6.6.1 (step 2) rx = fabs(rx); ry = fabs(ry); - if ((rx < 0.5) || (ry < 0.5)) - { -_efl_gfx_path_append_line_to(obj, pd, x, y); -return; - } angle = angle * M_PI / 180.0; cos_phi = cos(angle); --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Fix negative attrs length
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3411c604f2a7d226e288d36becb6fb5e286516db commit 3411c604f2a7d226e288d36becb6fb5e286516db Author: JunsuChoi Date: Wed Jan 12 11:19:24 2022 +0900 evas_vg_load_svg: Fix negative attrs length Summary: After finding no attributes but spaces, attrsLength could be negative. This will cause a segfault in parser functions. So, change the position of attrs_length to prevent this. Test Plan: Example SVG ``` ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: #reviewers, cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12314 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 465b499505..8531aedbd3 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2276,12 +2276,12 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, { // find out the tag name starting from content till sz length sz = attrs - content; -attrs_length = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; if ((unsigned int)sz >= sizeof(tag_name)) return; strncpy(tag_name, content, sz); tag_name[sz] = '\0'; +attrs_length = length - sz; } if ((method = _find_group_factory(tag_name))) --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Prevent array overflow
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a32373195b4b0323fa252f393451f21114c7f92b commit a32373195b4b0323fa252f393451f21114c7f92b Author: JunsuChoi Date: Tue Jan 11 00:41:34 2022 + evas_vg_load_svg: Prevent array overflow Summary: sz must be less than 20 to append 'carriage return' Test Plan: Example SVG ``` ``` @fix Reviewers: Hermet, raster, kimcinoo Reviewed By: raster Subscribers: cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12313 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 1d93741ba3..465b499505 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2279,7 +2279,7 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, attrs_length = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; -if ((unsigned int)sz > sizeof(tag_name)) return; +if ((unsigned int)sz >= sizeof(tag_name)) return; strncpy(tag_name, content, sz); tag_name[sz] = '\0'; } --
[EGIT] [core/efl] master 01/01: vg_common_json: Fix a missing of free after using
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=256c79283797f9540e2834542e5e49ecb38c8238 commit 256c79283797f9540e2834542e5e49ecb38c8238 Author: JunsuChoi Date: Tue Nov 26 13:50:00 2019 +0900 vg_common_json: Fix a missing of free after using Summary: iterator itr will leak by going out the function widthout freeing. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10736 --- src/static_libs/vg_common/vg_common_json.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 734f7f648d..abad5f3fc9 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -365,6 +365,7 @@ _reset_vg_tree(Efl_VG *node) Eina_Iterator *itr = efl_canvas_vg_container_children_get(node); EINA_ITERATOR_FOREACH(itr, child) _reset_vg_tree(child); +if (itr) eina_iterator_free(itr); } efl_gfx_entity_visible_set(node, EINA_FALSE); } --
[EGIT] [core/efl] master 01/01: Efl.Canvas.Image: Add skeleton code Efl.Gfx.Frame_Controller.sector
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f1275e86f49b7a798550f57a13495ec0c3d2805b commit f1275e86f49b7a798550f57a13495ec0c3d2805b Author: JunsuChoi Date: Tue Nov 26 10:54:37 2019 +0900 Efl.Canvas.Image: Add skeleton code Efl.Gfx.Frame_Controller.sector Summary: Sector is a property with start, end frame and sector name information that can be used when playing a specific section. Sector play is not supported for Efl.Canvas.Image yet. So we add skeleton code with comments. This is also for full implements of the Efl.Gfx.Frame_Controller interface. Test Plan: N/A Reviewers: Hermet, bu5hm4n Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10718 --- src/lib/evas/canvas/efl_canvas_image.c | 22 ++ src/lib/evas/canvas/efl_canvas_image.eo | 1 + 2 files changed, 23 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c index 9b19be0775..1bdd5329ec 100644 --- a/src/lib/evas/canvas/efl_canvas_image.c +++ b/src/lib/evas/canvas/efl_canvas_image.c @@ -517,6 +517,28 @@ _efl_canvas_image_efl_gfx_frame_controller_frame_duration_get(const Eo *eo_obj, return _evas_image_animated_frame_duration_get(eo_obj, start_frame, frame_num); } +Eina_Bool _efl_canvas_image_efl_gfx_frame_controller_sector_set(Eo *obj EINA_UNUSED, +void *_pd EINA_UNUSED, +const char *name EINA_UNUSED, +int startframe EINA_UNUSED, +int endframe EINA_UNUSED) +{ + // TODO: We need to implement the feature to section playback of image animation. + ERR("efl_gfx_frame_controller_sector_set not implemented for efl_canvas_image yet."); + return EINA_FALSE; +} + +Eina_Bool _efl_canvas_image_efl_gfx_frame_controller_sector_get(const Eo *obj EINA_UNUSED, + void *_pd EINA_UNUSED, + const char *name EINA_UNUSED, + int *startframe EINA_UNUSED, + int *endframe EINA_UNUSED) +{ + // TODO: We need to implement the feature to section playback of image animation. + ERR("efl_gfx_frame_controller_sector_get not implemented for efl_canvas_image yet."); + return EINA_FALSE; +} + Eina_Bool _evas_image_animated_frame_set(Eo *eo_obj, int frame_index) { diff --git a/src/lib/evas/canvas/efl_canvas_image.eo b/src/lib/evas/canvas/efl_canvas_image.eo index 428a1f900a..72e1894f61 100644 --- a/src/lib/evas/canvas/efl_canvas_image.eo +++ b/src/lib/evas/canvas/efl_canvas_image.eo @@ -24,6 +24,7 @@ class @beta Efl.Canvas.Image extends Efl.Canvas.Image_Internal implements Efl.Gfx.Frame_Controller.loop_type { get; } Efl.Gfx.Frame_Controller.loop_count { get; } Efl.Gfx.Frame_Controller.frame_duration { get; } + Efl.Gfx.Frame_Controller.sector { set; get; } Efl.Gfx.Image_Load_Controller.load_async_start; Efl.Gfx.Image_Load_Controller.load_async_cancel; Efl.Gfx.Image_Load_Controller.load_dpi { get; set; } --
[EGIT] [core/efl] master 01/01: Efl.Canvas.Vg.Container : Initialize mask buffer for SUB, INS composition.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b798f9146c947749dff255ef3301117a084e035c commit b798f9146c947749dff255ef3301117a084e035c Author: JunsuChoi Date: Mon Nov 25 19:04:30 2019 +0900 Efl.Canvas.Vg.Container : Initialize mask buffer for SUB, INS composition. Summary: If composite method is substract or intersect, buffer needs initialize. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10732 --- src/lib/evas/canvas/efl_canvas_vg_container.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index c6fe0c4af2..6168edf618 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -108,6 +108,12 @@ _prepare_comp(Evas_Object_Protected_Data *obj, //vector object EFL_GFX_COLORSPACE_ARGB, >comp.stride); if (!pd->comp.pixels) ERR("Failed to map VG composite buffer"); + +//If composite method is SUBSTRACT or INTERSECT, Buffer needs initialize. +if (pd->comp.pixels && +(pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_SUBSTRACT || + pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT)) + memset(pd->comp.pixels, init_buffer, pd->comp.length); } else { --
[EGIT] [core/efl] master 01/01: vector lottie: Set visibility vg node
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0f9b749f68fd250989a2810ce54cf24d3afd0f73 commit 0f9b749f68fd250989a2810ce54cf24d3afd0f73 Author: JunsuChoi Date: Mon Nov 25 13:39:01 2019 +0900 vector lottie: Set visibility vg node Summary: All nodes reset their visibility when they are reused. Therefore, visibility must be set true if mVisibile is true. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10731 --- src/static_libs/vg_common/vg_common_json.c | 4 1 file changed, 4 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 43ef86b353..734f7f648d 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -184,6 +184,7 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l grad = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, parent); efl_key_data_set(shape, key, grad); } + efl_gfx_entity_visible_set(grad, EINA_TRUE); efl_gfx_gradient_linear_start_set(grad, node->mGradient.start.x, node->mGradient.start.y); efl_gfx_gradient_linear_end_set(grad, node->mGradient.end.x, node->mGradient.end.y); } @@ -196,6 +197,7 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l grad = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, parent); efl_key_data_set(shape, key, grad); } + efl_gfx_entity_visible_set(grad, EINA_TRUE); efl_gfx_gradient_radial_center_set(grad, node->mGradient.center.x, node->mGradient.center.y); efl_gfx_gradient_radial_focal_set(grad, node->mGradient.focal.x, node->mGradient.focal.y); efl_gfx_gradient_radial_radius_set(grad, node->mGradient.cradius); @@ -307,6 +309,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int msource = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, mtarget); efl_key_data_set(mtarget, key, msource); } + efl_gfx_entity_visible_set(msource, EINA_TRUE); //FIXME : EFL_GFX_VG_COMPOSITE_METHOD_ALPHA option is temporary //Currently matte alpha implements is same the mask intersect implement. @@ -327,6 +330,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int msource = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, mtarget); efl_key_data_set(mtarget, key, msource); } +efl_gfx_entity_visible_set(msource, EINA_TRUE); _construct_mask_nodes(msource, mask, depth + 1); Efl_Gfx_Vg_Composite_Method mask_mode; --
[EGIT] [core/efl] master 01/01: elm/hoversel: Recalculate items before box calculate.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=044bc28e3a7087ae66ef463d0b8bce7e818cb195 commit 044bc28e3a7087ae66ef463d0b8bce7e818cb195 Author: JunsuChoi Date: Thu Nov 21 19:49:01 2019 +0900 elm/hoversel: Recalculate items before box calculate. Summary: After the item is packed into the box, the min of the item can be initialized with content_set working. content_set calls parent_set and checks the theme when calling parent_set. At that time, if theme is changed in the parent of layout using hoversel, call theme_apply(efl_ui_layout) to make min value 0, 0. This patch can avoid it. Test Plan: N/A Reviewers: YOhoho, Hermet, woohyun, zmike, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10712 --- src/lib/elementary/elc_hoversel.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index ca08e713df..2f742f2051 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -238,6 +238,8 @@ static void _sizing_eval(void *data) { Evas_Object *obj = data; + Elm_Object_Item *eo_item; + const Eina_List *l; const char *max_size_str; int max_size = 0; char buf[128]; @@ -255,6 +257,12 @@ _sizing_eval(void *data) elm_layout_signal_emit(sd->hover, "elm,state,align,default", "elm"); edje_object_message_signal_process(elm_layout_edje_get(sd->hover)); + EINA_LIST_FOREACH(sd->items, l, eo_item) + { +ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); +efl_canvas_group_calculate(VIEW(item)); + } + elm_box_recalculate(sd->bx); evas_object_size_hint_combined_min_get(sd->bx, _w, _h); @@ -501,7 +509,6 @@ _activate(Evas_Object *obj) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); evas_object_show(VIEW(item)); -efl_canvas_group_calculate(VIEW(item)); elm_box_pack_end(sd->bx, VIEW(item)); } --
[EGIT] [core/efl] master 01/01: Eina_Matrix : Use math header for cosf and sinf of rotate function.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3493a37db82edd7178efc3da6651daede2684f12 commit 3493a37db82edd7178efc3da6651daede2684f12 Author: JunsuChoi Date: Fri Nov 8 06:33:50 2019 + Eina_Matrix : Use math header for cosf and sinf of rotate function. The local cos and sin functions differ from the math header cos and sin functions by result values The 4th decimal place is different. Computing large numbers can cause errors. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10467 --- src/lib/eina/eina_matrix.c| 10 +- src/tests/eina/eina_test_matrix.c | 14 +++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/eina/eina_matrix.c b/src/lib/eina/eina_matrix.c index 1c848f3e98..ad7cdb03ff 100644 --- a/src/lib/eina/eina_matrix.c +++ b/src/lib/eina/eina_matrix.c @@ -542,7 +542,15 @@ EAPI void eina_matrix3_rotate(Eina_Matrix3 *m, double rad) { double c, s; -#if 0 + + /* Note: Local functions do not guarantee accuracy. +* Errors occur in the calculation of very small or very large numbers. +* Local cos and sin functions differ from the math header cosf and sinf functions +* by result values. The 4th decimal place is different. +* But local functions are certainly faster than functions in math library. +* Later we would want someone to look at this and improve accuracy. +*/ +#if 1 c = cosf(rad); s = sinf(rad); #else diff --git a/src/tests/eina/eina_test_matrix.c b/src/tests/eina/eina_test_matrix.c index 1d54f21e3f..ac3afa827f 100644 --- a/src/tests/eina/eina_test_matrix.c +++ b/src/tests/eina/eina_test_matrix.c @@ -400,6 +400,7 @@ EFL_START_TEST(eina_matrix3_operations) zx, zy, zz; double tx = 20, ty = 30, ret; const double arr[] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; + double rotate_radian = 45.0 * M_PI / 180.0; eina_matrix3_values_set(, 1, 0, 0, @@ -458,13 +459,12 @@ EFL_START_TEST(eina_matrix3_operations) 1, 0, 0, 0, 1, 0, 0, 0, 1); - eina_matrix3_rotate(, M_PI/2); - - fail_if (!MATRIX3_CMP(round(m1.xx), round(m1.xy), round(m1.xz), - round(m1.yx), round(m1.yy), round(m1.yz), - round(m1.zx), round(m1.zy), round(m1.zz), - 0, -1, 0, - 1, 0, 0, + eina_matrix3_rotate(, rotate_radian); + fail_if (!MATRIX3_CMP(m1.xx, m1.xy, m1.xz, + m1.yx, m1.yy, m1.yz, + m1.zx, m1.zy, m1.zz, + cosf(rotate_radian), -sinf(rotate_radian), 0, + sinf(rotate_radian), cosf(rotate_radian), 0, 0, 0, 1)); eina_matrix3_values_set(, --
[EGIT] [core/efl] master 01/01: efl_canvas_vg_node: Prevent access to NULL object for remove warning
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=288218527d494e1ca3146b0321b0967842fecae6 commit 288218527d494e1ca3146b0321b0967842fecae6 Author: JunsuChoi Date: Thu Nov 14 11:25:52 2019 +0900 efl_canvas_vg_node: Prevent access to NULL object for remove warning Summary: For remove this warning WRN<3378>:eo ../src/lib/eo/eo.c:644 _efl_object_call_resolve() NULL passed to function efl_invalidated_get(). Test Plan: elementary_test -> animation_view Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10627 --- src/lib/evas/canvas/efl_canvas_vg_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c index 5064407f03..72d0265908 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node.c @@ -30,7 +30,7 @@ _node_change(Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd) if (pnd->flags != EFL_GFX_CHANGE_FLAG_NONE) break; pnd->flags = EFL_GFX_CHANGE_FLAG_ALL; } - if (efl_invalidated_get(nd->vg_obj)) return; + if (!nd->vg_obj || efl_invalidated_get(nd->vg_obj)) return; efl_canvas_vg_object_change(nd->vd); } --
[EGIT] [core/efl] master 01/01: wl_egl : Prevent access to NULL pointer
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f4fa719eaecb09b479b2807dcf661820d3b7fe3d commit f4fa719eaecb09b479b2807dcf661820d3b7fe3d Author: JunsuChoi Date: Wed Nov 13 13:40:44 2019 +0900 wl_egl : Prevent access to NULL pointer Summary: The pointer s can be null. Test Plan: N/A Reviewers: Jaehyun_Cho, raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10654 --- src/modules/evas/engines/wayland_egl/evas_wl_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index 95e59ce9e2..cad83434fc 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -48,7 +48,7 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap wl_disp = ecore_wl2_display_get(gw->wl2_disp); const char *s = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); - if (strstr(s, "EXT_platform_base")) + if (s && strstr(s, "EXT_platform_base")) { EGLDisplay (*func) (EGLenum platform, void *native_display, const EGLint *attrib_list); func = (void *)eglGetProcAddress("eglGetPlatformDisplayEXT"); --
[EGIT] [core/efl] master 01/01: evas_device: Fix typo in evas_device_pop
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=04e3d8cc3d67317e9508f1f1e5ffd1b7d61b43d7 commit 04e3d8cc3d67317e9508f1f1e5ffd1b7d61b43d7 Author: JunsuChoi Date: Tue Nov 12 16:23:33 2019 +0900 evas_device: Fix typo in evas_device_pop Summary: Fix wrong null check Test Plan: N/A Reviewers: cedric, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10648 --- src/lib/evas/canvas/evas_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index 1652e79100..112132574d 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c @@ -289,7 +289,7 @@ evas_device_pop(Evas *eo_e) Evas_Device *dev; Evas_Public_Data *e = efl_data_scope_safe_get(eo_e, EVAS_CANVAS_CLASS); - if (e) return ; + if (!e) return ; dev = eina_array_pop(e->cur_device); if (dev) efl_unref(dev); } --
[EGIT] [core/efl] master 01/01: Efl.Ui.Animation_View: Implement sector playing feature
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7d97abc05b0a7a4fd146bffb29e3d9a4c9ecc567 commit 7d97abc05b0a7a4fd146bffb29e3d9a4c9ecc567 Author: JunsuChoi Date: Tue Nov 12 14:30:25 2019 +0900 Efl.Ui.Animation_View: Implement sector playing feature Summary: play_sector method is API for playing section. If the animation object has section information, user can play the section. Get the start and end section name and get the frame of each section. And set and play the min and max frames of the current animation object. Depends on D10506 Test Plan: For example. Animation objects have "first","second" and "third" sectors. And sector "second" has duration information. User can use it like this: efl_ui_animation_view_play_sector(anim_view, "first", "second"); efl_ui_animation_view_play_sector(anim_view, "second", NULL); efl_ui_animation_view_play_sector(anim_view, "first", NULL); // first sector ~ end frame of animation object. efl_ui_animation_view_play_sector(anim_view, "second", "third"); efl_ui_animation_view_play_sector(anim_view, "second", "wrong name"); Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10507 --- src/lib/elementary/efl_ui_animation_view.c | 31 + src/lib/elementary/efl_ui_animation_view.eo | 19 ++ 2 files changed, 50 insertions(+) diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c index 82aba0f3c4..074ebfdf8d 100644 --- a/src/lib/elementary/efl_ui_animation_view.c +++ b/src/lib/elementary/efl_ui_animation_view.c @@ -468,6 +468,37 @@ _efl_ui_animation_view_play(Eo *obj, Efl_Ui_Animation_View_Data *pd) return EINA_TRUE; } +Eina_Bool _efl_ui_animation_view_play_sector(Eo *obj, Efl_Ui_Animation_View_Data *pd, const char *start, const char *end) +{ + int start_frame = 0; + int end_frame = evas_object_vg_animated_frame_count_get(pd->vg) - 1; + + if (start && end) + { +efl_gfx_frame_controller_sector_get(pd->vg, start, _frame, NULL); +efl_gfx_frame_controller_sector_get(pd->vg, end, _frame, NULL); + } + else + { +if (start) + { + efl_gfx_frame_controller_sector_get(pd->vg, start, _frame, _frame); + } +else if (end) + { + efl_gfx_frame_controller_sector_get(pd->vg, end, _frame, NULL); + } + } + + efl_ui_animation_view_min_frame_set(obj, start_frame); + if (start_frame < end_frame) + efl_ui_animation_view_max_frame_set(obj, end_frame); + + if (!efl_ui_animation_view_play(obj)) + return EINA_FALSE; + return EINA_TRUE; +} + EOLIAN static Eina_Bool _efl_ui_animation_view_stop(Eo *obj, Efl_Ui_Animation_View_Data *pd) { diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo index 2d090bbee7..f06c9b1ce2 100644 --- a/src/lib/elementary/efl_ui_animation_view.eo +++ b/src/lib/elementary/efl_ui_animation_view.eo @@ -135,6 +135,25 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, return: bool; [[$true when it's successful. $false otherwise.]] } + play_sector { + [[Play animation of sector one time instantly when it's available. + + If end sector is NULL, only start sector is referenced. + If both the start and end sectors are valid, + Play is played and stoped at starting point of each sector. + + If start is null and end is valid, playback starts from 0 frame to the start frame of the end sector. + If both sectors start and end are invalid. Play from 0 frame to the last frame of animation view object. + + Note: This method use to @.min_frame, @.max_frame (@.min_progress, @.max_progress) internally. + So if you have changed the min or max frame(progress) it can be changed to the sector frame. + ]] + params { +@in start: string; [[ The name of start sector ]] +@in end: string; [[ The name of end sector ]] + } + return: bool; [[$true when it's successful. $false otherwise.]] + } play_back { [[Play back animation one time instantly when it's available. --
[EGIT] [core/efl] master 01/01: Efl.Gfx.Frame_Controller: Add sector property
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bcfffc07cfdae0a95cd5ce6a5d7ca1f402b52210 commit bcfffc07cfdae0a95cd5ce6a5d7ca1f402b52210 Author: JunsuChoi Date: Tue Nov 12 14:30:10 2019 +0900 Efl.Gfx.Frame_Controller: Add sector property Summary: These APIs to get and set frames for a specific section for playing section. Depends on D10505 Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10506 --- src/lib/efl/interfaces/efl_gfx_frame_controller.eo | 19 + src/lib/evas/canvas/efl_canvas_vg_object.c | 24 ++ src/lib/evas/canvas/efl_canvas_vg_object.eo| 1 + 3 files changed, 44 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_frame_controller.eo b/src/lib/efl/interfaces/efl_gfx_frame_controller.eo index bedacf33d7..2d8481d184 100644 --- a/src/lib/efl/interfaces/efl_gfx_frame_controller.eo +++ b/src/lib/efl/interfaces/efl_gfx_frame_controller.eo @@ -98,5 +98,24 @@ interface @beta Efl.Gfx.Frame_Controller duration: double; [[Duration in seconds]] } } + @property sector { + [[The sector for playing section. + + Returns the start and end frame of the sector specified by the name. + ]] + set { +return: bool; [[ Returns $true if sector and frame set success. ]] + } + get { +return: bool; [[ Returns $true if frames get success. ]] + } + keys { +name: string; [[ The name of sector ]] + } + values { +startframe: int; [[ The start frame of sector ]] +endframe: int; [[ The end frame of sector ]] + } + } } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 1027907a8d..3c3c0d81d6 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -943,6 +943,30 @@ _efl_canvas_vg_object_efl_gfx_frame_controller_frame_duration_get(const Eo *eo_o return evas_cache_vg_anim_duration_get(pd->vg_entry); } +Eina_Bool _efl_canvas_vg_object_efl_gfx_frame_controller_sector_set(Eo *obj EINA_UNUSED, + Efl_Canvas_Vg_Object_Data *pd, +const char *name, +int startframe, +int endframe) +{ + if (!pd->vg_entry) return EINA_FALSE; + if (!evas_cache_vg_anim_sector_set(pd->vg_entry, name, startframe, endframe)) + return EINA_FALSE; + return EINA_TRUE; +} + +Eina_Bool _efl_canvas_vg_object_efl_gfx_frame_controller_sector_get(const Eo *obj EINA_UNUSED, + Efl_Canvas_Vg_Object_Data *pd, +const char *name, +int *startframe, +int *endframe) +{ + if (!pd->vg_entry) return EINA_FALSE; + if (!evas_cache_vg_anim_sector_get(pd->vg_entry, name, startframe, endframe)) + return EINA_FALSE; + return EINA_TRUE; +} + EOLIAN static Eina_Bool _efl_canvas_vg_object_efl_gfx_frame_controller_frame_set(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd, diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo index 2213c232ae..51eded82d5 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo @@ -89,5 +89,6 @@ class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File, Efl.Gfx.Frame_Controller.loop_type { get; } Efl.Gfx.Frame_Controller.loop_count { get; } Efl.Gfx.Frame_Controller.frame_duration { get; } + Efl.Gfx.Frame_Controller.sector { set; get; } } } --
[EGIT] [core/efl] master 01/01: evas_cache_vg : Implements sector_get/set internal APIs
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=93551ca58e8c5676b116d98eba07a8061c4ec8fd commit 93551ca58e8c5676b116d98eba07a8061c4ec8fd Author: JunsuChoi Date: Tue Nov 12 14:29:50 2019 +0900 evas_cache_vg : Implements sector_get/set internal APIs Summary: These APIs to get and set frames for a specific section in vg animation. get API looks for a sector by name in the markerlist of VG_File_Data. Then return start and end frames. Depends on D10504 Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10505 --- src/lib/evas/canvas/evas_vg_private.h | 2 ++ src/lib/evas/vg/evas_vg_cache.c | 52 +++ 2 files changed, 54 insertions(+) diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index 036604b6ad..f5600f9757 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -151,6 +151,8 @@ Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info); Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info); double evas_cache_vg_anim_duration_get(const Vg_Cache_Entry *vg_entry); +Eina_Bool evas_cache_vg_anim_sector_set(const Vg_Cache_Entry* vg_entry, const char *name, int startframe, int endframe); +Eina_Bool evas_cache_vg_anim_sector_get(const Vg_Cache_Entry* vg_entry, const char *name, int* startframe, int* endframe); unsigned intevas_cache_vg_anim_frame_count_get(const Vg_Cache_Entry *vg_entry); Eina_Size2D evas_cache_vg_entry_default_size_get(const Vg_Cache_Entry *vg_entry); voidefl_canvas_vg_node_vg_obj_set(Efl_VG *node, Efl_VG *vg_obj, Efl_Canvas_Vg_Object_Data *vd); diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index 391d3cb2a9..8ffdfab3f8 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -433,6 +433,58 @@ evas_cache_vg_anim_frame_count_get(const Vg_Cache_Entry* vg_entry) return vfd->anim_data->frame_cnt; } +Eina_Bool +evas_cache_vg_anim_sector_set(const Vg_Cache_Entry* vg_entry, const char *name, int startframe, int endframe) +{ + if (!vg_entry) return EINA_FALSE; + if (!vg_entry->vfd->anim_data) return EINA_FALSE; + if (!vg_entry->vfd->anim_data->markers) return EINA_FALSE; + if (!name) return EINA_FALSE; + + Vg_File_Anim_Data_Marker *marker; + Vg_File_Anim_Data_Marker new_marker; + int i = 0; + + EINA_INARRAY_FOREACH(vg_entry->vfd->anim_data->markers, marker) + { +if (!strcmp(marker->name, name)) + { + marker->startframe = startframe; + marker->endframe = endframe; + return EINA_TRUE; + } +i++; + } + + new_marker.name = eina_stringshare_add(name); + new_marker.startframe = startframe; + new_marker.endframe = endframe; + eina_inarray_push(vg_entry->vfd->anim_data->markers, _marker); + + return EINA_TRUE; +} + +Eina_Bool +evas_cache_vg_anim_sector_get(const Vg_Cache_Entry* vg_entry, const char *name, int* startframe, int* endframe) +{ + if (!vg_entry) return EINA_FALSE; + if (!vg_entry->vfd->anim_data) return EINA_FALSE; + if (!vg_entry->vfd->anim_data->markers) return EINA_FALSE; + if (!name) return EINA_FALSE; + + Vg_File_Anim_Data_Marker *marker; + EINA_INARRAY_FOREACH(vg_entry->vfd->anim_data->markers, marker) + { +if (!strcmp(marker->name, name)) + { + if (startframe) *startframe = marker->startframe; + if (endframe) *endframe = marker->endframe; + return EINA_TRUE; + } + } + return EINA_FALSE; +} + Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num) { --
[EGIT] [core/efl] master 01/01: vg_loader: Get markers information form json data.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ddaa5d1e6e76e76cf836182ee392f8b464a243d4 commit ddaa5d1e6e76e76cf836182ee392f8b464a243d4 Author: JunsuChoi Date: Tue Nov 12 14:28:44 2019 +0900 vg_loader: Get markers information form json data. Summary: If json data has marker information, it is stored in vg file data. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10504 --- src/lib/evas/include/evas_private.h| 9 .../evas/vg_loaders/json/evas_vg_load_json.c | 24 ++ 2 files changed, 33 insertions(+) diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 2081c3dc85..838174a3f2 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -141,6 +141,7 @@ typedef struct _Evas_Canvas3D_File_Eet Evas_Canvas3D_File_Eet; typedef struct _Vg_File_Data Vg_File_Data; typedef struct _Vg_File_Anim_Data Vg_File_Anim_Data; +typedef struct _Vg_File_Anim_Data_Marker Vg_File_Anim_Data_Marker; struct _Evas_Canvas3D_Vec2_Eet { @@ -1533,11 +1534,19 @@ struct _Evas_Image_Save_Func int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding); }; +struct _Vg_File_Anim_Data_Marker +{ + Eina_Stringshare *name; + int startframe; + int endframe; +}; + struct _Vg_File_Anim_Data { unsigned int frame_num;//current frame number unsigned int frame_cnt;//total frame count floatduration; //animation duration + Eina_Inarray *markers; //array of Vg_File_Anim_Data_Marker }; struct _Vg_File_Data diff --git a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c index fbcfa9c83a..e7f2754dd9 100644 --- a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c +++ b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c @@ -20,6 +20,13 @@ evas_vg_load_file_close_json(Vg_File_Data *vfd) Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data; lottie_animation_destroy(lot_anim); + if (vfd->anim_data->markers) + { +Vg_File_Anim_Data_Marker *marker; +EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker) + if (marker->name) eina_stringshare_del(marker->name); +eina_inarray_free(vfd->anim_data->markers); + } if (vfd->anim_data) free(vfd->anim_data); if (vfd->root) efl_unref(vfd->root); free(vfd); @@ -70,6 +77,23 @@ evas_vg_load_file_open_json(Eina_File *file, if (!vfd->anim_data) goto err; vfd->anim_data->duration = lottie_animation_get_duration(lot_anim); vfd->anim_data->frame_cnt = frame_cnt; + +// marker information +const LOTMarkerList *markerlist = lottie_animation_get_markerlist(lot_anim); +if (markerlist && markerlist->size > 0) + { + Vg_File_Anim_Data_Marker *marker; + int i = 0; + vfd->anim_data->markers = eina_inarray_new(sizeof(Vg_File_Anim_Data_Marker), 0); + eina_inarray_resize(vfd->anim_data->markers, markerlist->size); + EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker) + { + marker->name = eina_stringshare_add(markerlist->ptr[i].name); + marker->startframe = markerlist->ptr[i].startframe; + marker->endframe = markerlist->ptr[i].endframe; + i++; + } + } } //default size --
[EGIT] [core/efl] master 01/01: ecore_event: Remove unused goto define
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=39bde2cedf2ea87b18e38a7df757425e24ffe70f commit 39bde2cedf2ea87b18e38a7df757425e24ffe70f Author: JunsuChoi Date: Fri Nov 1 12:46:24 2019 +0900 ecore_event: Remove unused goto define Summary: For remove -Wunused-label warning Test Plan: N/A Reviewers: Hermet, kimcinoo, YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10584 --- src/lib/ecore/ecore_events.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c index c2fc813c6d..b0a6607d6a 100644 --- a/src/lib/ecore/ecore_events.c +++ b/src/lib/ecore/ecore_events.c @@ -153,9 +153,6 @@ _ecore_event_init(void) // no need to do as it was a count, nto an event return EINA_TRUE; - - err_pool: - return EINA_FALSE; } void --
[EGIT] [core/efl] master 01/01: vg_common_svg: Free node tree for memory leak after eet write.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cf61adaff17a698085655acac889c804cd2895a6 commit cf61adaff17a698085655acac889c804cd2895a6 Author: JunsuChoi Date: Tue Oct 29 13:17:05 2019 +0900 vg_common_svg: Free node tree for memory leak after eet write. Summary: The node tree created from vg_common_svg_create_svg_node is not used after eet_data_write(). Therefore, to prevent memory leaks, free the node tree. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10443 --- src/modules/evas/vg_savers/eet/evas_vg_save_eet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c index a7a1bf36ae..96fa7f4150 100644 --- a/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c +++ b/src/modules/evas/vg_savers/eet/evas_vg_save_eet.c @@ -28,6 +28,8 @@ evas_vg_save_file_eet(Vg_File_Data *evg_data, const char *file, const char *key, eet_data_write(ef, svg_node_eet, key, root, compress); eet_close(ef); + vg_common_svg_node_free(root); + return EVAS_LOAD_ERROR_NONE; } --
[EGIT] [core/efl] master 01/01: efl_canvas_vg : Propagates the alpha color of the parent
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=59419006b89cd304fa697627c968d6ea03482f60 commit 59419006b89cd304fa697627c968d6ea03482f60 Author: JunsuChoi Date: Wed Oct 16 15:12:13 2019 +0900 efl_canvas_vg : Propagates the alpha color of the parent Summary: The current color is affected by the parent's opacity. If p_opacity is set, it will be applied to the current color. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10399 --- src/lib/evas/canvas/efl_canvas_vg_container.c | 12 src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c | 4 +++- src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c | 4 +++- src/lib/evas/canvas/efl_canvas_vg_image.c | 10 -- src/lib/evas/canvas/efl_canvas_vg_object.c | 4 ++-- src/lib/evas/canvas/efl_canvas_vg_shape.c | 10 ++ src/lib/evas/canvas/evas_vg_private.h | 19 +-- 7 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index f4bf4d7637..471ea3dd6c 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -54,6 +54,8 @@ _prepare_comp(Evas_Object_Protected_Data *obj, //vector object Ector_Surface *surface, Eina_Matrix3 *ptransform, Eina_Matrix3 *ctransform, + int p_opacity, + int c_opacity, Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method) { @@ -127,7 +129,7 @@ _prepare_comp(Evas_Object_Protected_Data *obj, //vector object src_pd = efl_data_scope_get(eina_list_nth(target_pd->comp.src, 0), MY_CLASS); _evas_vg_render_pre(obj, comp_target, engine, output, context, surface, - ctransform, comp, src_pd->comp.method); + ctransform, c_opacity, comp, src_pd->comp.method); } } @@ -135,7 +137,7 @@ _prepare_comp(Evas_Object_Protected_Data *obj, //vector object _evas_vg_render_pre(obj, comp_target, engine, output, context, surface, - ptransform, comp, comp_method); + ptransform, p_opacity, comp, comp_method); //4. Generating Composite Image. ector_buffer_pixels_set(surface, pd->comp.pixels, size.w, size.h, pd->comp.stride, @@ -153,6 +155,7 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, +int p_opacity, Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method, void *data) @@ -168,6 +171,7 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, nd->flags = EFL_GFX_CHANGE_FLAG_NONE; EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd); + EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, p_opacity, nd); //Container may have composite target. //FIXME : _prepare_comp() should only work in cases with matte or masking. @@ -179,7 +183,7 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, comp_method = pd->comp.method; comp = _prepare_comp(vg_pd, pd->comp_target, engine, output, context, surface, - ptransform, ctransform, comp, comp_method); + ptransform, ctransform, p_opacity, c_a, comp, comp_method); } EINA_LIST_FOREACH(pd->children, l, child) @@ -204,7 +208,7 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, _evas_vg_render_pre(vg_pd, child, engine, output, context, surface, -ctransform, comp, comp_method); +ctransform, c_a, comp, comp_method); } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c index 1d4eb6a154..2781ce9d11 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c @@ -64,6 +64,7 @@ _efl_canvas_vg_gradient_linear_render_pre(Evas_Object_Protected_Data *vg_pd EINA
[EGIT] [core/efl] master 01/01: vg_common_svg: Support opacity attribute of element
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=74e2c80b6e3d3d4ee25792140cdbc4a95ef08f3b commit 74e2c80b6e3d3d4ee25792140cdbc4a95ef08f3b Author: JunsuChoi Date: Tue Oct 15 14:53:25 2019 +0900 vg_common_svg: Support opacity attribute of element Summary: The element can have an opacity. Therefore, if node type is SVG_NODE_G, set color. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10371 --- src/static_libs/vg_common/vg_common_svg.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 6cc66ae903..1d01f9f243 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -718,10 +718,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ if (node->type != SVG_NODE_DOC && !node->display) efl_gfx_entity_visible_set(vg, EINA_FALSE); - if ((node->type == SVG_NODE_G) || (node->type == SVG_NODE_DOC)) return; - - // apply the fill style property - efl_gfx_shape_fill_rule_set(vg, style->fill.fill_rule); + if (node->type == SVG_NODE_DOC) return; // if fill property is NULL then do nothing if (style->fill.paint.none) @@ -757,6 +754,11 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ efl_gfx_color_set(vg, ((float) r) * fa, ((float) g) * fa, ((float) b) * fa, ((float) a) * fa); } + if (node->type == SVG_NODE_G) return; + + // apply the fill style property + efl_gfx_shape_fill_rule_set(vg, style->fill.fill_rule); + efl_gfx_shape_stroke_width_set(vg, style->stroke.width); efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap); efl_gfx_shape_stroke_join_set(vg, style->stroke.join); --
[EGIT] [core/efl] master 01/01: vg_common_json: Apply image's alpha color
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4510b46d05f5313a45a4a37f50672ba8510b6e2e commit 4510b46d05f5313a45a4a37f50672ba8510b6e2e Author: JunsuChoi Date: Mon Oct 14 17:44:57 2019 +0900 vg_common_json: Apply image's alpha color Summary: This patch needs latest rlottie that contain below commit. https://github.com/Samsung/rlottie/commit/c3ab82ec2c207cfba2df6eb51d80dd532c93a710 Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10368 --- src/static_libs/vg_common/vg_common_json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 5ad4150506..4e203a0077 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -49,6 +49,8 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l efl_canvas_vg_image_data_set(image, node->mImageInfo.data, EINA_SIZE2D(node->mImageInfo.width, node->mImageInfo.height)); + efl_gfx_color_set(image, node->mImageInfo.mAlpha, node->mImageInfo.mAlpha, node->mImageInfo.mAlpha, node->mImageInfo.mAlpha); + continue; } --
[EGIT] [core/efl] master 01/01: evas_vg_cache: Hashkey of cache use value provider list
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6b2504ba56467fa3409cbfc56214ef3c8b38bd76 commit 6b2504ba56467fa3409cbfc56214ef3c8b38bd76 Author: JunsuChoi Date: Tue Oct 8 18:13:43 2019 +0900 evas_vg_cache: Hashkey of cache use value provider list Summary: Even if the same window, the same file, and the same size, different images may be requested due to property changes caused by value_provider. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10303 --- src/lib/evas/canvas/efl_canvas_vg_object.c | 6 +++--- src/lib/evas/canvas/evas_vg_private.h | 3 ++- src/lib/evas/vg/evas_vg_cache.c| 20 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 660d1ebe1a..800dbefe6d 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -290,7 +290,7 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd) pd->vg_entry = evas_cache_vg_entry_create(evas_object_evas_get(eo_obj), file, key, obj->cur->geometry.w, - obj->cur->geometry.h); + obj->cur->geometry.h, NULL); evas_object_change(eo_obj, obj); return 0; @@ -569,6 +569,8 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, Eina_Bool drop_cache = EINA_FALSE; void *buffer = NULL; + evas_cache_vg_entry_value_provider_update(pd->vg_entry, efl_key_data_get(obj->object, "_vg_value_providers")); + // if the size changed in between path set and the draw call; if ((vg_entry->w != w) || (vg_entry->h != h)) @@ -616,8 +618,6 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, h = size.h; } - if (pd->vg_entry->vfd) - pd->vg_entry->vfd->vp_list = efl_key_data_get(obj->object, "_vg_value_providers"); root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx); if (!root) return; diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index 9ec89633c2..bbac468723 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -143,8 +143,9 @@ Efl_Gfx_Vg_Value_Provider_Change_Flag efl_gfx_vg_value_provider_changed_flag_get voidevas_cache_vg_init(void); voidevas_cache_vg_shutdown(void); Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); -Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h); +Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h, Eina_List *vp_list); Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num); +void evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list); voidevas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key); Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info); diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index f6a1c1cab2..391d3cb2a9 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -365,14 +365,14 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key) Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h) { - return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h); + return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h, vg_entry->vfd->vp_list); } Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, - int w, int h) + int w, int h, Eina_List *vp_list) { Vg_Cache_Entry* vg_entry; Eina_Strbuf *hash_key; @@ -380,9 +380,9 @@ evas_cache_vg_entry_create(Evas *evas, if (!vg_cache) return NULL; //TODO: zero-sized entry is useless. how to skip it? - + // hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d", evas, file, key, w, h); + eina_strbuf_
[EGIT] [core/efl] master 01/01: efl_ui_animation_view : Put @beta on Efl.Ui.Animation_View_State
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=94733b4926c4032fe6f6b411e07526e11a46fd1e commit 94733b4926c4032fe6f6b411e07526e11a46fd1e Author: JunsuChoi Date: Fri Oct 4 10:05:45 2019 +0900 efl_ui_animation_view : Put @beta on Efl.Ui.Animation_View_State Summary: Efl.Ui.Animation_View class still in beta state. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10268 --- src/lib/elementary/efl_ui_animation_view.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo index d07905989e..2d090bbee7 100644 --- a/src/lib/elementary/efl_ui_animation_view.eo +++ b/src/lib/elementary/efl_ui_animation_view.eo @@ -1,5 +1,5 @@ -enum Efl.Ui.Animation_View_State +enum @beta Efl.Ui.Animation_View_State { [[State of animation view]] not_ready, [[Animation is not ready to play. (Probably, it didn't file set yet or failed to read file.]] --
[EGIT] [core/efl] master 01/01: elementary_test: Add the value provider test for animation_view
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f51e30976ebe68cf5480598a0d8302d82e1961e commit 3f51e30976ebe68cf5480598a0d8302d82e1961e Author: JunsuChoi Date: Wed Oct 2 14:32:33 2019 +0900 elementary_test: Add the value provider test for animation_view Summary: Add an Value Provider item to test vector animation on elementary_test. This test is to apply Efl.Gfx.Vg.Value_Provider to the loaded efl_ui_animation object. If Evas Vg Json(Lottie) Loader is not supported, use the vector class to output the svg file. Depends on D9874 Depends on D9897 Test Plan: elementary_test -> Value Provider Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10015 --- data/elementary/images/three_box.json | 1 + src/bin/elementary/meson.build | 1 + src/bin/elementary/test.c | 2 + .../elementary/test_efl_gfx_vg_value_provider.c| 605 + 4 files changed, 609 insertions(+) diff --git a/data/elementary/images/three_box.json b/data/elementary/images/three_box.json new file mode 100644 index 00..f58fbcdec8 --- /dev/null +++ b/data/elementary/images/three_box.json @@ -0,0 +1 @@ +{"v":"5.5.9","fr":29.9700012207031,"ip":0,"op":130.05295009,"w":1920,"h":1080,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"layer","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[960,540,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[300,300],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path [...] \ No newline at end of file diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index debce1ded8..502573c49e 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -161,6 +161,7 @@ elementary_test_src = [ 'test_ui_items.c', 'test_ui_frame.c', 'test_efl_ui_animation_view.c', + 'test_efl_gfx_vg_value_provider.c', 'test.h' ] diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 8d5e997140..8259ed8b0c 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -406,6 +406,7 @@ void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info); void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); void test_efl_ui_animation_view(void *data, Evas_Object *obj, void *event_info); +void test_efl_gfx_vg_value_provider(void *data, Evas_Object *obj, void *event_info); static void _list_udpate(void); @@ -1301,6 +1302,7 @@ add_tests: //--// ADD_TEST_EO(NULL, "Vector Animation", "Animation View", test_efl_ui_animation_view); + ADD_TEST_EO(NULL, "Vector Animation", "Value Provider", test_efl_gfx_vg_value_provider); #undef ADD_TEST diff --git a/src/bin/elementary/test_efl_gfx_vg_value_provider.c b/src/bin/elementary/test_efl_gfx_vg_value_provider.c new file mode 100644 index 00..7f5add084c --- /dev/null +++ b/src/bin/elementary/test_efl_gfx_vg_value_provider.c @@ -0,0 +1,605 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include +#include +#include "elm_priv.h" + +#ifndef EFL_BETA_API_SUPPORT +#define EFL_BETA_API_SUPPORT +#endif + +#ifndef EFL_EO_API_SUPPORT +#define EFL_EO_API_SUPPORT +#endif + +#ifdef BUILD_VG_LOADER_JSON + +Evas_Object *values[4], *anim_view; +Evas_Object *path_entry, *type_hoversel; + +Eina_Bool +add_value_provider(char* new_path, char* new_type, char* new_values) +{ + const char* type = elm_object_text_get(type_hoversel); + if (!type) return EINA_FALSE; + const char* path = efl_text_get(path_entry); + if (!path) return EINA_FALSE; + + if (strstr(type, "Color") != NULL) + { +int color[4]; +Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, anim_view); +efl_gfx_vg_value_provider_keypath_set(vp, (char*)path); +for (int i = 0; i
[EGIT] [core/efl] master 01/01: vg_common_json: Override value_provider list
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=779bd0539eb6ab8050289da83d0792670a15422c commit 779bd0539eb6ab8050289da83d0792670a15422c Author: JunsuChoi Date: Wed Oct 2 14:30:06 2019 +0900 vg_common_json: Override value_provider list Summary: If value_provider is applied to Efl.Ui.Animation_View, it is passed as vector object. The passed value_provider list passes to Vg_File_Data. If there is a value_Provider list in Vg_File_Data, it apply the property to Lottie_Animation using lottie_animation_property_override api. Depends on D9874 Test Plan: ... Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p); efl_gfx_vg_value_provider_keypath_set(vp, "**"); efl_gfx_vg_value_provider_fill_color_set(vp, 100, 0 ,0 ,255); efl_ui_animation_view_value_provider_override(anim_view, vp); vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p); efl_gfx_vg_value_provider_keypath_set(vp, "**"); efl_gfx_vg_value_provider_stroke_width_set(vp, 50.0); efl_gfx_vg_value_provider_stroke_color_set(vp, 0, 255, 0, 100); efl_ui_animation_view_value_provider_override(anim_view, vp); ... Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9897 --- src/lib/elementary/efl_ui_animation_view.c | 1 + src/lib/evas/canvas/efl_canvas_vg_object.c | 2 ++ src/lib/evas/include/evas_private.h| 1 + src/static_libs/vg_common/vg_common.h | 1 + src/static_libs/vg_common/vg_common_json.c | 55 ++ 5 files changed, 60 insertions(+) diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c index bca8c1d4a4..82aba0f3c4 100644 --- a/src/lib/elementary/efl_ui_animation_view.c +++ b/src/lib/elementary/efl_ui_animation_view.c @@ -741,6 +741,7 @@ _efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Anima efl_ref(value_provider); pd->vp_list = eina_list_append(pd->vp_list, value_provider); + efl_key_data_set(pd->vg, "_vg_value_providers", pd->vp_list); } EAPI Elm_Animation_View* diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 0c8e50bed3..660d1ebe1a 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -616,6 +616,8 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, h = size.h; } + if (pd->vg_entry->vfd) + pd->vg_entry->vfd->vp_list = efl_key_data_get(obj->object, "_vg_value_providers"); root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx); if (!root) return; diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index c80053c7f9..86bb885ce3 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1541,6 +1541,7 @@ struct _Vg_File_Data Vg_File_Anim_Data *anim_data; //only when animation supported. int ref; int w, h; //default size + Eina_List *vp_list; //Value providers. void *loader_data;//loader specific local data diff --git a/src/static_libs/vg_common/vg_common.h b/src/static_libs/vg_common/vg_common.h index 520fcdbfd6..83f9224e45 100644 --- a/src/static_libs/vg_common/vg_common.h +++ b/src/static_libs/vg_common/vg_common.h @@ -7,6 +7,7 @@ #include "evas_common_private.h" #include "evas_private.h" +#include "evas_vg_private.h" /** * SVG Compatible feature implementation diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 3b3d114503..5ad4150506 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -443,6 +443,59 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de } #endif +#ifdef BUILD_VG_LOADER_JSON +void +_value_provider_override(Vg_File_Data *vfd) +{ + Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data; + + Eina_List *l; + Efl_Gfx_Vg_Value_Provider *vp; + EINA_LIST_FOREACH(vfd->vp_list, l, vp) + { +const char *keypath; +Efl_Gfx_Vg_Value_Provider_Change_Flag flag; +flag = efl_gfx_vg_value_provider_changed_flag_get(vp); + +if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_FILL_COLOR) + { + int r, g, b, a; + r = g = b = a = 0; + efl_gfx_vg_value_provider_fill_color_get(vp, , , , ); + keypath = efl_gfx_vg_value_provider_keypath_
[EGIT] [core/efl] master 01/01: Efl.Gfx.Vg.Value_Provider: Introduce property change feature of Efl.Ui.Animation_View
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6deb21f9f9e326921c16dabbd774b8d1666867c8 commit 6deb21f9f9e326921c16dabbd774b8d1666867c8 Author: JunsuChoi Date: Wed Oct 2 13:21:35 2019 +0900 Efl.Gfx.Vg.Value_Provider: Introduce property change feature of Efl.Ui.Animation_View Summary: Efl.Gfx.Vg.Value_Provider is an object for integrating and managing the properties of vector objects. These values are dependent on the keypath. Keypath is the target a specific content or a set of contents that will be updated. It can include the specific name of the contents, wildcard(*) or Globstar(**). The valueProvider is borrowed from another library that uses a vector object of type json, such as Efl.Ui.Animation_View (https://github.com/airbnb/lottie-ios/blob/5fc0e59e0cb85d3586b1d0d1cf4a2c9669b91d15/lottie-swift/src/Public/iOS/AnimatedControl.swift#L50) This feature should be used with some patches that apply to the vg json loader and Efl.Canvas.Vg.Object. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9874 --- src/lib/elementary/efl_ui_animation_view.c | 36 ++ src/lib/elementary/efl_ui_animation_view.eo| 14 +++ src/lib/elementary/efl_ui_animation_view_private.h | 1 + src/lib/evas/Efl_Canvas.h | 1 + src/lib/evas/Evas_Eo.h | 1 + src/lib/evas/canvas/efl_gfx_vg_value_provider.c| 129 + src/lib/evas/canvas/efl_gfx_vg_value_provider.eo | 72 src/lib/evas/canvas/efl_gfx_vg_value_provider.h| 33 ++ src/lib/evas/canvas/evas_vg_private.h | 11 ++ src/lib/evas/canvas/meson.build| 2 + 10 files changed, 300 insertions(+) diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c index 418d8adc42..bca8c1d4a4 100644 --- a/src/lib/elementary/efl_ui_animation_view.c +++ b/src/lib/elementary/efl_ui_animation_view.c @@ -236,6 +236,11 @@ EOLIAN static void _efl_ui_animation_view_efl_object_destructor(Eo *obj, Efl_Ui_Animation_View_Data *pd EINA_UNUSED) { + Efl_Gfx_Vg_Value_Provider *vp; + EINA_LIST_FREE(pd->vp_list, vp) + efl_unref(vp); + eina_list_free(pd->vp_list); + efl_destructor(efl_super(obj, MY_CLASS)); } @@ -707,6 +712,37 @@ _efl_ui_animation_view_max_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation return pd->max_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1); } +EOLIAN static void +_efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, Efl_Gfx_Vg_Value_Provider *value_provider) +{ + if (!value_provider) return; + + if (pd->vp_list) + { +const char *keypath1 = efl_gfx_vg_value_provider_keypath_get(value_provider); +if (!keypath1) + { + ERR("Couldn't override Value Provider(%p). Keypath is NULL.", value_provider); + return; + } +const Eina_List *l; +Efl_Gfx_Vg_Value_Provider *_vp; +EINA_LIST_FOREACH(pd->vp_list, l, _vp) + { + const char *keypath2 = efl_gfx_vg_value_provider_keypath_get(_vp); + if (!strcmp(keypath1, keypath2)) + { + pd->vp_list = eina_list_remove(pd->vp_list, _vp); + efl_unref(_vp); + break; + } + } + } + + efl_ref(value_provider); + pd->vp_list = eina_list_append(pd->vp_list, value_provider); +} + EAPI Elm_Animation_View* elm_animation_view_add(Evas_Object *parent) { diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo index 474bd76a9f..d07905989e 100644 --- a/src/lib/elementary/efl_ui_animation_view.eo +++ b/src/lib/elementary/efl_ui_animation_view.eo @@ -256,7 +256,21 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, ]] } } + value_provider_override{ + [[Override each value of the animation object. + Values can be properties of Efl.Gfx.Vg.Value_provider such as color and matrix information. + Example: + Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, NULL); + @Efl.Gfx.Vg.Value_Provider.keypath.set(vp, "SomeLayer:SomeObject:SomeContents"); + // Set vp property + @.value_provider_override(target_animation_view, vg); + See @Efl.Gfx.Vg.Value_Provider + ]] + params { +value_provider: Efl.Gfx.Vg.Value_Provider; [[ Override the values of the animatio
[EGIT] [core/efl] master 01/01: efl_gfx_path: Add optimized path command
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=06d328ffd114c791491fbe3fbc22bcbffd02560c commit 06d328ffd114c791491fbe3fbc22bcbffd02560c Author: JunsuChoi Date: Tue Sep 24 11:52:30 2019 +0900 efl_gfx_path: Add optimized path command Summary: If 'L' is removed due to optimization, it should be supported like 3b1f7be If the previous command is 'M', use 'L'. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10104 --- src/lib/efl/interfaces/efl_gfx_path.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c index 447b234c72..85be89ce71 100644 --- a/src/lib/efl/interfaces/efl_gfx_path.c +++ b/src/lib/efl/interfaces/efl_gfx_path.c @@ -1380,9 +1380,9 @@ _next_command(char *path, char *cmd, double *arr, int *count) else { if (*cmd == 'm') - { - *cmd = 'l'; - } + *cmd = 'l'; +else if (*cmd == 'M') + *cmd = 'L'; } if ( *count == 7) { --
[EGIT] [core/efl] master 01/01: efl_gfx_path: Support 'l' command for optimized path.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3b1f7bea75dc5e9753ace4e886174b4afdb0515a commit 3b1f7bea75dc5e9753ace4e886174b4afdb0515a Author: JunsuChoi Date: Tue Sep 24 10:20:43 2019 +0900 efl_gfx_path: Support 'l' command for optimized path. Summary: If there is no 'l' command for path optimization, refer to the previous cmd. If the previous command is 'm', use 'l'. Test Plan: [Example SVG] ''' http://www.w3.org/2000/svg; version="1.1" viewBox="0 0 40 40"> ''' Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10074 --- src/lib/efl/interfaces/efl_gfx_path.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c index 38f22ecb9f..447b234c72 100644 --- a/src/lib/efl/interfaces/efl_gfx_path.c +++ b/src/lib/efl/interfaces/efl_gfx_path.c @@ -1377,6 +1377,13 @@ _next_command(char *path, char *cmd, double *arr, int *count) path++; *count = _number_count(*cmd); } + else + { +if (*cmd == 'm') + { + *cmd = 'l'; + } + } if ( *count == 7) { // special case for arc command --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Change strtod to eina_convert_strtod_c for locale issue
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3932c6838292472b14f6dcfd90e74c59554c9524 commit 3932c6838292472b14f6dcfd90e74c59554c9524 Author: JunsuChoi Date: Tue Sep 17 21:18:47 2019 +0900 evas_vg_load_svg: Change strtod to eina_convert_strtod_c for locale issue Summary: Crash depending on LOCALE when using strtod. So change to eina_convert_strtod_c which is made to prevent strtod problem. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9988 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index c277ee9d26..97f87c7e96 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -84,7 +84,7 @@ _parse_number(const char **content, double *number) { char *end = NULL; - *number = strtod(*content, ); + *number = eina_convert_strtod_c(*content, ); // if the start of string is not number if ((*content) == end) return EINA_FALSE; //skip comma if any @@ -102,7 +102,7 @@ _parse_number(const char **content, double *number) static inline double _to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Length_Type type) { - double parsed_value = strtod(str, NULL); + double parsed_value = eina_convert_strtod_c(str, NULL); if (strstr(str, "cm")) parsed_value = parsed_value * 35.43307; @@ -141,7 +141,7 @@ _gradient_to_double(Evas_SVG_Parser *svg_parse, const char *str, SVG_Parser_Leng { char *end = NULL; - double parsed_value = strtod(str, ); + double parsed_value = eina_convert_strtod_c(str, ); double max = 1; /** @@ -182,7 +182,7 @@ _to_offset(const char *str) { char *end = NULL; - double parsed_value = strtod(str, ); + double parsed_value = eina_convert_strtod_c(str, ); if (strstr(str, "%")) parsed_value = parsed_value / 100.0; @@ -195,7 +195,7 @@ _to_opacity(const char *str) { char *end = NULL; int a = 0; - double opacity = strtod(str, ); + double opacity = eina_convert_strtod_c(str, ); if (*end == '\0') a = lrint(opacity * 255); @@ -277,7 +277,7 @@ _parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length) { // skip white space, comma str = _skipcomma(str); -tmp[count++] = strtod(str, ); +tmp[count++] = eina_convert_strtod_c(str, ); str = _skipcomma(end); } @@ -337,7 +337,7 @@ _color_parser(const char *value, char **end) { double r; - r = strtod(value + 4, end); + r = eina_convert_strtod_c(value + 4, end); *end = _skip_space(*end, NULL); if (**end == '%') r = 255 * r / 100; @@ -590,7 +590,7 @@ parse_numbers_array(char *str, double *points, int *pt_count) *str == '+' || *str == '.') { -points[count++] = strtod(str, ); +points[count++] = eina_convert_strtod_c(str, ); str = end; str = _skip_space(str, NULL); if (*str == ',') @@ -758,7 +758,7 @@ parse_length(const char *str, Svg_Length_Type *type) { *type = length_tags[i].type; } - value = strtod(str, NULL); + value = eina_convert_strtod_c(str, NULL); return value; } --
[EGIT] [core/efl] master 01/01: ector_software_rasterizer: Change default value of stroke linejoin
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ca8df7067c06034a0e950ef8385785fc5e87dd96 commit ca8df7067c06034a0e950ef8385785fc5e87dd96 Author: JunsuChoi Date: Thu Aug 22 12:38:57 2019 +0900 ector_software_rasterizer: Change default value of stroke linejoin Summary: SW_FT_STROKER_LINEJOIN_MITER is same SW_FT_STROKER_LINEJOIN_MITER_VARIABLE We pass miterlimit values in fixed-point type. Therefore, change the default value to SW_FT_STROKER_LINEJOIN_MITER_FIXED. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9656 --- src/lib/ector/software/ector_software_rasterizer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index 2b995c9e81..e9efb3fe4f 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -663,7 +663,7 @@ void ector_software_thread_init(Ector_Software_Thread *thread) SW_FT_Stroker_New(>stroker); SW_FT_Stroker_Set(thread->stroker, 1 << 6, - SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0x4<<16); + SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER_FIXED, 0x4<<16); } void ector_software_rasterizer_init(Software_Rasterizer *rasterizer) @@ -728,7 +728,7 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, join = SW_FT_STROKER_LINEJOIN_ROUND; break; default: - join = SW_FT_STROKER_LINEJOIN_MITER; + join = SW_FT_STROKER_LINEJOIN_MITER_FIXED; break; } SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, miter_limit); --
[EGIT] [core/efl] master 01/01: efl_gfx_shape: Add stroke_miterlimit property
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fa8f20338d462822c76b4da1969f8a80f04f commit fa8f20338d462822c76b4da1969f8a80f04f Author: JunsuChoi Date: Thu Aug 22 12:45:09 2019 +0900 efl_gfx_shape: Add stroke_miterlimit property Summary: Sets limit on ratio of miter value of the stroke join. If a miter join exists, it must be supported. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9657 --- src/lib/efl/interfaces/efl_gfx_shape.c | 16 src/lib/efl/interfaces/efl_gfx_shape.eo | 12 src/lib/efl/interfaces/efl_gfx_types.eot | 1 + 3 files changed, 29 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c index fa3b718e1b..7d7e177732 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.c +++ b/src/lib/efl/interfaces/efl_gfx_shape.c @@ -293,6 +293,7 @@ _efl_gfx_shape_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Shape_Data *pd, pd->public.stroke.color.g = from->public.stroke.color.g; pd->public.stroke.color.b = from->public.stroke.color.b; pd->public.stroke.color.a = from->public.stroke.color.a; + pd->public.stroke.miterlimit = from->public.stroke.miterlimit; pd->fill_rule = from->fill_rule; _efl_gfx_shape_stroke_dash_set(obj, pd, from->public.stroke.dash, @@ -301,4 +302,19 @@ _efl_gfx_shape_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Shape_Data *pd, efl_gfx_path_copy_from(efl_super(obj, MY_CLASS), dup_from); } +EOLIAN static void +_efl_gfx_shape_stroke_miterlimit_set(Eo *obj EINA_UNUSED, + Efl_Gfx_Shape_Data *pd, + double miterlimit) +{ + pd->public.stroke.miterlimit = miterlimit; +} + +EOLIAN static double +_efl_gfx_shape_stroke_miterlimit_get(const Eo *obj EINA_UNUSED, + Efl_Gfx_Shape_Data *pd) +{ + return pd->public.stroke.miterlimit; +} + #include "interfaces/efl_gfx_shape.eo.c" diff --git a/src/lib/efl/interfaces/efl_gfx_shape.eo b/src/lib/efl/interfaces/efl_gfx_shape.eo index 321d4057bf..89750771da 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.eo +++ b/src/lib/efl/interfaces/efl_gfx_shape.eo @@ -97,6 +97,18 @@ mixin @beta Efl.Gfx.Shape extends Efl.Gfx.Path j: Efl.Gfx.Join; [[Join style to use, default is @Efl.Gfx.Join.miter]] } } + @property stroke_miterlimit { + [[The stroke_miterlimit is a presentation defining a limit on the ratio of + the miter length to the stroke-width used to draw a miter join. + ]] + set { + } + get { + } + values { +miterlimit: double; [[Limit value on the ratio of the miter.]] + } + } @property fill_rule { [[The fill rule of the given shape object. @Efl.Gfx.Fill_Rule.winding or @Efl.Gfx.Fill_Rule.odd_even. diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 64bde5a6c7..0f2954b954 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -132,6 +132,7 @@ struct @beta Efl.Gfx.Stroke dash_length: uint; [[Stroke dash length]] cap: Efl.Gfx.Cap; [[Stroke cap]] join: Efl.Gfx.Join; [[Stroke join]] + miterlimit: double; [[Stroke miterlimit]] } struct @beta Efl.Gfx.Shape_Public --
[EGIT] [core/efl] master 01/01: freetype: Prevent lose of data when fixed point divide calculation.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9e3aabe43b96fd405f987ffc257539d60b52fa39 commit 9e3aabe43b96fd405f987ffc257539d60b52fa39 Author: JunsuChoi Date: Wed Sep 4 12:07:08 2019 +0900 freetype: Prevent lose of data when fixed point divide calculation. Summary: In environments that long is 4byte, fixed-point division calculations will cause data loss. fixed-point division need to more space. Therefore, change all long types to long long types. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9817 --- src/static_libs/freetype/sw_ft_math.c | 37 +- src/static_libs/freetype/sw_ft_math.h | 20 +- src/static_libs/freetype/sw_ft_types.h | 2 +- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/static_libs/freetype/sw_ft_math.c b/src/static_libs/freetype/sw_ft_math.c index 268c875c28..a5b147f35c 100644 --- a/src/static_libs/freetype/sw_ft_math.c +++ b/src/static_libs/freetype/sw_ft_math.c @@ -41,54 +41,53 @@ SW_FT_END_STMNT -SW_FT_Long -SW_FT_MulFix( SW_FT_Long a, - SW_FT_Long b ) +SW_FT_Int64 +SW_FT_MulFix( SW_FT_Int64 a, + SW_FT_Int64 b ) { SW_FT_Int s = 1; - SW_FT_Long c; + SW_FT_Int64 c; SW_FT_MOVE_SIGN( a, s ); SW_FT_MOVE_SIGN( b, s ); - c = (SW_FT_Long)( ( (SW_FT_Int64)a * b + 0x8000L ) >> 16 ); + c = ( a * b + 0x8000L ) >> 16; return ( s > 0 ) ? c : -c; } -SW_FT_Long -SW_FT_MulDiv( SW_FT_Long a, - SW_FT_Long b, - SW_FT_Long c ) +SW_FT_Int64 +SW_FT_MulDiv( SW_FT_Int64 a, + SW_FT_Int64 b, + SW_FT_Int64 c ) { SW_FT_Int s = 1; - SW_FT_Long d; + SW_FT_Int64 d; SW_FT_MOVE_SIGN( a, s ); SW_FT_MOVE_SIGN( b, s ); SW_FT_MOVE_SIGN( c, s ); - d = (SW_FT_Long)( c > 0 ? ( (SW_FT_Int64)a * b + ( c >> 1 ) ) / c - : 0x7FFFL ); + d = c > 0 ? ( a * b + ( c >> 1 ) ) / c + : 0x7FFFL; return ( s > 0 ) ? d : -d; } -SW_FT_Long -SW_FT_DivFix( SW_FT_Long a, - SW_FT_Long b ) +SW_FT_Int64 +SW_FT_DivFix( SW_FT_Int64 a, + SW_FT_Int64 b ) { SW_FT_Int s = 1; - SW_FT_Long q; - + SW_FT_Int64 q; SW_FT_MOVE_SIGN( a, s ); SW_FT_MOVE_SIGN( b, s ); - q = (SW_FT_Long)( b > 0 ? ( ( (SW_FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b - : 0x7FFFL ); + q = b > 0 ? ( ( a << 16 ) + ( b >> 1 ) ) / b + : 0x7FFFL; return ( s < 0 ? -q : q ); } diff --git a/src/static_libs/freetype/sw_ft_math.h b/src/static_libs/freetype/sw_ft_math.h index 95a5c4257e..de607efc1c 100644 --- a/src/static_libs/freetype/sw_ft_math.h +++ b/src/static_libs/freetype/sw_ft_math.h @@ -71,9 +71,9 @@ /*_second_ argument of this function; this can make a great */ /*difference.*/ /* */ -SW_FT_Long -SW_FT_MulFix( SW_FT_Long a, - SW_FT_Long b ); +SW_FT_Int64 +SW_FT_MulFix( SW_FT_Int64 a, + SW_FT_Int64 b ); /*/ /* */ @@ -98,10 +98,10 @@ SW_FT_MulFix( SW_FT_Long a, /*divide by zero; it simply returns `MaxInt' or `MinInt' depending */ /*on the signs of `a' and `b'. */ /* */ -SW_FT_Long -SW_FT_MulDiv( SW_FT_Long a, - SW_FT_Long b, - SW_FT_Long c ); +SW_FT_Int64 +SW_FT_MulDiv( SW_FT_Int64 a, + SW_FT_Int64 b, + SW_FT_Int64 c ); /*/ /* */ @@ -120,9 +120,9 @@ SW_FT_MulDiv( SW_FT_Long a, /* */ /*The result of `(a*0x1)/b'. */ /* */ -SW_FT_Long -SW_FT_DivFix( SW_FT_Long a, - SW_FT_Long b ); +SW_FT_Int64 +SW_FT_DivFix( SW_FT_Int64 a, + SW_FT_Int64 b ); diff --git a/src/static_libs/freetype/sw_ft_types.h b/src/static_libs/freetype/sw_ft_types.h index 828103aeab..f1e42d5f68 100644 --- a/src/static_libs/freetype/sw_ft_types.h +++ b/src/static_libs/freetype/sw_ft_types.h @@ -10,7 +10,7 @@ /*This type is used to store 16.16 fixe
[EGIT] [core/efl] master 01/01: eldbus_proxy: Prevent dangling pointer.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=65be14db240218494930da39da4bcfe916b77aa2 commit 65be14db240218494930da39da4bcfe916b77aa2 Author: JunsuChoi Date: Fri Sep 6 11:25:22 2019 +0900 eldbus_proxy: Prevent dangling pointer. --- src/lib/eldbus/eldbus_proxy.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eldbus/eldbus_proxy.c b/src/lib/eldbus/eldbus_proxy.c index a28fe9f0e4..955182f4c2 100644 --- a/src/lib/eldbus/eldbus_proxy.c +++ b/src/lib/eldbus/eldbus_proxy.c @@ -148,7 +148,10 @@ _eldbus_proxy_clear(Eldbus_Proxy *proxy) eldbus_cbs_free_dispatch(&(proxy->cbs_free), proxy); if (proxy->props) - eina_hash_free(proxy->props); + { +eina_hash_free(proxy->props); +proxy->props = NULL; + } proxy->refcount = 0; } --
[EGIT] [core/efl] master 01/01: efl_canvas_vg_shape/ector_software : Set and use stroke miterlimit
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=34dc52dbd2216f52a006e3855fbd3bca096cc0b6 commit 34dc52dbd2216f52a006e3855fbd3bca096cc0b6 Author: JunsuChoi Date: Thu Aug 22 13:00:01 2019 +0900 efl_canvas_vg_shape/ector_software : Set and use stroke miterlimit Summary: efl_canvas_vg_shape is set to miterlimit with Efl.Gfx.Shape.stroke_miterlimit and pass the value from rasterizer to freetype. NOTE: The default value is 4. It only refers to the standard of web svg. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit Depends D9657 Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Subscribers: cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9665 --- src/lib/ector/software/ector_renderer_software_shape.c | 3 ++- src/lib/ector/software/ector_software_private.h| 2 +- src/lib/ector/software/ector_software_rasterizer.c | 6 +++--- src/lib/evas/canvas/efl_canvas_vg_shape.c | 4 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c index b9cf1faaed..6210179b03 100644 --- a/src/lib/ector/software/ector_renderer_software_shape.c +++ b/src/lib/ector/software/ector_renderer_software_shape.c @@ -604,7 +604,8 @@ _update_rle(void *data, Ector_Software_Thread *thread) task->pd->public_shape->stroke.scale), task->pd->public_shape->stroke.cap, task->pd->public_shape->stroke.join, - task->pd->base->m); + task->pd->base->m, + task->pd->public_shape->stroke.miterlimit); if (task->pd->public_shape->stroke.dash) { diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h index 62d1c3f8fd..f7e47fed22 100644 --- a/src/lib/ector/software/ector_software_private.h +++ b/src/lib/ector/software/ector_software_private.h @@ -118,7 +118,7 @@ void ector_software_rasterizer_init(Software_Rasterizer *rasterizer); void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, Software_Rasterizer *rasterizer, double width, - Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m); + Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m, double miterlimit); void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Eina_Matrix3 *t); void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a); diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index e9efb3fe4f..d6242a04ee 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -685,15 +685,15 @@ void ector_software_thread_shutdown(Ector_Software_Thread *thread) void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, Software_Rasterizer *rasterizer EINA_UNUSED, double width, Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, - Eina_Matrix3 *m) + Eina_Matrix3 *m, double miterlimit) { SW_FT_Stroker_LineCap cap; SW_FT_Stroker_LineJoin join; int stroke_width; double scale_factor = 1.0; - //TODO: The interface to change the value of the miter_limit is not yet ready. - SW_FT_Fixed miter_limit = 0x4<<16; + // convert to freetype co-ordinate + SW_FT_Fixed miter_limit = miterlimit * (1<<16); if (m) { diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index c7a3c65863..fa22b6a3e7 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -132,6 +132,10 @@ _efl_canvas_vg_shape_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *p efl_gfx_shape_stroke_cap_set(obj, EFL_GFX_CAP_BUTT); efl_gfx_shape_stroke_join_set(obj, EFL_GFX_JOIN_MITER); + //NOTE: The default value is 4. It only refers to the standard of web svg. + // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit + efl_gfx_shape_stroke_miterlimit_set(obj, 4); + nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS); nd->render_pre = _efl_canvas_vg_shape_render_pre; nd->data = pd; --
[EGIT] [core/efl] master 01/01: evas_vg_json: Add image embedded example
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e97d3c08ea83b611c8b4fd06e1fe5fdd24a1dca9 commit e97d3c08ea83b611c8b4fd06e1fe5fdd24a1dca9 Author: JunsuChoi Date: Mon Jul 22 13:54:25 2019 +0900 evas_vg_json: Add image embedded example Summary: add example code and json resource. plus) Add ECTOR_BACKEND="default" Environment variable because cairo backend is not supported. Depends on D9218 Ector.Renderer : Implement Ector.Renderer.(Software).Image class D9219 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class D9220 vg_common_json : Support image data of node Test Plan: cd .src/examples/evas/ gcc -o evas_vg_json evas-vg-json.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` ./evas_vg_json Reviewers: Hermet, kimcinoo, smohanty Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9351 --- src/examples/evas/evas-vg-json.c | 17 ++--- src/examples/evas/resources/vg/image_embedded.json | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/examples/evas/evas-vg-json.c b/src/examples/evas/evas-vg-json.c index 42047292ea..d0176dbd72 100644 --- a/src/examples/evas/evas-vg-json.c +++ b/src/examples/evas/evas-vg-json.c @@ -30,9 +30,9 @@ #include "evas-common.h" #define WIDTH 400 -#define HEIGHT 400 +#define HEIGHT 600 -static Eo *gvg[4]; +static Eo *gvg[5]; static void running_cb(void *data EINA_UNUSED, const Efl_Event *event) @@ -41,7 +41,7 @@ running_cb(void *data EINA_UNUSED, const Efl_Event *event) double progress = event_running->progress; int i; - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { double frameCnt = (double) (efl_gfx_frame_controller_frame_count_get(gvg[i]) - 1); int frame = (int) (frameCnt * progress); @@ -58,6 +58,9 @@ _on_delete(Ecore_Evas *ee EINA_UNUSED) int main(void) { + //Cairo backend is not supported. + setenv("ECTOR_BACKEND", "default", 1); + if (!ecore_evas_init()) return EXIT_FAILURE; @@ -109,6 +112,14 @@ main(void) efl_gfx_entity_size_set(vg4, EINA_SIZE2D(200, 200)); efl_gfx_entity_visible_set(vg4, EINA_TRUE); + //5 + Eo* vg5 = gvg[4] = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, evas); + snprintf(buf, sizeof(buf), "%s/image_embedded.json", PACKAGE_EXAMPLES_DIR EVAS_VG_FOLDER); + efl_file_simple_load(vg5, buf, NULL); + efl_gfx_entity_position_set(vg5, EINA_POSITION2D(0, 400)); + efl_gfx_entity_size_set(vg5, EINA_SIZE2D(200, 200)); + efl_gfx_entity_visible_set(vg5, EINA_TRUE); + //Play custom animation Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas); efl_animation_duration_set(anim, efl_gfx_frame_controller_frame_duration_get(vg, 0, 0)); diff --git a/src/examples/evas/resources/vg/image_embedded.json b/src/examples/evas/resources/vg/image_embedded.json new file mode 100644 index 00..c3d48387f1 --- /dev/null +++ b/src/examples/evas/resources/vg/image_embedded.json @@ -0,0 +1 @@ +{"v":"5.4.3","fr":60,"ip":0,"op":60,"w":800,"h":800,"nm":"Comp 1","ddd":0,"assets":[{"id":"image_0","w":200,"h":300,"u":"","p":"data:image/png;base64,iVBORw0KGgoNSUhEUgAAAMgAAAEsCAYAAACG+vy+AAAgAElEQVR4Xly9C7Tla1Xd+e29zzlVdYsLl6cKAZLWaKsdjenWoR0HaKImrQ61Y8zQ1iHa7StttH00GMVHHAYBjSIxoh0RENELKEoUFUFIIgiIBLHTLYo61PYBmiCPW7fqPPajx5y/Ob//xpJrVZ06Z+/9/75vrTXXXHOtb/XtX/nDh/1YjcPqZBzGGPrz/jDGYTXGdr8f+7HWv+qr42ysx3rsx9DfV2v/vh+HcTiMsfLPHcb2cPDP7w76Pn1N3zHGejXGyt+n/9ZjvR5jtVqNlb4+eK3NajXWeu9xGG [...] \ No newline at end of file --
[EGIT] [core/efl] master 01/01: vg_common_svg: Apply node opacity to stroke color
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f440cdedc090fd71fbda4c10bf2f4af6bafec40 commit 8f440cdedc090fd71fbda4c10bf2f4af6bafec40 Author: JunsuChoi Date: Mon Aug 19 19:46:01 2019 +0900 vg_common_svg: Apply node opacity to stroke color Summary: When an object to be converted to a stroke or path uses "opacity" attribute, opacity is also applied. Test Plan: [SVG] http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink;> [Code] int main(int argc, char **argv) { setenv("ECTOR_BACKEND", "default", 1); elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add(NULL, "test"); evas_object_smart_callback_add(win, "delete,request", win_del, 0); elm_win_autodel_set(win, 1); Evas *evas = evas_object_evas_get(win); Evas_Object *vg = evas_object_vg_add(evas); evas_object_show(vg); Evas_Object *container = evas_vg_container_add(vg); evas_object_vg_root_node_set(vg, container); Evas_Object *svg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, container); efl_file_simple_load(svg, "./i_arrow_l_disable.svg", NULL); efl_gfx_entity_size_set(svg, EINA_SIZE2D(600, 600)); efl_gfx_entity_visible_set(svg, EINA_TRUE); evas_object_size_hint_weight_set(svg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(svg, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, vg); evas_object_resize(win, 600, 600); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9620 --- src/static_libs/vg_common/vg_common_svg.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index e3866e2018..5f8398d44b 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -784,6 +784,15 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ efl_gfx_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b, style->stroke.opacity); } + + //apply node opacity to stroke color + if (style->opacity < 255) + { +int r, g, b, a; +efl_gfx_shape_stroke_color_get(vg, , , , ); +float fa = ((float) style->opacity / 255); +efl_gfx_shape_stroke_color_set(vg, ((float) r) * fa, ((float) g) * fa, ((float) b) * fa, ((float) a) * fa); + } } static void --
[EGIT] [core/efl] master 01/01: vg_common_json : Support image data of node
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e9f8ef6ea44bdd5750613d88b848d3d1d788de69 commit e9f8ef6ea44bdd5750613d88b848d3d1d788de69 Author: JunsuChoi Date: Mon Jul 22 13:53:21 2019 +0900 vg_common_json : Support image data of node Summary: When node has image data, it creates Efl.Canvas.Vg.Image class and set transform information and data information. Depends on D9218 Ector.Renderer : Implement Ector.Renderer.(Software).Image class D9219 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9220 --- src/static_libs/vg_common/vg_common_json.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 94df54eb2f..6ecac9901f 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -42,6 +42,31 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l LOTNode *node = layer->mNodeList.ptr[i]; if (!node) continue; +//Image object +if (node->mImageInfo.data) + { + char *key = _get_key_val(node); + Efl_Canvas_Vg_Image *image = efl_key_data_get(parent, key); + if (!image) + { + image = efl_add(EFL_CANVAS_VG_IMAGE_CLASS, parent); + efl_key_data_set(parent, key, image); + } + efl_gfx_entity_visible_set(image, EINA_TRUE); + + Eina_Matrix3 m; + eina_matrix3_identity(); + eina_matrix3_values_set( , + node->mImageInfo.mMatrix.m11, node->mImageInfo.mMatrix.m12, node->mImageInfo.mMatrix.m13, + node->mImageInfo.mMatrix.m21, node->mImageInfo.mMatrix.m22, node->mImageInfo.mMatrix.m23, + node->mImageInfo.mMatrix.m31, node->mImageInfo.mMatrix.m32, node->mImageInfo.mMatrix.m33); + efl_canvas_vg_node_transformation_set(image, ); + + efl_canvas_vg_image_data_set(image, node->mImageInfo.data, node->mImageInfo.width, node->mImageInfo.height); + + continue; + } + //Skip Invisible Stroke? if (node->mStroke.enable && node->mStroke.width == 0) { @@ -64,7 +89,7 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l else efl_gfx_path_reset(shape); - efl_gfx_entity_visible_set(shape, EINA_TRUE); +efl_gfx_entity_visible_set(shape, EINA_TRUE); #if DEBUG for (int i = 0; i < depth; i++) printf(""); printf("%s (%p)\n", efl_class_name_get(efl_class_get(shape)), shape); --
[EGIT] [core/efl] master 01/01: elementary_test: Add the animation view test
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7a7d6a858d0dccba3d7d73779e39a999eaf543e9 commit 7a7d6a858d0dccba3d7d73779e39a999eaf543e9 Author: JunsuChoi Date: Wed Aug 21 17:53:14 2019 +0900 elementary_test: Add the animation view test Summary: Add an animation view item to test vector animation on elementary_test. If Evas Vg Json(Lottie) Loader is not supported, use the vector class to output the svg file. Depends {D9451} Test Plan: elementart_test Animation View Reviewers: Hermet, smohanty, kimcinoo, zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9472 --- data/elementary/images/emoji_wink.json | 1 + data/elementary/images/ubuntu.svg | 26 ++ src/bin/elementary/meson.build | 1 + src/bin/elementary/test.c | 6 + src/bin/elementary/test_efl_ui_animation_view.c | 328 5 files changed, 362 insertions(+) diff --git a/data/elementary/images/emoji_wink.json b/data/elementary/images/emoji_wink.json new file mode 100644 index 00..29b39a5369 --- /dev/null +++ b/data/elementary/images/emoji_wink.json @@ -0,0 +1 @@ +{"v":"4.5.7","fr":30,"ip":0,"op":60,"w":100,"h":100,"ddd":0,"assets":[{"id":"comp_38","layers":[{"ddd":0,"ind":0,"ty":4,"nm":"round_normal","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[50,50,0]},"a":{"a":0,"k":[-252,-412,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ks":{"a":0,"k":{"i":[[-17.673,0],[0,-17.673],[17.673,0],[0,17.673]],"o":[[17.673,0],[0,17.673],[-17.673,0],[0,-17.673]],"v":[[-252,-444],[-220,-412],[-252,-380],[-284, [...] \ No newline at end of file diff --git a/data/elementary/images/ubuntu.svg b/data/elementary/images/ubuntu.svg new file mode 100644 index 00..4d7b3ee586 --- /dev/null +++ b/data/elementary/images/ubuntu.svg @@ -0,0 +1,26 @@ +http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink; viewBox="-70 -70 140 140"> + + + + + + + + + + + + + + + + http://www.ubuntu.com/;> + + + + + + + + + diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index b490b57881..388623d5c0 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -159,6 +159,7 @@ elementary_test_src = [ 'test_ui_collection.c', 'test_ui_items.c', 'test_ui_frame.c', + 'test_efl_ui_animation_view.c', 'test.h' ] diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 186af020b8..27abd2656d 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -404,6 +404,8 @@ void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void *event_info) void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info); void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); +void test_efl_ui_animation_view(void *data, Evas_Object *obj, void *event_info); + static void _list_udpate(void); static Evas_Object *win, *tbx, *entry; // TODO: refactoring @@ -1294,6 +1296,10 @@ add_tests: //--// ADD_TEST_EO(NULL, "Widgets Part", "Part Background", test_part_background); ADD_TEST_EO(NULL, "Widgets Part", "Part Shadow", test_part_shadow); + + //--// + ADD_TEST_EO(NULL, "Vector Animation", "Animation View", test_efl_ui_animation_view); + #undef ADD_TEST if (autorun) diff --git a/src/bin/elementary/test_efl_ui_animation_view.c b/src/bin/elementary/test_efl_ui_animation_view.c new file mode 100644 index 00..8d06d6ac11 --- /dev/null +++ b/src/bin/elementary/test_efl_ui_animation_view.c @@ -0,0 +1,328 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif +#include +#include + +#ifndef EFL_BETA_API_SUPPORT +#define EFL_BETA_API_SUPPORT +#endif + +#ifndef EFL_EO_API_SUPPORT +#define EFL_EO_API_SUPPORT +#endif + +#ifdef BUILD_VG_LOADER_JSON + +static void +btn_clicked_cb(void *data , const Efl_Event *ev ) +{ + Evas_Object *anim_view = data; + const char *text = efl_text_get(ev->object); + + if (!text) return; + + if (!strcmp("Play", text)) + efl_u
[EGIT] [core/efl] master 01/01: vg_common_json: Support stroke miterlimit
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a569a4eb276720fb0dcd56c6b9fd27d1a9156619 commit a569a4eb276720fb0dcd56c6b9fd27d1a9156619 Author: JunsuChoi Date: Thu Aug 22 12:51:53 2019 +0900 vg_common_json: Support stroke miterlimit Summary: Apply miterlimit received from the node to vg_shape. Depends D9657 D9665 Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9666 --- src/static_libs/vg_common/vg_common_json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 47923c95aa..27fc86e7e6 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -149,6 +149,8 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l } efl_gfx_shape_stroke_join_set(shape, join); + efl_gfx_shape_stroke_miterlimit_set(shape, node->mStroke.miterLimit); + //Stroke Dash if (node->mStroke.dashArraySize > 0) { --
[EGIT] [core/efl] master 01/01: Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=56ebaea1fe33258e3b489d3a8782dfaa1b904835 commit 56ebaea1fe33258e3b489d3a8782dfaa1b904835 Author: JunsuChoi Date: Mon Jul 22 13:37:47 2019 +0900 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class Summary: Implements a vector class that can support image. User can use this class to output an image with a vector object. Depends on D9218:Ector.Renderer : Implement Ector.Renderer.(Software).Image class Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9219 --- src/lib/evas/Evas_Eo.h | 1 + src/lib/evas/canvas/efl_canvas_vg_image.c | 114 + src/lib/evas/canvas/efl_canvas_vg_image.eo | 20 + src/lib/evas/canvas/meson.build| 2 + 4 files changed, 137 insertions(+) diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index f3bcb6eb32..4122ac7f15 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -452,6 +452,7 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #include "canvas/efl_canvas_vg_node.eo.h" #include "canvas/efl_canvas_vg_container.eo.h" #include "canvas/efl_canvas_vg_shape.eo.h" +#include "canvas/efl_canvas_vg_image.eo.h" #include "canvas/efl_canvas_vg_gradient.eo.h" #include "canvas/efl_canvas_vg_gradient_linear.eo.h" #include "canvas/efl_canvas_vg_gradient_radial.eo.h" diff --git a/src/lib/evas/canvas/efl_canvas_vg_image.c b/src/lib/evas/canvas/efl_canvas_vg_image.c new file mode 100644 index 00..1a72c69624 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_vg_image.c @@ -0,0 +1,114 @@ +#include "evas_common_private.h" +#include "evas_private.h" + +#include "evas_vg_private.h" + +#define MY_CLASS EFL_CANVAS_VG_IMAGE_CLASS + +typedef struct _Efl_Canvas_Vg_Image_Data Efl_Canvas_Vg_Image_Data; +struct _Efl_Canvas_Vg_Image_Data +{ + Ector_Buffer *buffer; + void *image; + int w; + int h; +}; + +static void +_efl_canvas_vg_image_render_pre(Evas_Object_Protected_Data *vg_pd, +Efl_VG *obj EINA_UNUSED, +Efl_Canvas_Vg_Node_Data *nd, +void *engine EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, +Ector_Surface *surface, +Eina_Matrix3 *ptransform, +Ector_Buffer *mask, +int mask_op, +void *data) +{ + Efl_Canvas_Vg_Image_Data *pd = data; + + if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return; + + nd->flags = EFL_GFX_CHANGE_FLAG_NONE; + + EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd); + + if (!nd->renderer) + { +efl_domain_current_push(EFL_ID_DOMAIN_SHARED); +nd->renderer = ector_surface_renderer_factory_new(surface, ECTOR_RENDERER_IMAGE_MIXIN); +efl_domain_current_pop(); + } + + if (!pd->buffer && pd->image) + { +Evas_Object_Protected_Data *obj = vg_pd; +if (pd->buffer) efl_unref(pd->buffer); +pd->buffer = ENFN->ector_buffer_new(ENC, obj->layer->evas->evas, +pd->w, pd->h, +EFL_GFX_COLORSPACE_ARGB, +ECTOR_BUFFER_FLAG_DRAWABLE | +ECTOR_BUFFER_FLAG_CPU_READABLE | +ECTOR_BUFFER_FLAG_CPU_WRITABLE); +ector_buffer_pixels_set(pd->buffer, pd->image, +pd->w, pd->h, 0, +EFL_GFX_COLORSPACE_ARGB, EINA_TRUE); + } + ector_renderer_image_buffer_set(nd->renderer, pd->buffer); + ector_renderer_transformation_set(nd->renderer, ctransform); + + + + ector_renderer_origin_set(nd->renderer, nd->x, nd->y); + ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a); + ector_renderer_visibility_set(nd->renderer, nd->visibility); + + ector_renderer_mask_set(nd->renderer, mask, mask_op); + ector_renderer_prepare(nd->renderer); +} + +static Eo * +_efl_canvas_vg_image_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Image_Data *pd) +{ + Efl_Canvas_Vg_Node_Data *nd; + + obj = efl_constructor(efl_super(obj, MY_CLASS)); + + nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS); + nd->render_pre = _efl_canvas_vg_image_render_pre; + nd->data = pd; + + efl_gfx_color_set(obj , 255, 255, 255, 255); + + return o
[EGIT] [core/efl] master 01/01: evas_vg_cache: Hashkey in cache uses evas
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6d465b0b1ffec1cf0f87243143c5a1a5b441b496 commit 6d465b0b1ffec1cf0f87243143c5a1a5b441b496 Author: JunsuChoi Date: Tue Sep 10 20:06:18 2019 +0900 evas_vg_cache: Hashkey in cache uses evas Summary: Vg_entry is shared by different child windows. When two or more objects load the same file When resizing, cache_vg_entry_render can delete an active entry while creating a new entry and deleting an existing entry. Therefore, use cache data added evas Test Plan: [enable json loader] --- a/meson_options.txt +++ b/meson_options.txt @@ -203,7 +203,7 @@ option('evas-loaders-disabler', type : 'array', description : 'List of modular image/vector load . choices : ['gst', 'pdf', 'ps', 'raw', 'svg', 'rs . - value : ['webp', 'json'] + value : ['webp'] [Test] elementary_test -> Animation View click -> play -> Animation View click again -> ... Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9740 --- src/lib/evas/canvas/efl_canvas_vg_object.c | 3 ++- src/lib/evas/canvas/evas_vg_private.h | 3 ++- src/lib/evas/vg/evas_vg_cache.c| 8 +--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 1617bc1025..6fc21e1de7 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -289,7 +289,8 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd) Evas_Object_Protected_Data *obj; obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - pd->vg_entry = evas_cache_vg_entry_create(file, key, + pd->vg_entry = evas_cache_vg_entry_create(evas_object_evas_get(eo_obj), + file, key, obj->cur->geometry.w, obj->cur->geometry.h); evas_object_change(eo_obj, obj); diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index d8a07b24f1..c3752b003b 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -18,6 +18,7 @@ typedef struct _Vg_Cache typedef struct _Vg_Cache_Entry { + Evas *evas; char *hash_key; const Eina_File *file; Eina_Stringshare *key; @@ -124,7 +125,7 @@ struct _Efl_Canvas_Vg_Interpolation voidevas_cache_vg_init(void); voidevas_cache_vg_shutdown(void); Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); -Vg_Cache_Entry* evas_cache_vg_entry_create(const Eina_File *file, const char *key, int w, int h); +Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h); Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num); voidevas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key); diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index dd85349ee9..f6a1c1cab2 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -365,11 +365,12 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key) Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h) { - return evas_cache_vg_entry_create(vg_entry->file, vg_entry->key, w, h); + return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h); } Vg_Cache_Entry* -evas_cache_vg_entry_create(const Eina_File *file, +evas_cache_vg_entry_create(Evas *evas, + const Eina_File *file, const char *key, int w, int h) { @@ -381,7 +382,7 @@ evas_cache_vg_entry_create(const Eina_File *file, //TODO: zero-sized entry is useless. how to skip it? hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%p/%s/%d/%d", file, key, w, h); + eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d", evas, file, key, w, h); vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key)); if (!vg_entry) { @@ -396,6 +397,7 @@ evas_cache_vg_entry_create(const Eina_File *file, vg_entry->key = eina_stringshare_add(key); vg_entry->w = w; vg_entry->h = h; +vg_entry-
[EGIT] [core/efl] master 01/01: ector: Prevent access to NULL buffer in software rasterizer
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3210fa3d69a639f85c9252d6776fa86060324fbf commit 3210fa3d69a639f85c9252d6776fa86060324fbf Author: JunsuChoi Date: Fri Jul 26 13:12:48 2019 +0900 ector: Prevent access to NULL buffer in software rasterizer Summary: Prevents a crash caused by a null pointer exception when ector surface buffer is NULL. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9390 --- src/lib/ector/software/ector_software_rasterizer.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index a368774310..808f723b81 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -54,6 +54,7 @@ _blend_alpha(int count, const SW_FT_Span *spans, void *user_data) Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -97,6 +98,7 @@ _blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -140,6 +142,7 @@ _blend_mask_add(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -164,6 +167,7 @@ _blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -189,6 +193,7 @@ _blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -227,6 +232,7 @@ _blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -905,6 +911,7 @@ ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, int mask_op) { if (!rle) return; + if (!rasterizer->fill_data.raster_buffer->pixels.u32) return; rasterizer->fill_data.offx = x; rasterizer->fill_data.offy = y; --
[EGIT] [core/efl] master 01/02: edje_cc: Fix always true condition.
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=167e3c4c298dd2b16735805fba1f78c40a2962a1 commit 167e3c4c298dd2b16735805fba1f78c40a2962a1 Author: JunsuChoi Date: Thu Aug 22 07:15:30 2019 -0400 edje_cc: Fix always true condition. Summary: The condition at 742 line is always true. So I fix it. If action is not ACTION_STOP or ACTION_TYPE_SCRIPT, go to continue. Test Plan: N/A Reviewers: bu5hm4n, Hermet, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, kimcinoo, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9667 --- src/bin/edje/edje_cc_out.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index 2b5f700e3e..f932eac9e9 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -736,10 +736,10 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef) /* * we are accessing part with an id, - * if actions is ACTION_STOP or ACTION_TYPE_SCRIPT, then id is from the parts array. + * if actions is ACTION_STOP or ACTION_TYPE_SCRIPT, then id is NOT from the parts array. * In order to not crash here, we should continue here. */ -if (ep->action != EDJE_ACTION_TYPE_ACTION_STOP || ep->action != EDJE_ACTION_TYPE_SCRIPT) +if (ep->action == EDJE_ACTION_TYPE_ACTION_STOP || ep->action == EDJE_ACTION_TYPE_SCRIPT) continue; if (et->id >= (int) pc->parts_count) --
[EGIT] [core/efl] master 01/01: efl_canvas_vg_object/evas_object_vg: Change to legacy naming rule.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ce62dbc1c0635e1c2a1c98c38f6592bb76cb0a1b commit ce62dbc1c0635e1c2a1c98c38f6592bb76cb0a1b Author: JunsuChoi Date: Wed Aug 28 14:09:13 2019 +0900 efl_canvas_vg_object/evas_object_vg: Change to legacy naming rule. Summary: Enum and object decleared in efl_canvas_vg_object_eo.legacy.* use Efl_Canvas_Vg_* nameing rule. This skips the definition of type declared in Efl.Canvas.Vg.Object class. So change these to legacy names. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9718 --- src/lib/evas/canvas/efl_canvas_vg_object.c | 44 ++ .../evas/canvas/efl_canvas_vg_object_eo.legacy.c | 24 +++- .../evas/canvas/efl_canvas_vg_object_eo.legacy.h | 43 + 3 files changed, 68 insertions(+), 43 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 56f892023b..7caa003fce 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -1015,5 +1015,49 @@ evas_object_vg_file_set(Evas_Object *obj, const char *file, const char *key) return efl_file_simple_load(obj, file, key); } +static inline Efl_Canvas_Vg_Fill_Mode +_evas_object_vg_fill_mode_to_efl_ui_canvas_object_vg_fill_mode(Evas_Object_Vg_Fill_Mode mode) +{ + switch (mode) + { +#define CONVERT_MODE(MODE) case EVAS_OBJECT_VG_FILL_MODE_##MODE: return EFL_CANVAS_VG_FILL_MODE_##MODE + CONVERT_MODE(NONE); + CONVERT_MODE(STRETCH); + CONVERT_MODE(MEET); + CONVERT_MODE(SLICE); + default: break; + } +#undef CONVERT_MODE + return EFL_CANVAS_VG_FILL_MODE_NONE; +} + +static inline Evas_Object_Vg_Fill_Mode +_efl_ui_canvas_object_vg_fill_mode_to_evas_object_vg_fill_mode(Efl_Canvas_Vg_Fill_Mode mode) +{ + switch (mode) + { +#define CONVERT_MODE(MODE) case EFL_CANVAS_VG_FILL_MODE_##MODE: return EVAS_OBJECT_VG_FILL_MODE_##MODE + CONVERT_MODE(NONE); + CONVERT_MODE(STRETCH); + CONVERT_MODE(MEET); + CONVERT_MODE(SLICE); + default: break; + } +#undef CONVERT_MODE + return EVAS_OBJECT_VG_FILL_MODE_NONE; +} + +EAPI void +evas_object_vg_fill_mode_set(Efl_VG *obj, Evas_Object_Vg_Fill_Mode fill_mode) +{ + efl_canvas_vg_object_fill_mode_set(obj, _evas_object_vg_fill_mode_to_efl_ui_canvas_object_vg_fill_mode(fill_mode)); +} + +EAPI Evas_Object_Vg_Fill_Mode +evas_object_vg_fill_mode_get(const Efl_VG *obj) +{ + return _efl_ui_canvas_object_vg_fill_mode_to_evas_object_vg_fill_mode(efl_canvas_vg_object_fill_mode_get(obj)); +} + #include "efl_canvas_vg_object.eo.c" #include "efl_canvas_vg_object_eo.legacy.c" diff --git a/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c index 095fb3a2b9..936ae0b512 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object_eo.legacy.c @@ -1,48 +1,36 @@ EAPI void -evas_object_vg_fill_mode_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Fill_Mode fill_mode) -{ - efl_canvas_vg_object_fill_mode_set(obj, fill_mode); -} - -EAPI Efl_Canvas_Vg_Fill_Mode -evas_object_vg_fill_mode_get(const Efl_Canvas_Vg_Object *obj) -{ - return efl_canvas_vg_object_fill_mode_get(obj); -} - -EAPI void -evas_object_vg_viewbox_set(Efl_Canvas_Vg_Object *obj, Eina_Rect viewbox) +evas_object_vg_viewbox_set(Efl_VG *obj, Eina_Rect viewbox) { efl_canvas_vg_object_viewbox_set(obj, viewbox); } EAPI Eina_Rect -evas_object_vg_viewbox_get(const Efl_Canvas_Vg_Object *obj) +evas_object_vg_viewbox_get(const Efl_VG *obj) { return efl_canvas_vg_object_viewbox_get(obj); } EAPI void -evas_object_vg_viewbox_align_set(Efl_Canvas_Vg_Object *obj, double align_x, double align_y) +evas_object_vg_viewbox_align_set(Efl_VG *obj, double align_x, double align_y) { efl_canvas_vg_object_viewbox_align_set(obj, align_x, align_y); } EAPI void -evas_object_vg_viewbox_align_get(const Efl_Canvas_Vg_Object *obj, double *align_x, double *align_y) +evas_object_vg_viewbox_align_get(const Efl_VG *obj, double *align_x, double *align_y) { efl_canvas_vg_object_viewbox_align_get(obj, align_x, align_y); } EAPI void -evas_object_vg_root_node_set(Efl_Canvas_Vg_Object *obj, Efl_Canvas_Vg_Node *root) +evas_object_vg_root_node_set(Efl_VG *obj, Efl_Canvas_Vg_Node *root) { efl_canvas_vg_object_root_node_set(obj, root); } EAPI Efl_Canvas_Vg_Node * -evas_object_vg_root_node_get(const Efl_Canvas_Vg_Object *obj) +evas_object_vg_root_node_get(const Efl_VG *obj) { return efl_canvas_vg_object_root_node_get(obj); } diff --git a/src/lib/evas/canvas/efl_canvas_vg_object_eo
[EGIT] [core/efl] master 01/01: slider_cxx_example: Fix use wrong api
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8aae656b8003f3f3cf4dd0dbed9aae92eee521ef commit 8aae656b8003f3f3cf4dd0dbed9aae92eee521ef Author: JunsuChoi Date: Fri Aug 23 18:08:39 2019 +0900 slider_cxx_example: Fix use wrong api Summary: d50fdc0, e84ecd95 changes cause build errors. this is a patch to fix it. Test Plan: N/A Reviewers: zmike, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9721 --- src/examples/elementary/slider_cxx_example.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index 941ecc5b97..5521588b2a 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc @@ -30,7 +30,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Slider sl2(instantiate, win); efl::ui::Image ic(instantiate, win); ic.icon_set("folder"); - ic.scalable_set(false, false); + ic.can_upscale_set(false); + ic.can_downscale_set(false); // FIXME: C++ part API needs special reference handling! This will show ERR! efl::eo::downcast(sl2.part_get("elm.swallow.end")) .content_set(ic); --
[EGIT] [core/efl] master 01/01: ector_software_rasterizer: Add default value for stroke's miter_limit
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=949cf2750b0a8ee105aaedb891b6e17a439ac6f8 commit 949cf2750b0a8ee105aaedb891b6e17a439ac6f8 Author: JunsuChoi Date: Mon Aug 5 18:08:50 2019 +0900 ector_software_rasterizer: Add default value for stroke's miter_limit Summary: Currently the default value of miter_limit is defined as 0. miter_limit should be specified to a value other than 0. becuase it is affected by width. See below for an explanation of this. https://www.freetype.org/freetype2/docs/reference/ft2-glyph_stroker.html#ft_stroker_linejoin There is no particular reason why the default value is 0x4. It only refers to the standard of web svg. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit Test Plan: setenv("ECTOR_BACKEND", "default", 1); elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add(NULL, "test"); evas_object_smart_callback_add(win, "delete,request", win_del, 0); elm_win_autodel_set(win, 1); Evas_Object *bg = elm_bg_add(win); elm_bg_color_set(bg, 255,255,255); evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(bg); Evas *evas = evas_object_evas_get(win); Evas_Object *vg = evas_object_vg_add(evas); evas_object_show(vg); Evas_Object *container = evas_vg_container_add(vg); Evas_Object *shape = evas_vg_shape_add(container); //Default is EFL_GFX_JOIN_MITER evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0); evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255); evas_vg_shape_stroke_width_set(shape, 10); evas_vg_node_origin_set(shape, 50, 150); shape = evas_vg_shape_add(container); evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0); evas_vg_shape_stroke_join_set(shape, EFL_GFX_JOIN_BEVEL); evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255); evas_vg_shape_stroke_width_set(shape, 10); evas_vg_node_origin_set(shape, 200, 150); shape = evas_vg_shape_add(container); evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0); evas_vg_shape_stroke_join_set(shape, EFL_GFX_JOIN_ROUND); evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255); evas_vg_shape_stroke_width_set(shape, 10); evas_vg_node_origin_set(shape, 350, 150); evas_object_vg_root_node_set(vg, container); elm_object_content_set(bg, vg); elm_win_resize_object_add(win, bg); evas_object_resize(win, WIDTH, HEIGHT); evas_object_show(win); elm_run(); elm_shutdown(); Reviewers: smohanty, Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9492 --- src/lib/ector/software/ector_software_rasterizer.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index 808f723b81..fcf34384ad 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -664,7 +664,7 @@ void ector_software_thread_init(Ector_Software_Thread *thread) SW_FT_Stroker_New(>stroker); SW_FT_Stroker_Set(thread->stroker, 1 << 6, - SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0); + SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0x4<<16); } void ector_software_rasterizer_init(Software_Rasterizer *rasterizer) @@ -692,6 +692,10 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, SW_FT_Stroker_LineJoin join; int stroke_width; double scale_factor = 1.0; + + //TODO: The interface to change the value of the miter_limit is not yet ready. + SW_FT_Fixed miter_limit = 0x4<<16; + if (m) { // get the minimum scale factor from matrix @@ -728,7 +732,7 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, join = SW_FT_STROKER_LINEJOIN_MITER; break; } - SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, 0); + SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, miter_limit); } static void --
[EGIT] [core/efl] master 01/01: edje_edit: Prevent dangling pointer.
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=35f188239aef0c770551c532b04c724509a63170 commit 35f188239aef0c770551c532b04c724509a63170 Author: JunsuChoi Date: Fri Sep 6 11:08:59 2019 +0900 edje_edit: Prevent dangling pointer. --- src/lib/edje/edje_edit.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index eeb043ab33..ef58e91511 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -454,7 +454,11 @@ _edje_real_part_free(Edje *ed, Edje_Real_Part *rp) rp->custom = NULL; } - free(rp->drag); + if (rp->drag) + { +free(rp->drag); +rp->drag = NULL; + } if (rp->param2) free(rp->param2->set); eina_mempool_free(_edje_real_part_state_mp, rp->param2); --
[EGIT] [core/efl] master 01/01: vg_common_svg : Initialize "display" attribute
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=405822a314419b5da8f4d8b9dcda35bad4c2f677 commit 405822a314419b5da8f4d8b9dcda35bad4c2f677 Author: JunsuChoi Date: Wed Sep 4 12:08:56 2019 +0900 vg_common_svg : Initialize "display" attribute Summary: In e850e3e, the code to initialize this property is missing. That makes the object invisible when printing svg through edje. This is a patch to fix it. @fix Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9833 --- src/static_libs/vg_common/vg_common_svg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 4f96bec9aa..6cc66ae903 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -716,7 +716,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ // apply the transformation if (node->transform) efl_canvas_vg_node_transformation_set(vg, node->transform); - if (!node->display) efl_gfx_entity_visible_set(vg, EINA_FALSE); + if (node->type != SVG_NODE_DOC && !node->display) efl_gfx_entity_visible_set(vg, EINA_FALSE); if ((node->type == SVG_NODE_G) || (node->type == SVG_NODE_DOC)) return; @@ -1017,6 +1017,8 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg) node->id = eina_stringshare_add(id); } + node->display = efl_gfx_entity_visible_get(vg); + if (node->type == SVG_NODE_G) return; // apply the fill style property --
[EGIT] [core/efl] master 01/01: Ector.Renderer : Implement Ector.Renderer.(Software).Image class
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1ce14bc85d87ece9b2e50204f1834ec5a2d0f4a1 commit 1ce14bc85d87ece9b2e50204f1834ec5a2d0f4a1 Author: JunsuChoi Date: Mon Jul 22 13:29:02 2019 +0900 Ector.Renderer : Implement Ector.Renderer.(Software).Image class Summary: Implement a class and drawer that outputs image data from the Ector. Image data is output with a vector object and supports transform. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9218 --- src/lib/ector/ector_private.h | 6 + src/lib/ector/ector_renderer.h | 1 + src/lib/ector/ector_renderer_image.c | 22 +++ src/lib/ector/ector_renderer_image.eo | 16 ++ src/lib/ector/meson.build | 2 + src/lib/ector/software/Ector_Software.h| 1 + .../ector/software/ector_renderer_software_image.c | 194 + .../software/ector_renderer_software_image.eo | 13 ++ src/lib/ector/software/ector_software_surface.c| 2 + src/lib/ector/software/meson.build | 2 + 10 files changed, 259 insertions(+) diff --git a/src/lib/ector/ector_private.h b/src/lib/ector/ector_private.h index 8604768e16..8e128201e2 100644 --- a/src/lib/ector/ector_private.h +++ b/src/lib/ector/ector_private.h @@ -47,6 +47,7 @@ typedef struct _Ector_Renderer_Gradient_Data Ector_Renderer_Gradient_Data; typedef struct _Ector_Renderer_Gradient_Linear_Data Ector_Renderer_Gradient_Linear_Data; typedef struct _Ector_Renderer_Gradient_Radial_Data Ector_Renderer_Gradient_Radial_Data; typedef struct _Ector_Renderer_Shape_Data Ector_Renderer_Shape_Data; +typedef struct _Ector_Renderer_Image_Data Ector_Renderer_Image_Data; typedef struct _Ector_Renderer_Buffer_Data Ector_Renderer_Buffer_Data; struct _Ector_Renderer_Data @@ -99,6 +100,11 @@ struct _Ector_Renderer_Shape_Data } stroke; }; +struct _Ector_Renderer_Image_Data +{ + Ector_Buffer *buffer; +}; + struct _Ector_Renderer_Buffer_Data { Ector_Buffer *eo_buffer; diff --git a/src/lib/ector/ector_renderer.h b/src/lib/ector/ector_renderer.h index c8d20d2fb3..482f6cb0d4 100644 --- a/src/lib/ector/ector_renderer.h +++ b/src/lib/ector/ector_renderer.h @@ -3,6 +3,7 @@ #include "ector_renderer.eo.h" #include "ector_renderer_shape.eo.h" +#include "ector_renderer_image.eo.h" #include "ector_renderer_gradient.eo.h" #include "ector_renderer_gradient_linear.eo.h" #include "ector_renderer_gradient_radial.eo.h" diff --git a/src/lib/ector/ector_renderer_image.c b/src/lib/ector/ector_renderer_image.c new file mode 100644 index 00..3e34254f29 --- /dev/null +++ b/src/lib/ector/ector_renderer_image.c @@ -0,0 +1,22 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "ector_private.h" + +#define MY_CLASS ECTOR_RENDERER_IMAGE_MIXIN + + +static void +_ector_renderer_image_buffer_set(Eo *obj EINA_UNUSED, + Ector_Renderer_Image_Data *pd, + Ector_Buffer *buffer) +{ + pd->buffer = buffer; +} + + +#include "ector_renderer_image.eo.c" diff --git a/src/lib/ector/ector_renderer_image.eo b/src/lib/ector/ector_renderer_image.eo new file mode 100644 index 00..9c2e7b3448 --- /dev/null +++ b/src/lib/ector/ector_renderer_image.eo @@ -0,0 +1,16 @@ +import ector_renderer; + +mixin @beta Ector.Renderer.Image +{ + [[Ector image renderer mixin]] + c_prefix: ector_renderer_image; + methods { + @property buffer { + set { + } + values { +buffer : Ector.Buffer; [[Image buffer]] + } + } + } +} diff --git a/src/lib/ector/meson.build b/src/lib/ector/meson.build index 069e98d9e7..5bedb7e82b 100644 --- a/src/lib/ector/meson.build +++ b/src/lib/ector/meson.build @@ -14,6 +14,7 @@ ector_src = [ 'ector_gl_internal.h', 'ector_buffer.c', 'ector_renderer_shape.c', + 'ector_renderer_image.c', 'ector_renderer.c', 'ector_renderer_gradient.c', 'ector_renderer_gradient_radial.c', @@ -25,6 +26,7 @@ pub_eo_files = [ 'ector_buffer.eo', 'ector_renderer.eo', 'ector_renderer_shape.eo', + 'ector_renderer_image.eo', 'ector_renderer_gradient.eo', 'ector_renderer_gradient_radial.eo', 'ector_renderer_gradient_linear.eo' diff --git a/src/lib/ector/software/Ector_Software.h b/src/lib/ector/software/Ector_Software.h index 2f9192ff30..85529e6f21 100644 --- a/src/lib/ector/software/Ector_Software.h +++ b/src/lib/ector/software/Ector_Software.h @@ -36,6 +36,7 @@ #include "software/ector_software_buffer_base.eo.h" #include "softwa
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Support "display" attribute.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e850e3e5dcbd1080a6e879f67ede1533632dade1 commit e850e3e5dcbd1080a6e879f67ede1533632dade1 Author: JunsuChoi Date: Tue Aug 20 20:32:15 2019 +0900 evas_vg_load_svg: Support "display" attribute. Summary: If the display attribute is "none", VG object is not show. The default is "inline" which means visible and "none" means invisible. Depending on the type of node, additional functionality may be required. refer to https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display Test Plan: [SVG] http://www.w3.org/2000/svg;> [C CODE] int main(int argc, char **argv) { setenv("ECTOR_BACKEND", "default", 1); elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add(NULL, "test"); evas_object_smart_callback_add(win, "delete,request", win_del, 0); elm_win_autodel_set(win, 1); Evas *evas = evas_object_evas_get(win); Evas_Object *vg = evas_object_vg_add(evas); evas_object_show(vg); Evas_Object *container = evas_vg_container_add(vg); evas_object_vg_root_node_set(vg, container); Evas_Object *svg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, container); efl_file_simple_load(svg, "./test.svg", NULL); efl_gfx_entity_size_set(svg, EINA_SIZE2D(600, 600)); efl_gfx_entity_visible_set(svg, EINA_TRUE); evas_object_size_hint_weight_set(svg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(svg, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, vg); evas_object_resize(win, WIDTH, HEIGHT); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9640 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 16 +++- src/static_libs/vg_common/vg_common.h | 1 + src/static_libs/vg_common/vg_common_svg.c | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 82e6fc9df0..c277ee9d26 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -911,6 +911,16 @@ _handle_transform_attr(Evas_SVG_Loader *loader EINA_UNUSED, Svg_Node* node, cons node->transform = _parse_transformation_matrix(value); } +static void +_handle_display_attr(Evas_SVG_Loader *loader EINA_UNUSED, Svg_Node* node, const char *value) +{ + //TODO : The display attribute can have various values as well as "none". + // The default is "inline" which means visible and "none" means invisible. + // Depending on the type of node, additional functionality may be required. + // refer to https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display + if (!strcmp(value, "none")) node->display = EINA_FALSE; + else node->display = EINA_TRUE; +} typedef void (*Style_Method)(Evas_SVG_Loader *loader, Svg_Node *node, const char *value); @@ -932,7 +942,8 @@ static const struct { STYLE_DEF(stroke-linejoin, stroke_linejoin), STYLE_DEF(stroke-linecap, stroke_linecap), STYLE_DEF(stroke-opacity, stroke_opacity), - STYLE_DEF(transform, transform) + STYLE_DEF(transform, transform), + STYLE_DEF(display, display) }; static Eina_Bool @@ -1030,6 +1041,9 @@ _create_node(Svg_Node *parent, Svg_Node_Type type) node->style->stroke.join = EFL_GFX_JOIN_MITER; node->style->stroke.scale = 1.0; + // default display is true("inline"). + node->display = EINA_TRUE; + node->parent = parent; node->type = type; node->child = NULL; diff --git a/src/static_libs/vg_common/vg_common.h b/src/static_libs/vg_common/vg_common.h index 731a8d2796..520fcdbfd6 100644 --- a/src/static_libs/vg_common/vg_common.h +++ b/src/static_libs/vg_common/vg_common.h @@ -283,6 +283,7 @@ struct _Svg_Node Eina_Stringshare*id; Svg_Style_Property *style; Eina_Matrix3*transform; + Eina_Bool display; union { Svg_G_Node g; diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index d15e753cc0..4f96bec9aa 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -441,6 +441,7 @@ vg_common_svg_node_eet(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_
[EGIT] [core/efl] master 01/01: spinner_cxx_example: Fix use wrong api
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=03e12fe14823b1ea9e59c97640a1050c838c438f commit 03e12fe14823b1ea9e59c97640a1050c838c438f Author: JunsuChoi Date: Mon Aug 26 16:26:08 2019 +0900 spinner_cxx_example: Fix use wrong api Summary: de18371 changes cause build errors. (D9707) this is a patch to fix it. Test Plan: N/A Reviewers: woohyun, bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9738 --- src/examples/elementary/spinner_cxx_example.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/examples/elementary/spinner_cxx_example.cc b/src/examples/elementary/spinner_cxx_example.cc index 78e1ba381e..a6f583f745 100644 --- a/src/examples/elementary/spinner_cxx_example.cc +++ b/src/examples/elementary/spinner_cxx_example.cc @@ -50,7 +50,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) bx.pack_end(sp4); efl::ui::Spin_Button sp5(instantiate, win); - sp5.editable_set(false); + sp5.direct_text_input_set(false); sp5.hint_fill_set(true, false); bx.pack_end(sp5); @@ -70,7 +70,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) }; efl::eina::accessor values_acc(EINA_C_ARRAY_ACCESSOR_NEW(values)); efl::ui::Spin_Button sp6(instantiate, win); - sp6.editable_set(false); + sp6.direct_text_input_set(false); sp6.range_limits_set(1, 12); //sp6.format_values_set(values_acc); sp6.hint_fill_set(true, false); @@ -79,7 +79,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Spin_Button sp7(instantiate, win); sp7.hint_fill_set(true, false); bx.pack_end(sp7); - sp7.editable_set(true); + sp7.direct_text_input_set(true); auto changed = std::bind ( [] (efl::ui::Range_Display obj) { std::cout << "Changed to " << obj.range_value_get() << std::endl; } --
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Support multiple gradient without part
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2e4c928d81f85826a3ae608d4186dd35f4c282c8 commit 2e4c928d81f85826a3ae608d4186dd35f4c282c8 Author: JunsuChoi Date: Mon Jul 15 21:23:38 2019 +0900 evas_vg_load_svg: Support multiple gradient without part Summary: Multiple gradients can be declared. There is a problem of keeping only one gradient information when it is declared outside defs or when defs is not declared. It supports the use of multiple gradients even if no defs are declared. Test Plan: (with D9312 patch) cd src/example/edje edje_cc -beta svg.edc && gcc -o svg-test svg-test.c `pkg-config --libs --cflags evas ecore ecore-evas edje` ./svg-test Reviewers: Hermet, kimcinoo, smohanty Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9315 --- src/examples/edje/gradients.svg| 62 ++ src/examples/edje/svg.edc | 5 +- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 25 ++--- 3 files changed, 85 insertions(+), 7 deletions(-) diff --git a/src/examples/edje/gradients.svg b/src/examples/edje/gradients.svg new file mode 100644 index 00..c0f85c4941 --- /dev/null +++ b/src/examples/edje/gradients.svg @@ -0,0 +1,62 @@ +http://www.w3.org/2000/svg; viewBox="0 0 100 100"> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/examples/edje/svg.edc b/src/examples/edje/svg.edc index 208d95bf0c..f702bcfae6 100644 --- a/src/examples/edje/svg.edc +++ b/src/examples/edje/svg.edc @@ -72,6 +72,7 @@ collections { vector: "favorite_off.svg"; vector: "batman1.svg"; vector: "batman2.svg"; + vector: "gradients.svg"; } group { name: "svg-test"; @@ -104,6 +105,7 @@ collections { SVG_PART("bg22", "vg22", 0.2, 0.8, .4, 1.0,"favorite_on.svg") SVG_PART("bg23", "vg23", 0.4, 0.8, .6, 1.0,"favorite_off.svg") SVG_PART_INTERPOLATE("bg24", "vg24", 0.6, 0.8, .8, 1.0,"batman1.svg", "batman2.svg") + SVG_PART("bg25", "vg25", 0.8, 0.8, 1.0, 1.0,"gradients.svg") } programs { SVG_PROGRAM("bg1", "vg1") @@ -130,6 +132,7 @@ collections { SVG_PROGRAM("bg22", "vg22") SVG_PROGRAM("bg23", "vg23") SVG_PROGRAM("bg24", "vg24") + SVG_PROGRAM("bg25", "vg25") } } -} \ No newline at end of file +} diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 5bfdf41728..36edaabdba 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -35,7 +35,8 @@ struct _Evas_SVG_Loader Eina_Array *stack; Svg_Node *doc; Svg_Node *def; - Svg_Style_Gradient *gradient; + Eina_List *gradients; + Svg_Style_Gradient *latest_gradient; //for stops Evas_SVG_Parser *svg_parse; int level; Eina_Bool result:1; @@ -2158,11 +2159,21 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, { Svg_Style_Gradient *gradient; gradient = gradient_method(loader, attrs, attrs_length); +/*FIXME: The current parsing structure does not distinguish end tags. + There is no way to know if the currently parsed gradient is in defs. + If a gradient is declared outside of defs after defs is set, it is included in the gradients of defs. + But finally, the loader has a gradient style list regardless of defs. + This is only to support this when multiple gradients are declared, even if no defs are declared. + refer to: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs */ if (loader->doc->node.doc.defs) { loader->def->node.defs.gradients = eina_list_append(loader->def->node.defs.gradients, gradient); } -loader->gradient = gradient; +else + { + loader->gradients = eina_list_append(loader->gradients, gradient); + } +loader->latest_gradient = gradient; } else if (!strcmp(tag_name, "stop")) { @@ -2172,8 +2183,10 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader, stop->a = 255; eina_simple_xml_attributes_parse(attrs, attrs_length, _attr_parse_stops, loader); -if (loader
[EGIT] [core/efl] master 01/01: evas_vg_load_svg: Prevent duplicate operations on radial gradient variables
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=84fcc5d073c7be9ff4152745fcbc63383cb95dc3 commit 84fcc5d073c7be9ff4152745fcbc63383cb95dc3 Author: JunsuChoi Date: Mon Jul 15 21:22:03 2019 +0900 evas_vg_load_svg: Prevent duplicate operations on radial gradient variables Summary: This solves the problem of radial gradient being displayed abnormally when the radial gradient variables are 0 to 1. Test Plan: Sample SVG http://www.w3.org/2000/svg; viewBox="0 0 100 100"> Reviewers: Hermet, kimcinoo, smohanty Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9312 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 56 +- src/static_libs/vg_common/vg_common_svg.c | 16 +-- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 32bfb17d76..5bfdf41728 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -1758,15 +1758,63 @@ _handle_radial_r_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, cons radial->r = _gradient_to_double(loader->svg_parse, value, SVG_PARSER_LENGTH_OTHER); } +static void +_recalc_radial_cx_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { +radial->cx = radial->cx * loader->svg_parse->global.width; + } +} + +static void +_recalc_radial_cy_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { +radial->cy = radial->cy * loader->svg_parse->global.height; + } +} + +static void +_recalc_radial_fx_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { +radial->fx = radial->fx * loader->svg_parse->global.width; + } +} + +static void +_recalc_radial_fy_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { +radial->fy = radial->fy * loader->svg_parse->global.height; + } +} + +static void +_recalc_radial_r_attr(Evas_SVG_Loader *loader, Svg_Radial_Gradient* radial, Eina_Bool user_space) +{ + if (!user_space) + { +radial->r = radial->r * (sqrt(pow(loader->svg_parse->global.height, 2) + pow(loader->svg_parse->global.width, 2)) / sqrt(2.0)); + } +} + + typedef void (*Radial_Method)(Evas_SVG_Loader *loader, Svg_Radial_Gradient *radial, const char *value); +typedef void (*Radial_Method_Recalc)(Evas_SVG_Loader *loader, Svg_Radial_Gradient *radial, Eina_Bool user_space); #define RADIAL_DEF(Name) \ - { #Name, sizeof (#Name), _handle_radial_##Name##_attr} + { #Name, sizeof (#Name), _handle_radial_##Name##_attr, _recalc_radial_##Name##_attr} static const struct { const char *tag; int sz; Radial_Method tag_handler;; + Radial_Method_Recalc tag_recalc; } radial_tags[] = { RADIAL_DEF(cx), RADIAL_DEF(cy), @@ -1814,6 +1862,7 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value) static Svg_Style_Gradient * _create_radialGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen) { + unsigned int i = 0; Svg_Style_Gradient *grad = calloc(1, sizeof(Svg_Style_Gradient)); loader->svg_parse->style_grad = grad; @@ -1834,6 +1883,11 @@ _create_radialGradient(Evas_SVG_Loader *loader, const char *buf, unsigned buflen eina_simple_xml_attributes_parse(buf, buflen, _attr_parse_radial_gradient_node, loader); + for (i = 0; i < sizeof (radial_tags) / sizeof(radial_tags[0]); i++) + radial_tags[i].tag_recalc(loader, grad->radial, grad->user_space); + + grad->use_percentage = EINA_TRUE; + return loader->svg_parse->style_grad; } diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index e753e229d0..20a167c806 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -618,10 +618,18 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F int min = (r.h > r.w) ? r.w : r.h; radius = sqrt(pow(min, 2) + pow(min, 2)) / sqrt(2.0); } +if (g->use_percentage) + { + g->radial->cx = g->radial->cx * r.w + r.x; + g->radial->cy = g->radial->cy * r.h + r.y; + g->radial->r = g->radial->r * radius; +
[EGIT] [core/efl] master 01/01: vg_common_svg: Gradient stop color use premultiplied color.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=baf1fcdb916d0142e1d0652549d658751486a534 commit baf1fcdb916d0142e1d0652549d658751486a534 Author: JunsuChoi Date: Wed Jul 17 17:15:23 2019 +0900 vg_common_svg: Gradient stop color use premultiplied color. Summary: The parsed color is straight color. evas use premultiplied color. Test Plan: Sample SVG http://www.w3.org/2000/svg; viewBox="0 0 100 100"> Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9338 --- src/static_libs/vg_common/vg_common_svg.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 20a167c806..e3866e2018 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -683,13 +683,16 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F stop_count = eina_list_count(g->stops); if (stop_count) { +double opacity; stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop)); i = 0; EINA_LIST_FOREACH(g->stops, l, stop) { - stops[i].r = stop->r; - stops[i].g = stop->g; - stops[i].b = stop->b; + // Use premultiplied color + opacity = (double)stop->a / 255; + stops[i].r = stop->r * opacity; + stops[i].g = stop->g * opacity; + stops[i].b = stop->b * opacity; stops[i].a = stop->a; stops[i].offset = stop->offset; i++; --
[EGIT] [core/efl] master 01/01: Ector.Renderer: Prevent too many unref.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=be419d64d2cc34eaa3e7c8c4eec0508466e10cee commit be419d64d2cc34eaa3e7c8c4eec0508466e10cee Author: JunsuChoi Date: Tue Jul 9 15:46:41 2019 +0900 Ector.Renderer: Prevent too many unref. Summary: pd-> surface will try efl_xref whenever surface_set is called. desturctor is called from a subclass, ref and unref do not match. So, Add this condition temporarily. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9235 --- src/lib/ector/ector_renderer.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/ector/ector_renderer.c b/src/lib/ector/ector_renderer.c index 186e3233ab..d0efab6a6c 100644 --- a/src/lib/ector/ector_renderer.c +++ b/src/lib/ector/ector_renderer.c @@ -15,7 +15,11 @@ _ector_renderer_efl_object_destructor(Eo *obj, Ector_Renderer_Data *pd) efl_destructor(efl_super(obj, MY_CLASS)); if (pd->m) free(pd->m); - efl_unref(pd->surface); + /*FIXME: pd-> surface will try efl_xref whenever surface_set is called. +desturctor is called from a subclass, ref and unref do not match. +So, Add this condition temporarily.*/ + if (efl_ref_count(pd->surface) > 0) + efl_unref(pd->surface); } static Efl_Object * --
[EGIT] [core/efl] master 01/01: vg_common_json: Always set the alpha color of the container.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9a55abef3047be1b7a7e173570cdbcd417e0d59c commit 9a55abef3047be1b7a7e173570cdbcd417e0d59c Author: JunsuChoi Date: Tue Jul 9 14:21:55 2019 +0900 vg_common_json: Always set the alpha color of the container. Summary: Fixes the problem that alpha color is not set when alpha will be 255. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9216 --- src/static_libs/vg_common/vg_common_json.c | 6 ++ 1 file changed, 2 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 f289bd65b4..50ab8c3153 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -363,8 +363,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de #endif //Set Container's alpha color -if (clayer->mAlpha < 255) - efl_gfx_color_set(ctree, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha); +efl_gfx_color_set(ctree, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha, clayer->mAlpha); _update_vg_tree(ctree, clayer, depth+1); @@ -443,8 +442,7 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd) efl_key_data_set(root, _get_key_val((void *) tree), tree); vfd->root = root; } - if (tree->mAlpha < 255) - efl_gfx_color_set(root, tree->mAlpha, tree->mAlpha, tree->mAlpha, tree->mAlpha); + efl_gfx_color_set(root, tree->mAlpha, tree->mAlpha, tree->mAlpha, tree->mAlpha); _update_vg_tree(root, tree, 1); #else --
[EGIT] [core/efl] master 01/01: efl_gfx_shape: Stroke color use a premultiplied color.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=228b91e36f1cb9105b9f628b85d751086a9ef70f commit 228b91e36f1cb9105b9f628b85d751086a9ef70f Author: JunsuChoi Date: Tue Jul 9 14:21:19 2019 +0900 efl_gfx_shape: Stroke color use a premultiplied color. Summary: R, G, and B must not be higher than alpha. Test Plan: //test code Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 600, 600, NULL); ecore_evas_show(ee); Evas *evas = ecore_evas_get(ee); Evas_Object *vg,*bg; bg = evas_object_rectangle_add(evas); evas_object_color_set(bg, 0, 0, 255, 255); evas_object_focus_set(bg, 1); evas_object_show(bg); int w, h; ecore_evas_geometry_get(ee, NULL, NULL, , ); evas_object_resize(bg, w, h); vg = evas_object_vg_add(evas); evas_object_focus_set(vg, 1); evas_object_show(vg); evas_object_resize(vg, w, h); Efl_VG *shape, *container; container = evas_vg_container_add(vg); shape = evas_vg_shape_add(container); evas_vg_shape_append_rect(shape, 0, 0, 200 , 200, 10, 10); evas_vg_shape_stroke_color_set(shape, 255, 255, 255, 10); evas_vg_shape_stroke_width_set(shape, 20); evas_vg_node_origin_set(shape, 200, 200); evas_object_vg_root_node_set(vg, container); ecore_main_loop_begin(); ecore_evas_shutdown(); Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9217 --- src/lib/efl/interfaces/efl_gfx_shape.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c index f5ebdab18e..fa3b718e1b 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.c +++ b/src/lib/efl/interfaces/efl_gfx_shape.c @@ -8,6 +8,8 @@ #include +#define ERR(...) EINA_LOG_DOM_ERR(EINA_LOG_DOMAIN_DEFAULT, __VA_ARGS__) + #define MY_CLASS EFL_GFX_SHAPE_MIXIN typedef struct _Efl_Gfx_Shape_Data @@ -142,6 +144,17 @@ EOLIAN static void _efl_gfx_shape_stroke_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd, int r, int g, int b, int a) { + Eina_Bool err = EINA_FALSE; + if (a > 255) { a = 255; err = EINA_TRUE; } + if (a < 0) { a = 0; err = EINA_TRUE; } + if (r > a) { r = a; err = EINA_TRUE; } + if (r < 0) { r = 0; err = EINA_TRUE; } + if (g > a) { g = a; err = EINA_TRUE; } + if (g < 0) { g = 0; err = EINA_TRUE; } + if (b > a) { b = a; err = EINA_TRUE; } + if (b < 0) { b = 0; err = EINA_TRUE; } + if (err) + ERR("Only handles premultiplied colors (0 <= R,G,B <= A <= 255)"); pd->public.stroke.color.r = r; pd->public.stroke.color.g = g; pd->public.stroke.color.b = b; --
[EGIT] [core/efl] master 01/01: efl_canvas_vg_container: Initialize alpha color
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d7fb6f62b46471767ba13b292dad9f6456de0cdd commit d7fb6f62b46471767ba13b292dad9f6456de0cdd Author: JunsuChoi Date: Thu Jun 13 13:55:29 2019 +0900 efl_canvas_vg_container: Initialize alpha color Summary: The vg object (container, shape, ...) follows color of VG node data. The color of node data is not initialized. it can set the required color for each object. vg container should be layer with an alpha value of 255. Test Plan: N/A Reviewers: Hermet, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, kimcinoo, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9083 --- src/lib/evas/canvas/efl_canvas_vg_container.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index 7623401896..9598168956 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -227,6 +227,8 @@ _efl_canvas_vg_container_efl_object_constructor(Eo *obj, nd->data = pd; nd->flags = EFL_GFX_CHANGE_FLAG_ALL; + efl_gfx_color_set(obj, 255, 255, 255, 255); + return obj; } --
[EGIT] [core/efl] efl-1.22 43/119: evas_vg_node: Move change flag value setting
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=4a1fdec5bb2c1eab456eaba3d192870fe4a4b255 commit 4a1fdec5bb2c1eab456eaba3d192870fe4a4b255 Author: JunsuChoi Date: Fri May 17 10:44:41 2019 +0900 evas_vg_node: Move change flag value setting Summary: _node_change function is only executed when the flag is none to prevent duplicate calls. If CHANGE_MATRIX_FLAG is added to the flag in advance, _node_change function does not operate normally. Test Plan: cd ./src/examples/evas gcc -o evas_vg_simple evas-vg-simple.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` -lm ./evas_vg_simple Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8895 --- src/lib/evas/canvas/efl_canvas_vg_node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c index 77e4eaffa8..895706c71a 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node.c @@ -60,8 +60,10 @@ _efl_canvas_vg_node_transformation_set(Eo *obj, pd->m = NULL; } - pd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX; + /* NOTE: _node_change function is only executed +when pd->flags is EFL_GFX_CHANGE_FLAG_NONE to prevent duplicate calls.*/ _node_change(obj, pd); + pd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX; } const Eina_Matrix3 * --
[EGIT] [core/efl] master 01/01: scroller : Call mirrored_set function after edje_obj is initialized
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9150553eac3c52296a096c745df4d0d40a03aa10 commit 9150553eac3c52296a096c745df4d0d40a03aa10 Author: JunsuChoi <jsuya.c...@samsung.com> Date: Wed Jun 7 15:20:17 2017 +0900 scroller : Call mirrored_set function after edje_obj is initialized Summary: Problem that scroller is not mirrored in RTL mode has been fixed in D4908. However, I found a problem in init process. I will revert D4908 commit(https://phab.enlightenment.org/D4908). After edje_obj is initialized, mirrored_set is called. When wanted_region_set is called, x-coordinate flip normally and acts as RTL. Test Plan: scroller test on elementary_test. Reviewers: raster, woohyun, SanghyeonLee, akanad, eagleeye, cedric, singh.amitesh, eunue Subscribers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D4944 --- src/lib/elementary/elm_scroller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index 4cf261c865..0da8823926 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -904,8 +904,6 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) (obj, "scroller", "base", elm_widget_style_get(obj))) CRI("Failed to set layout!"); - _mirrored_set(obj, elm_widget_mirrored_get(obj)); - priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); evas_object_smart_member_add(priv->hit_rect, obj); elm_widget_sub_object_add(obj, priv->hit_rect); @@ -923,6 +921,8 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) evas_object_size_hint_min_set(obj, minw, minh); evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); + elm_interface_scrollable_edge_left_cb_set(obj, _edge_left_cb); elm_interface_scrollable_edge_right_cb_set(obj, _edge_right_cb); elm_interface_scrollable_edge_top_cb_set(obj, _edge_top_cb); --
[EGIT] [core/efl] master 01/01: Revert "scroller : fix mirrored contents_pos_set call"
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d1e5bd2727f3a86afcb235744c99b325fe85efbc commit d1e5bd2727f3a86afcb235744c99b325fe85efbc Author: JunsuChoi <jsuya.c...@samsung.com> Date: Wed Jun 7 15:17:45 2017 +0900 Revert "scroller : fix mirrored contents_pos_set call" Summary: This reverts commit de313d6296ac8a2d9a3c0f9762179ffd42a833ff. Because x-coordination mirroring is called properly from wanted_regison_set. There was a problem in scroller init process. Before edje_obj was initialize in elm_interface_scrollable_objects_set, mirrored_set was being called. So Move mirrored_set after elm_interface_scrollable_objects_set it can fix this issue(https://phab.enlightenment.org/D4944) Reviewers: raster, woohyun, SanghyeonLee, akanad, eagleeye, cedric, singh.amitesh, eunue Subscribers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D4945 --- src/lib/elementary/elm_interface_scrollable.c | 14 +++--- src/lib/elementary/elm_scroller.c | 16 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index 5f9bf67358..f008d0b6b0 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -1675,22 +1675,22 @@ _elm_interface_scrollable_mirrored_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart { Evas_Coord wx; - if (!sid->edje_obj || !sid->pan_obj) return; + if (!sid->edje_obj) return; mirrored = !!mirrored; + if (sid->is_mirrored == mirrored) + return; + + sid->is_mirrored = mirrored; + edje_object_mirrored_set(sid->edje_obj, mirrored); + if (sid->is_mirrored) wx = _elm_scroll_x_mirrored_get(sid->obj, sid->wx); else wx = sid->wx; elm_interface_scrollable_content_pos_set(sid->obj, wx, sid->wy, EINA_FALSE); - - if (sid->is_mirrored == mirrored) - return; - - sid->is_mirrored = mirrored; - edje_object_mirrored_set(sid->edje_obj, mirrored); } /* returns TRUE when we need to move the scroller, FALSE otherwise. diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index 602b3d5e98..4cf261c865 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -329,13 +329,6 @@ _elm_scroller_elm_widget_activate(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED, E return EINA_TRUE; } -static void -_mirrored_set(Evas_Object *obj, - Eina_Bool mirrored) -{ - elm_interface_scrollable_mirrored_set(obj, mirrored); -} - EOLIAN static void _elm_scroller_elm_layout_sizing_eval(Eo *obj, Elm_Scroller_Data *sd) { @@ -401,8 +394,13 @@ _elm_scroller_elm_layout_sizing_eval(Eo *obj, Elm_Scroller_Data *sd) if ((maxh > 0) && (h > maxh)) h = maxh; evas_object_size_hint_min_set(obj, w, h); +} - _mirrored_set(obj, elm_widget_mirrored_get(obj)); +static void +_mirrored_set(Evas_Object *obj, + Eina_Bool mirrored) +{ + elm_interface_scrollable_mirrored_set(obj, mirrored); } EOLIAN static Elm_Theme_Apply @@ -412,6 +410,8 @@ _elm_scroller_elm_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED) int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS)); if (!int_ret) return ELM_THEME_APPLY_FAILED; + _mirrored_set(obj, elm_widget_mirrored_get(obj)); + elm_layout_sizing_eval(obj); return int_ret; --
[EGIT] [core/efl] master 08/08: scroller : fix mirrored contents_pos_set call
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=de313d6296ac8a2d9a3c0f9762179ffd42a833ff commit de313d6296ac8a2d9a3c0f9762179ffd42a833ff Author: JunsuChoi <jsuya.c...@samsung.com> Date: Mon Jun 5 14:09:42 2017 -0700 scroller : fix mirrored contents_pos_set call Summary: Fixes that a scroller can not be moved normally even if it is changed to mirrored. In elm_scroller, _mirrored_set is called when sizing_eval is called. because When content size is changed, it should be scrolled based on mirrored coordinates. Also In elm_interface_scrollable, elm_interface_scrollable_content_pos_set of _elm_scrollable_mirrored_set to be called regardless of mirrored state. Test Plan: scroller test on elementary_test. Reviewers: raster, woohyun, SanghyeonLee, akanad, eagleeye, cedric, singh.amitesh, eunue Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4908 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/elementary/elm_interface_scrollable.c | 14 +++--- src/lib/elementary/elm_scroller.c | 16 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index f008d0b6b0..5f9bf67358 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -1675,22 +1675,22 @@ _elm_interface_scrollable_mirrored_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart { Evas_Coord wx; - if (!sid->edje_obj) return; + if (!sid->edje_obj || !sid->pan_obj) return; mirrored = !!mirrored; - if (sid->is_mirrored == mirrored) - return; - - sid->is_mirrored = mirrored; - edje_object_mirrored_set(sid->edje_obj, mirrored); - if (sid->is_mirrored) wx = _elm_scroll_x_mirrored_get(sid->obj, sid->wx); else wx = sid->wx; elm_interface_scrollable_content_pos_set(sid->obj, wx, sid->wy, EINA_FALSE); + + if (sid->is_mirrored == mirrored) + return; + + sid->is_mirrored = mirrored; + edje_object_mirrored_set(sid->edje_obj, mirrored); } /* returns TRUE when we need to move the scroller, FALSE otherwise. diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index 4cf261c865..602b3d5e98 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -329,6 +329,13 @@ _elm_scroller_elm_widget_activate(Eo *obj, Elm_Scroller_Data *_pd EINA_UNUSED, E return EINA_TRUE; } +static void +_mirrored_set(Evas_Object *obj, + Eina_Bool mirrored) +{ + elm_interface_scrollable_mirrored_set(obj, mirrored); +} + EOLIAN static void _elm_scroller_elm_layout_sizing_eval(Eo *obj, Elm_Scroller_Data *sd) { @@ -394,13 +401,8 @@ _elm_scroller_elm_layout_sizing_eval(Eo *obj, Elm_Scroller_Data *sd) if ((maxh > 0) && (h > maxh)) h = maxh; evas_object_size_hint_min_set(obj, w, h); -} -static void -_mirrored_set(Evas_Object *obj, - Eina_Bool mirrored) -{ - elm_interface_scrollable_mirrored_set(obj, mirrored); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); } EOLIAN static Elm_Theme_Apply @@ -410,8 +412,6 @@ _elm_scroller_elm_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED) int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS)); if (!int_ret) return ELM_THEME_APPLY_FAILED; - _mirrored_set(obj, elm_widget_mirrored_get(obj)); - elm_layout_sizing_eval(obj); return int_ret; --
[EGIT] [core/efl] master 01/02: edje_decc: modified fclose location
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f66497acac27ef9bf53026429fa221b7e2a3f27 commit 8f66497acac27ef9bf53026429fa221b7e2a3f27 Author: JunsuChoi <jsuya.c...@samsung.com> Date: Tue Sep 20 23:23:29 2016 +0900 edje_decc: modified fclose location modified fclose location. because of file pointer can become NULL. Signed-off-by: Jaehyun Cho <jae_hyun@samsung.com> --- src/bin/edje/edje_decc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c index 2f5fe96..fdbc903 100644 --- a/src/bin/edje/edje_decc.c +++ b/src/bin/edje/edje_decc.c @@ -566,9 +566,9 @@ output(void) { if (fwrite(data, data_size, 1, f) != 1) ERR("Could not write sound: %s", strerror(errno)); + fclose(f); } else ERR("Could not open for writing sound: %s: %s", out1, strerror(errno)); - fclose(f); } } } --
[EGIT] [core/efl] master 02/02: edje_edit : add null check and close eet
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bed6c84afb2694d3a1186c6878b9338503f55021 commit bed6c84afb2694d3a1186c6878b9338503f55021 Author: JunsuChoi <jsuya.c...@samsung.com> Date: Tue Sep 20 23:34:17 2016 +0900 edje_edit : add null check and close eet Signed-off-by: Jaehyun Cho <jae_hyun@samsung.com> --- src/lib/edje/edje_edit.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index f3381fa..65e490c 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -1675,6 +1675,11 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_ } snprintf(buf, sizeof(buf), "edje/collections/%d", e->id); epc = eet_data_read(eetf, _edje_edd_edje_part_collection, buf); + if (!epc) + { +eet_close(eetf); +return EINA_FALSE; + } /* Search first free id */ id = -1; @@ -1703,7 +1708,11 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_ /* Create structs */ de = _alloc(sizeof(Edje_Part_Collection_Directory_Entry)); - if (!de) return EINA_FALSE; + if (!de) + { +eet_close(eetf); +return EINA_FALSE; + } /* Init Edje_Part_Collection_Directory_Entry */ de->id = id; --
[EGIT] [core/efl] master 03/07: emile: fix build warning of Emile_Image.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=260377a376bf19935c6cd92df548650600d67b8e commit 260377a376bf19935c6cd92df548650600d67b8e Author: JunsuChoi <jsuya.c...@samsung.com> Date: Tue May 31 14:37:53 2016 -0700 emile: fix build warning of Emile_Image. Summary: initialized structure 'opts_region' for uninitialized build warning Test Plan: N/A Reviewers: raster, woohyun, cedric Reviewed By: cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3993 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/emile/emile_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c index c7d12b8..5bad68c 100644 --- a/src/lib/emile/emile_image.c +++ b/src/lib/emile/emile_image.c @@ -1614,7 +1614,7 @@ _emile_jpeg_data(Emile_Image *image, struct { unsigned int x, y, w, h; - } opts_region; + } opts_region = {0, 0, 0, 0}; volatile int degree = 0; volatile Eina_Bool change_wh = EINA_FALSE; Eina_Bool line_done = EINA_FALSE; --
[EGIT] [core/efl] master 01/02: eet_image.c : Fix build warning
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=610b766db258495e5bcf32343cc643c12708446d commit 610b766db258495e5bcf32343cc643c12708446d Author: JunsuChoi <jsuya.c...@samsung.com> Date: Mon May 30 13:38:18 2016 +0900 eet_image.c : Fix build warning Summary: initialized two variable for uninitialized build warning Test Plan: N/A Reviewers: woohyun, raster Reviewed By: raster Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3990 --- src/lib/eet/eet_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c index ba43c20..38a0bdc 100644 --- a/src/lib/eet/eet_image.c +++ b/src/lib/eet/eet_image.c @@ -2163,7 +2163,7 @@ eet_data_image_decode_to_cspace_surface_cipher(const void *data, int *quality, Eet_Image_Encoding *lossy) { - unsigned int iw, ih; + unsigned int iw = 0, ih = 0; int ialpha, icompress, iquality; Eet_Image_Encoding ilossy; const Eet_Colorspace *cspaces = NULL; --