jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5f9c54a1b2724abcb02ba0a70640a927a1f67ccc

commit 5f9c54a1b2724abcb02ba0a70640a927a1f67ccc
Author: subhransu mohanty <sub.moha...@samsung.com>
Date:   Thu Oct 26 10:59:16 2017 +0900

    triangulator:Added stroke_set api to the triangulator_stroker.
---
 src/static_libs/triangulator/triangulator_stroker.c | 14 ++++++++++++++
 src/static_libs/triangulator/triangulator_stroker.h |  5 ++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

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)
    eina_inarray_free(stroker->arc_pts);
 }
 
+void triangulator_stroker_stroke_set(Triangulator_Stroker *stroker, float 
width,
+                                     Efl_Gfx_Cap cap_style, Efl_Gfx_Join 
join_style, Eina_Matrix3 *m)
+{
+   float scale_factor = 1.0;
+   if (m)
+     {
+        // get the minimum scale factor from matrix
+        scale_factor =  m->xx < m->yy ? m->xx : m->yy;
+     }
+   stroker->width = (width * scale_factor)/2;
+   stroker->join_style = join_style;
+   stroker->cap_style = cap_style;
+}
+
 // calculate the normal vector
 static void
 normal_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);
  */
 void triangulator_stroker_free(Triangulator_Stroker *stroker);
 
+void triangulator_stroker_stroke_set(Triangulator_Stroker *stroker, float 
width,
+                                     Efl_Gfx_Cap cap_style, Efl_Gfx_Join 
join_style, Eina_Matrix3 *m);
+
 /**
  * Process the command list to generate triangle strips.
  * The alogrithm handles multiple contour by adding invisible triangles.
@@ -48,7 +51,7 @@ void triangulator_stroker_free(Triangulator_Stroker *stroker);
  * pt_count  :   number of points.
  *
  * output : It generates the outline in the form of triangle strips store in 
vertices array.
- *          The array can be used to copy the data to a VBO and draw the data 
using TRIANGLE_STRIP.  
+ *          The array can be used to copy the data to a VBO and draw the data 
using TRIANGLE_STRIP.
  */
 void triangulator_stroker_process(Triangulator_Stroker *stroker, const 
Efl_Gfx_Path_Command *cmds, const double *pts, int cmd_count, int pt_count);
 

-- 


Reply via email to