summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-08-05 18:08:50 +0900
committerHermet Park <hermetpark@gmail.com>2019-08-05 18:08:50 +0900
commit949cf2750b0a8ee105aaedb891b6e17a439ac6f8 (patch)
treedda8ed9b3edbe2dd261bc4495740c9242fa9ade8 /src/lib/ector
parent7869778d02d862a0efd11857c3299cd391245551 (diff)
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
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c8
1 files 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 808f723..fcf3438 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)
664 664
665 SW_FT_Stroker_New(&thread->stroker); 665 SW_FT_Stroker_New(&thread->stroker);
666 SW_FT_Stroker_Set(thread->stroker, 1 << 6, 666 SW_FT_Stroker_Set(thread->stroker, 1 << 6,
667 SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0); 667 SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0x4<<16);
668} 668}
669 669
670void ector_software_rasterizer_init(Software_Rasterizer *rasterizer) 670void ector_software_rasterizer_init(Software_Rasterizer *rasterizer)
@@ -692,6 +692,10 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread,
692 SW_FT_Stroker_LineJoin join; 692 SW_FT_Stroker_LineJoin join;
693 int stroke_width; 693 int stroke_width;
694 double scale_factor = 1.0; 694 double scale_factor = 1.0;
695
696 //TODO: The interface to change the value of the miter_limit is not yet ready.
697 SW_FT_Fixed miter_limit = 0x4<<16;
698
695 if (m) 699 if (m)
696 { 700 {
697 // get the minimum scale factor from matrix 701 // get the minimum scale factor from matrix
@@ -728,7 +732,7 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread,
728 join = SW_FT_STROKER_LINEJOIN_MITER; 732 join = SW_FT_STROKER_LINEJOIN_MITER;
729 break; 733 break;
730 } 734 }
731 SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, 0); 735 SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, miter_limit);
732} 736}
733 737
734static void 738static void