aboutsummaryrefslogtreecommitdiffstats
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
parentecore_evas: improve ecore_evas fallback animator logic for legacy case. (diff)
downloadefl-5f9c54a1b2724abcb02ba0a70640a927a1f67ccc.tar.gz
triangulator:Added stroke_set api to the triangulator_stroker.
-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)
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);