You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It attempts to fill the canvas with white and draws some rectangles, there's no errors but nothing appears on the canvas, it stays black. Is the set up code ok? Copied below (and removed the debug that's in the original for clarity):
[UnmanagedCallersOnly(EntryPoint="MainLoop")]staticvoidMainLoop(){SKCanvascanvas=surface.Canvas;canvas.Clear(SKColors.White);// configure our brushvarredBrush=newSKPaint{Color=newSKColor(0xff,0,0),IsStroke=true};varblueBrush=newSKPaint{Color=newSKColor(0,0,0xff),IsStroke=true};for(inti=0;i<64;i+=8){varrect=newSKRect(i,i,256-i-1,256-i-1);canvas.DrawRect(rect,(i%16==0)?redBrush:blueBrush);}}staticSKSurfacesurface;staticvoidMain(){EmscriptenWebGLContextAttributesattrs;emscripten_webgl_init_context_attributes(&attrs);attrs.stencil=8;// attrs.majorVersion = 2;
fixed (byte*n=&(s[0])){glContext=emscripten_webgl_create_context(n,&attrs);// this is "#canvas"}emscripten_webgl_make_context_current(glContext);GRGlInterfacegrGlInterface=GRGlInterface.Create();GRContextgrContext=GRContext.CreateGl(grGlInterface);emscripten_set_main_loop(&MainLoop,0,0);constSKColorTypecolorType=SKColorType.Rgba8888;intwidth,height;
fixed (byte*n=&(s[0])){emscripten_get_canvas_element_size(n,&width,&height);}varinfo=newGRGlFramebufferInfo(0,colorType.ToGlSizedFormat());surface=SKSurface.Create(grContext,newGRBackendRenderTarget(width,height,0,8,info),colorType);if(surface!=null){Console.WriteLine("got a surface");}else{Console.WriteLine("Failed to create surface");}surface.Canvas.DrawColor(SKColors.White);}
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to see if its possible to use SkiaSharp with NativeAOT-LLVM (https://github.com/dotnet/runtimelab/tree/feature/NativeAOT-LLVM). I've created what I think is a pretty small example (https://github.com/yowl/wskia) . You can build it with the command line (assuming you have SkiaSharp 2.0.12)
It attempts to fill the canvas with white and draws some rectangles, there's no errors but nothing appears on the canvas, it stays black. Is the set up code ok? Copied below (and removed the debug that's in the original for clarity):
The text was updated successfully, but these errors were encountered: