ector_software_rasterizer: Add default value for stroke's miter_limit 78/211478/1
authorJunsuChoi <jsuya.choi@samsung.com>
Mon, 5 Aug 2019 09:08:50 +0000 (18:08 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Tue, 6 Aug 2019 00:43:21 +0000 (09:43 +0900)
commitee034cc357ce45e3b88dfc758304f4a6cffb6370
tree0de7e62f8b3ce1e1bdb91fdfdb9e92bfab73ad21
parentf3a2448a7e9ff16a2ba66c05632f866ee537318e
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

Change-Id: I42ad77c8e31d3a6ad10ce894c3c535e00d932be4
src/lib/ector/software/ector_software_rasterizer.c