Hi,
I have been trying to use hardware accelerated (GPU backed) 2D rendering using Skia. I have been able to do so, but I am seeing jagged edges even when I have enabled antialiasing.
The simplified relevant code is as follows:-
context = GrContext::Create( GrBackend::kOpenGL_GrBackend, NULL /*backendContext*/ );
GrBackendRenderTargetDesc desc;
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kRGBA_8888_GrPixelConfig;
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
desc.fSampleCnt = 2;
desc.fStencilBits = 0;
desc.fRenderTargetHandle = 0;
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendRenderTarget( context, desc, nullptr /*surfaceProps*/ )
SkCanvas* canvas = surface->getCanvas();
SkPaint paint;
paint.setAntiAlias( true );
paint.setColor( color );
paint.setStyle( SkPaint::kFill_Style );
canvas->drawOval( rectangle, paint );
I have attached the screenshot. I cannot repro the issue on fiddle. Any help in this matter would be greatly appreciated.
Thanks,
Abhishek