Problem getting visually correct stroke


#1

I have a problem with setting proper stroke attributes when drawing with OpenVG.
Currently - whatever path is drawn - including standard ellipse and rect in example below - there are artifacts appearing on the shape’s edge which look like the stroke isn’t solid and has gaps.
What I’d like to achieve are shapes without those artifacts at all - smooth and clean.

Code used:


vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);

// set fill color
float colorFill[4] = { 0.6f, 0.6f, 0.6f, 1.0f };
VGPaint fillPaint = vgCreatePaint();
vgSetParameteri(fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgSetParameterfv(fillPaint, VG_PAINT_COLOR, 4, colorFill);
vgSetPaint(fillPaint, VG_FILL_PATH);
vgDestroyPaint(fillPaint);

// set stroke color
float colorStroke[4] = { 0.0f, 0.0f, 0.5f, 1.0f };
VGPaint strokePaint = vgCreatePaint();
vgSetParameteri(strokePaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgSetParameterfv(strokePaint, VG_PAINT_COLOR, 4, colorStroke);
vgSetPaint(strokePaint, VG_STROKE_PATH);
vgSetf(VG_STROKE_LINE_WIDTH, 30.0f);
vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);
vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND);
vgDestroyPaint(strokePaint);

VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
    256.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);

vguEllipse(path, 400.0f, 600.0f, 400.0f, 200.0f);
vguRect(path, 200.0f, 200.0f, 400.0f, 200.0f);

vgDrawPath(path, VG_STROKE_PATH | VG_FILL_PATH);

The result I’m getting is visible here:
https://i.stack.imgur.com/JxWRA.png

Can anybody point out if I am missing any setting relevant for rendering?


#2

What’s the name of the vendor of OpenVG ?
Normally, It is not correct result of OpenVG.