It seems to happen only to stroke, and not to fill operations. Here's the code I use to initialize skia and to draw the rectangle:
sk_sp<const GrGLInterface> i = GrGLMakeNativeInterface();
if(GrDirectContexts::MakeGL(i) != nullptr)
{
ctx = GrDirectContexts::MakeGL(i).release();
}
GrGLFramebufferInfo info;
info.fFBOID = 0;
info.fFormat = GL_RGBA8;
rt = GrBackendRenderTargets::MakeGL(w, h, 8, 0, info);
// rt = GrBackendRenderTargets::MakeGL(300, h, 0, 0, info);
SkColorType colorType = kRGBA_8888_SkColorType;
s = SkSurfaces::WrapBackendRenderTarget(ctx, rt, kBottomLeft_GrSurfaceOrigin, colorType, nullptr, nullptr).release();
canvas = s->getCanvas();
SkRRect rect = SkRRect::MakeRectXY(SkRect::MakeXYWH(x, y, w, h), border->getCornerRadius(), border->getCornerRadius());
SkPaint pnt;
pnt.setColor(brush->getBackgroundColor().get());
pnt.setStroke(false);
pnt.setAntiAlias(true);
painter->canvas->drawRRect(rect, pnt);
pnt.setColor(brush->getBorderColor().get());
pnt.setStroke(true);
pnt.setStrokeWidth(border->getThickness());
painter->canvas->drawRRect(rect, pnt);
Thanks in advance.