summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-11-08 12:51:11 +0900
committerCedric BAIL <cedric@osg.samsung.com>2016-11-15 15:21:17 -0800
commit355a4e3830207a3bb5cdb88f55a85e917b92bc96 (patch)
tree0b6040c02ef7586798851d65df83414f81936647 /src/lib/ector
parentdc7806e6856b584b387b0126f994e461f7c897cf (diff)
evas/vg: fix handling of stroke width in cairo and native backend
T3351 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.c2
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c5
-rw-r--r--src/lib/ector/software/ector_software_private.h2
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c16
4 files changed, 19 insertions, 6 deletions
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
index 6f67fb6262..29eefd8e9c 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
@@ -205,7 +205,7 @@ _ector_renderer_cairo_shape_ector_renderer_draw(Eo *obj, Ector_Renderer_Cairo_Sh
205 } 205 }
206 206
207 // Set dash, cap and join 207 // Set dash, cap and join
208 cairo_set_line_width(pd->parent->cairo, (pd->public_shape->stroke.width * pd->public_shape->stroke.scale * 2)); 208 cairo_set_line_width(pd->parent->cairo, (pd->public_shape->stroke.width * pd->public_shape->stroke.scale));
209 cairo_set_line_cap(pd->parent->cairo, (cairo_line_cap_t) pd->public_shape->stroke.cap); 209 cairo_set_line_cap(pd->parent->cairo, (cairo_line_cap_t) pd->public_shape->stroke.cap);
210 cairo_set_line_join(pd->parent->cairo, (cairo_line_join_t) pd->public_shape->stroke.join); 210 cairo_set_line_join(pd->parent->cairo, (cairo_line_join_t) pd->public_shape->stroke.join);
211 cairo_stroke(pd->parent->cairo); 211 cairo_stroke(pd->parent->cairo);
diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c
index 50fcddf12b..faafe0d605 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.c
+++ b/src/lib/ector/software/ector_renderer_software_shape.c
@@ -543,9 +543,10 @@ _update_rle(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
543 { 543 {
544 ector_software_rasterizer_stroke_set(pd->surface->rasterizer, 544 ector_software_rasterizer_stroke_set(pd->surface->rasterizer,
545 (pd->public_shape->stroke.width * 545 (pd->public_shape->stroke.width *
546 pd->public_shape->stroke.scale), 546 pd->public_shape->stroke.scale),
547 pd->public_shape->stroke.cap, 547 pd->public_shape->stroke.cap,
548 pd->public_shape->stroke.join); 548 pd->public_shape->stroke.join,
549 pd->base->m);
549 550
550 if (pd->public_shape->stroke.dash) 551 if (pd->public_shape->stroke.dash)
551 { 552 {
diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h
index 1aa151146e..d11ba3adc0 100644
--- a/src/lib/ector/software/ector_software_private.h
+++ b/src/lib/ector/software/ector_software_private.h
@@ -108,7 +108,7 @@ void ector_software_rasterizer_init(Software_Rasterizer *rasterizer);
108void ector_software_rasterizer_done(Software_Rasterizer *rasterizer); 108void ector_software_rasterizer_done(Software_Rasterizer *rasterizer);
109 109
110void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width, 110void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width,
111 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style); 111 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m);
112 112
113void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Eina_Matrix3 *t); 113void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Eina_Matrix3 *t);
114void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a); 114void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a);
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index cd59eb8735..b0ea4834af 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -365,11 +365,23 @@ void ector_software_rasterizer_done(Software_Rasterizer *rasterizer)
365} 365}
366 366
367void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width, 367void ector_software_rasterizer_stroke_set(Software_Rasterizer *rasterizer, double width,
368 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style) 368 Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style,
369 Eina_Matrix3 *m)
369{ 370{
370 SW_FT_Stroker_LineCap cap; 371 SW_FT_Stroker_LineCap cap;
371 SW_FT_Stroker_LineJoin join; 372 SW_FT_Stroker_LineJoin join;
372 int stroke_width = (int)(width * 64); 373 int stroke_width;
374 double scale_factor = 1.0;
375 if (m)
376 {
377 // get the minimum scale factor from matrix
378 scale_factor = m->xx < m->yy ? m->xx : m->yy;
379 }
380 width = width * scale_factor;
381 width = width/2.0; // as free type uses it as the radius of the
382 // pen not the diameter.
383 // convert to freetype co-ordinate
384 stroke_width = (int)(width * 64);
373 385
374 switch (cap_style) 386 switch (cap_style)
375 { 387 {