summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsubhransu mohanty <sub.mohanty@samsung.com>2017-10-26 10:59:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-10 11:20:38 +0900
commit5f9c54a1b2724abcb02ba0a70640a927a1f67ccc (patch)
tree93176019f908e9744b0662a35dc382c8104d3ceb /src
parent3b7607d7f622ceaab7aa30790ce79b6792f230e1 (diff)
triangulator:Added stroke_set api to the triangulator_stroker.
Diffstat (limited to 'src')
-rw-r--r--src/static_libs/triangulator/triangulator_stroker.c14
-rw-r--r--src/static_libs/triangulator/triangulator_stroker.h5
2 files changed, 18 insertions, 1 deletions
diff --git a/src/static_libs/triangulator/triangulator_stroker.c b/src/static_libs/triangulator/triangulator_stroker.c
index a1d06657f0..cf07bec5a3 100644
--- a/src/static_libs/triangulator/triangulator_stroker.c
+++ b/src/static_libs/triangulator/triangulator_stroker.c
@@ -21,6 +21,20 @@ triangulator_stroker_free(Triangulator_Stroker *stroker)
21 eina_inarray_free(stroker->arc_pts); 21 eina_inarray_free(stroker->arc_pts);
22} 22}
23 23
24void triangulator_stroker_stroke_set(Triangulator_Stroker *stroker, float width,
25 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m)
26{
27 float scale_factor = 1.0;
28 if (m)
29 {
30 // get the minimum scale factor from matrix
31 scale_factor = m->xx < m->yy ? m->xx : m->yy;
32 }
33 stroker->width = (width * scale_factor)/2;
34 stroker->join_style = join_style;
35 stroker->cap_style = cap_style;
36}
37
24// calculate the normal vector 38// calculate the normal vector
25static void 39static void
26normal_vector(float x1, float y1, float x2, float y2, float width, 40normal_vector(float x1, float y1, float x2, float y2, float width,
diff --git a/src/static_libs/triangulator/triangulator_stroker.h b/src/static_libs/triangulator/triangulator_stroker.h
index 2dee4290e4..4cb0f3e2a4 100644
--- a/src/static_libs/triangulator/triangulator_stroker.h
+++ b/src/static_libs/triangulator/triangulator_stroker.h
@@ -38,6 +38,9 @@ Triangulator_Stroker *triangulator_stroker_new(void);
38 */ 38 */
39void triangulator_stroker_free(Triangulator_Stroker *stroker); 39void triangulator_stroker_free(Triangulator_Stroker *stroker);
40 40
41void triangulator_stroker_stroke_set(Triangulator_Stroker *stroker, float width,
42 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m);
43
41/** 44/**
42 * Process the command list to generate triangle strips. 45 * Process the command list to generate triangle strips.
43 * The alogrithm handles multiple contour by adding invisible triangles. 46 * The alogrithm handles multiple contour by adding invisible triangles.
@@ -48,7 +51,7 @@ void triangulator_stroker_free(Triangulator_Stroker *stroker);
48 * pt_count : number of points. 51 * pt_count : number of points.
49 * 52 *
50 * output : It generates the outline in the form of triangle strips store in vertices array. 53 * output : It generates the outline in the form of triangle strips store in vertices array.
51 * The array can be used to copy the data to a VBO and draw the data using TRIANGLE_STRIP. 54 * The array can be used to copy the data to a VBO and draw the data using TRIANGLE_STRIP.
52 */ 55 */
53void triangulator_stroker_process(Triangulator_Stroker *stroker, const Efl_Gfx_Path_Command *cmds, const double *pts, int cmd_count, int pt_count); 56void triangulator_stroker_process(Triangulator_Stroker *stroker, const Efl_Gfx_Path_Command *cmds, const double *pts, int cmd_count, int pt_count);
54 57