Open
Description
Description
Part of #2615
The SkiaSharp codebase is quite old and existed before the introduction of spans. (See more https://learn.microsoft.com/en-us/dotnet/standard/memory-and-spans/memory-t-usage-guidelines)
Current files in the core binding using arrays:
- Definitions.cs
- GRGlInterface.cs
- GRVkExtensions.cs
- SKBitmap.cs
- SKCanvas.cs
- SKCodec.cs
- SKColorFilter.cs
- SKColorSpace.cs
- SKColorSpaceStructs.cs
- SKData.cs
- Start using spans instead of arrays #2617
public byte[] ToArray ()
is intentially an array, there is:public ReadOnlySpan<byte> AsSpan ()
public Span<byte> Span { get; }
- SKFont.cs
- SKFontManager.cs
- SKFrontBufferedManagedStream.cs
- SKFrontBufferedStream.cs
- SKImage.cs
- SKManagedStream.cs
- SKManagedWStream.cs
- SKMaskFilter.cs
- SKMatrix.cs
- SKMatrix44.cs
- SKObject.cs
- SKPMColor.cs
- SKPaint.cs
- SKPath.cs
- SKPathEffect.cs
- SKRoundRect.cs
- Start using spans instead of arrays #2617
public SKPoint[] Radii { get; }
still exists as it is a convenience and this is accessible using non-arrays by querying each corner individually (which is what this property does)
- SKRuntimeEffect.cs
- SKShader.cs
- SKStream.cs
- SKString.cs
- SKTextBlob.cs
- SKTypeface.cs
- SKVertices.cs
- SkiaApi.generated.cs
- Util.cs
NOTE: not all usages are bad. There are cases where returning an array is acceptable because we have span alternatives, or the data is best contained in an array.
Metadata
Assignees
Type
Projects
Status
Ready For Work
Activity