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
We are trying to delve into the source code of SkiaSharp in order to optimize our .NET MAUI application (.NET 9.0-preview2) for Android (we are migrating from Xamarin.Forms). However, the code is not very straightforward to read.
Source Code, Source Folder
When I check the source code and the source directory, I find SKCanvasView and SKGLView:
However, when I decompile the SkiaSharp assemblies, which are included in our application using Visual Studio, I get classes that reference SkiaApi, which would hint that these assemblies use Skia. The decompiler says:
#region Assembly SkiaSharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
// C:\Users\TommiGustafsson\.nuget\packages\skiasharp\3.0.0-preview.2.1\lib\net7.0-maccatalyst16.1\SkiaSharp.dll
// Decompiled with ICSharpCode.Decompiler 8.1.1.7464
#endregion
using System;
namespace SkiaSharp;
public class SKCanvas : SKObject
{
...
private unsafe void DrawImage(SKImage image, SKRect* source, SKRect* dest, SKSamplingOptions sampling, SKPaint paint = null)
{
if (image == null)
{
throw new ArgumentNullException("image");
}
SkiaApi.sk_canvas_draw_image_rect(Handle, image.Handle, source, dest, &sampling, paint?.Handle ?? IntPtr.Zero);
}
...
Question
So, my question is that is SkiaSharp 3.0.0-preview2.1 on MAUI using Skia or Android Canvas for SKCanvasView and SKGLView? How should I read the code, in order to optimize our app?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are trying to delve into the source code of SkiaSharp in order to optimize our .NET MAUI application (.NET 9.0-preview2) for Android (we are migrating from Xamarin.Forms). However, the code is not very straightforward to read.
Source Code, Source Folder
When I check the source code and the
source
directory, I findSKCanvasView
andSKGLView
:source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Controls
These seem to use handlers found in
source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers
, which refer to:source/SkiaSharp.Views/SkiaSharp.Views/Platform/Android
These classes seem to use Android Canvas.
Decompile
However, when I decompile the SkiaSharp assemblies, which are included in our application using Visual Studio, I get classes that reference
SkiaApi
, which would hint that these assemblies use Skia. The decompiler says:Question
So, my question is that is SkiaSharp 3.0.0-preview2.1 on MAUI using Skia or Android Canvas for
SKCanvasView
andSKGLView
? How should I read the code, in order to optimize our app?Beta Was this translation helpful? Give feedback.
All reactions