Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Nikita Tsukanov
    I think that TryAdd is better
    since the thread that has lost the race will just destroy its newly created object and take one from the dictionary
    it's way less bug prone to have a guarantee that a particular handle is only getting added to the table once
    Rakesh R Nair
    after updating skiasharp
    I am getting the below error
    The version of the native libSkiaSharp library is incompatible with this version of SkiaSharp. Supported versions of the native libSkiaSharp library are in the range [80.0, 81.0).
    Benedikt Stebner
    Make a clean rebuild. The native bits are outdated.
    Matthew Leibowitz
    Hopefully moving forward, this error goes away. Was this ios? Something is up with the copying. I think it just checks the filename and not date or something. I got an issue open for this
    Rakesh R Nair
    no i got it on Android
    Nikita Tsukanov
    @mattleibow I think we could use an alternative approach
    1) implement some lock abstraction that would use EnterCriticalSection on win32 and Monitor.Enter otherwise
    2) copy-paste ConcurrentDictionarty from dotnet/runtime and make it use said lock abstraction
    might be costly due to additional P/Invoke though
    Nikita Tsukanov
    For Avalonia, I think, we'll workaround that weird behavior by overriding Wait in our sync context
    I will need the sample to dive deeper in.
    discord is much better for .netters i guess
    Wow, great work with SkiaSharp version 2.8.x, exciting!
    Hello, I'm using SkiaSharp 2.80.1. I'm using Opengl for rendering, and am using the default framebuffer as a rendertarget. Everything runs well, my canvas is displayed. ie, until I move from my intel integrated gpu to my discrete one. the canvas is still rendered, and there are no visible issues, but my console keeps getting spammed with Shader Compilation Errors. there's been no change in code, and the window and context creation code is the same.
    this is the error.
    This message was deleted
    Shader compilation error
       1    const float2 _sampleOffsets[0] = float2[0](flat in half4 vcolor_Stage0;noperspective in float4 varccoord_Stage0;out half4 sk_FragColor;
       2    void main() {sk_SampleMask[0] = ~0;half4 outputColor_Stage0;half4 outputCoverage_Stage0;{ // Stage 0, GrFillRRectOp::Processor
       3    outputColor_Stage0 = vcolor_Stage0;outputCoverage_Stage0 = half4(1);if (float2(0) != varccoord_Stage0.xy) {float fn = dot(varccoord_Stage0.xy, varccoord_Stage0.xy) - 1;float2 grad = varccoord_Stage0.zw;{float fnwidth = abs(grad.x) + abs(grad.y);int mask = 0;if (fn*2 < fnwidth) {if (fn*-2 >= fnwidth) {mask = ~0;} else for (int i = 0; i < 0; ++i) {float fnsample = dot(grad, _sampleOffsets[i]) + fn;if (fnsample < 0) {mask |= (1 << i);}}}sk_SampleMask[0] = (mask);}}}{ // Xfer Processor: Porter Duff
       4    sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;}}
    error: 1: expected expression, but found 'flat'
    1 error
    This happens when I use SKImage. it is spammed every frame. is there anywhere I could silence the errors, or at least direct the logs to somewhere other than the console
    Rohit Vipin Mathews
    Xamarin.Google.Dagger Issue
    Java.Lang.NoSuchMethodError Message=No static method checkBuilderRequirement(Ljava/lang/Object;Ljava/lang/Class;)V in class Ldagger/internal/Preconditions; or its super classes (declaration of 'dagger.internal.Preconditions' appears in /data/app/com.company.app-sh9ZzgpYBy4z4fFrnQpzdQ==/base.apk)
    Sebastian Loncar
    Is there an elegant way to preserve the OpenGL state? It's changing my engine's openGL parameters, and it skia itself assumes that i will keep there states. It's a pain to set/restore every possible changed openGL state/binding (and there's no documentation what state could be affected)
    Sebastian Loncar
    my current approach looks like this:
            internal void ReadStateFromDevice(GraphicsDeviceState s)
                s.ScissorTest = GL.IsEnabled(EnableCap.ScissorTest);
                s.Blend = GL.IsEnabled(EnableCap.Blend);
                s.CullFace = GL.IsEnabled(EnableCap.CullFace);
                s.CullFaceMode = (CullFaceMode)GL.GetInteger(GetPName.CullFaceMode);
                s.DepthMask = GL.GetBoolean(GetPName.DepthWritemask);
                s.DepthTest = GL.IsEnabled(EnableCap.DepthTest);
                s.DepthFunc = (DepthFunction)GL.GetInteger(GetPName.DepthFunc);
                s.ReadFramebuffer = GL.GetInteger(GetPName.ReadFramebufferBinding);
                s.DrawFramebuffer = GL.GetInteger(GetPName.DrawFramebufferBinding);
                s.Framebuffer = GL.GetInteger(GetPName.FramebufferBinding);
                s.FramebufferExt = GL.GetInteger(GetPName.FramebufferBindingExt);
                s.Program = GL.GetInteger(GetPName.CurrentProgram);
                s.VertexProgramPointSize = GL.IsEnabled(EnableCap.VertexProgramPointSize);
                s.VertexArrayBinding = GL.GetInteger(GetPName.VertexArrayBinding);
    (and a reverse function)
    Phil Marland
    Is there anyone who might be able to help me update the Android and iOS bindings for the Stripe component in this library? It's more than 3 years out of date but when we try and update it I'm getting problems with AndroidX.ViewBinding on the Android side.
    {Java.Lang.ClassNotFoundException: Didn't find class "androidx.viewbinding.ViewBinding" on path: DexPathList[[zip file "/data/app/com.stripe.demo.stripe_android_demo-WavIYiuBHhr7K5nvRYv8g==/base.apk"],nativeLibraryDirectories=[/data/app/com.stripe.demo.stripe…}
    My team and I are happy to put time into getting this working but we're hitting brick walls and can't seem to get past some of these errors.


    getting problems with AndroidX.ViewBinding on the Android side.

    We do not support view bindings.
    Some of your components/dependencies use Android bindings and we do not support that.
    Xamarin.Forms have data bindinging, so we never finished Android databindings which need gradle support for some code generation and that should be implemented in MsBuild. At least that was year ago when I took a look at it while contemplating to do it or not…

    Phil Marland
    @moljac Thanks for the reply. So would you suggest that we won't be successful in finding a way to make this particular SDK work with Xamarin Forms, i.e. that it's a dead-end? Just want to make sure I've understood as we'll need to take the project in quite a different direction if that's the case.
    Phil Marland
    Also if at all possible can you clarify if you think this is specific to Xamarin Forms, or whether it would affect Xamarin Android projects also?
    Seems a shame to me if any Android package using Android Bindings is essentially unusable in Xamarin.

    Are there anyone here that knows about SkiaSharp and WindowsForms? Or more precisely GL and Forms I guess. Seems like Application.SetHighDpiMode affects how transparency is rendered with SkiaSharp (but I suspect the reason might be in the underlying GL implementation?).

    I don't know how it has been earlier, only that I ported an app to newer versions of both SkiaSharp and .NET and in the process my transparency stopped working. The automatically genereated Program.cs of the Windows Forms template nowadays add the following line in the main procedure:


    Changing the setting to either HighDpiMode.DpiUnaware or HighDpiMode.DpiUnawareGdiScaledreturns the behaviour of my application to what it was (ie transparency works). Guess that was one of the default values previously.

    I know this might not be the proper channel but I pop the question just in case anyone knows more or have some well thought directions to go for further info. I have searched a little and of course I can dig into source code - but as for now I am ok with having found how to affect the behaviour.

    Piero Castillo
    Hi, I'm new, how can I save an SKCanvas to PNG?
    Alexander Ubillus
    hi! I am interested in reusing the pre-build SKIA binaries used by SkiaSharp given that their C bindings are more complete. This is to enable rust bindings. I'm wondering if there's an easy way to access these binaries? I guess the other way would be to download them from nuget and extracting them manually (yuck!)
    Benedikt Stebner
    @alexanderuv Just look at the repository. There is a bootstrapper that downloads prebuild bins for you. That way you get up to date bins.
    Nikita Tsukanov
    @mattleibow it seems that libSkiaSharp.dylib isn't being built for ARM
    for macOS
    so we can't use it with .NET 6 on M1 macs
    Hi there, hope not to be OT.
    Is there an implementation of immediate-mode UIs on top of SkiaSharp ?
    ImGui (https://github.com/ocornut/imgui) or Nuklear (https://github.com/vurtun/nuklear) ?
    Anyone care to give a Xamarin newb a hand with an androidx error?
    Charlie Jiang
    Hi there! I wonder if there's any way to get the reason why a SkSurface.Create call is failed?
    Charlie Jiang
    Maybe I'm going on the totally wrong way, so I'd love any suggestions: I'm doing off-screen rendering using SkiaSharp in .NET 5 (better cross-platform), and GPU acceleration is required. The development is on Windows. Because the program is a command-line tool, I created a hidden window. The window is created using OpenTk since I saw Matthew's examples, and I made the window's context as the default. Then, I created a framebuffer and renderbuffer as described in this SO solution(https://stackoverflow.com/questions/12157646/how-to-render-offscreen-on-opengl). Finally I attempted to create the surface, yet only got a null.
    Code as below:
    Any help and suggestions would be appreciated!
    Charlie Jiang
    After some digging, I replaced the sampleCounts and stencilBits to the ones obtained via OpenGL(both 0?), matched the renderbuffer size and the surface size and corrected the RenderBufferInternalFormat, still no luck...
    GL.BindRenderbuffer(OpenTK.Graphics.ES30.RenderbufferTarget.Renderbuffer, rbo);
    GL.RenderbufferStorage(OpenTK.Graphics.ES30.RenderbufferTarget.Renderbuffer, OpenTK.Graphics.ES30.RenderbufferInternalFormat.Rgba8, 800, 700);
    GL.BindFramebuffer(OpenTK.Graphics.ES30.FramebufferTarget.DrawFramebuffer, fbo);
    var sampleCounts = GL.GetInteger(OpenTK.Graphics.ES30.GetPName.Samples);
    int stencilBits;
        out stencilBits);
    var target = new GRBackendRenderTarget(800, 700, sampleCounts, stencilBits, new GRGlFramebufferInfo(fbo, SKColorType.Bgra8888.ToGlSizedFormat()));
    var surface = SKSurface.Create(grContext, target, GRSurfaceOrigin.TopLeft, SKColorType.Bgra8888);