From 949cf2750b0a8ee105aaedb891b6e17a439ac6f8 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 5 Aug 2019 18:08:50 +0900 Subject: [PATCH 1/2] 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(&thread->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 From 16d806ff92edab6c8d2d7440794b2c535aee9d21 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 5 Aug 2019 20:42:26 +0900 Subject: [PATCH 2/2] vg json: up to date internal reference. rlottie is not officially released, still it's unstable. --- src/static_libs/vg_common/vg_common_json.c | 2 +- 1 file changed, 1 insertion(+), 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 9b2d8403f4..63270000e8 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -381,7 +381,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de { ctree = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, root); efl_key_data_set(root, key, ctree); - if (clayer->name) efl_key_data_set(ctree, "_lot_node_name", clayer->name); + if (clayer->keypath) efl_key_data_set(ctree, "_lot_node_name", clayer->keypath); } #if DEBUG for (int i = 0; i < depth; i++) printf(" ");