Skip to content

Commit 2642eef

Browse files
authored
Update SkiaSharp 2→3 (and bump ScottPlot version 5.0→5.1) (ScottPlot#5061)
* ScottPlot: update package versions * Controls: update package versions * Update SkiaSharp/OpenTK dependencies * SKPaintAndFont: partial implementation * SKPaintAndFont: partial implementation * SKPaintAndFont: partial implementation * SKPaintAndFont: partial implementation * SKPaintAndFont: partial implementation * WinUI: Update SkiaSharp view package * Drawing: respect ResizeFilter * MeasureText: improve measurement of '1' character * MeasureText: pixel perfict consistent with previous version * RadialGauge: fix label vertical alignment * SKPaintAndFont→Paint * Paint: prefix SkiaSharp primitive properties with SK * Demo: use Paint not SKPaint * Colorbar: use Paint not SKPaint * Coxcomb: use Paint not SKPaint * IColormap: Improve GetImageVertical() fractional logic * Coxcomb: refine drawing methods * Refactor to use Drawing methods instead of accessing Paint.SKPaint * Paint: aggressively pass through render system to avoid allocations
1 parent 3cc63ab commit 2642eef

170 files changed

Lines changed: 996 additions & 1202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
## ScottPlot 5.0.57
1+
## ScottPlot 5.1.57
22
_Not yet on NuGet..._
3+
* The transition from ScottPlot `5.0` to `5.1` has breaking changes which are likely to affect advanced users who maintain custom plot types. Upgrading our SkiaSharp from `2.88` to `3.119` brought many improvements, but significantly changed the functionality of `SkiaSharp.SKPaint` which many of our drawing operations relied on. To minimize the impact of this change, references to `SkiaSharp.SKPaint` have been replaced with `ScottPlot.Paint` which closely resembles the original API, minimizing amount of code changes required to upgrade. This version aims at making this upgrade possible, and future versions will refine these objects to improve performance and minimize allocations.
4+
* Public methods that accepted `SkiaSharp.SKPaint` now accept `ScottPlot.Paint`
5+
* `Paint.MeasureText()` now returns a single `PixelRect` instead of using `out` variables
6+
* Rendering: Significantly reduced the number of allocations by passing `Paint` throughout the render flow
37

48
## ScottPlot 5.0.56
59
_Published on [NuGet](https://www.nuget.org/profiles/ScottPlot) on 2025-08-22_

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.Avalonia/ScottPlot.Avalonia.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net462;net8.0</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>disable</ImplicitUsings>
77
<LangVersion>11</LangVersion>
@@ -39,8 +39,7 @@
3939

4040
<!-- Include additional files for the NuGet package -->
4141
<ItemGroup>
42-
<None Include="../../../../dev/icon/v5/scottplot-icon-rounded-border-128.png" Pack="true"
43-
PackagePath="icon.png" />
42+
<None Include="../../../../dev/icon/v5/scottplot-icon-rounded-border-128.png" Pack="true" PackagePath="icon.png" />
4443
<None Include="nuget-readme.md" Pack="true" PackagePath="readme.md" />
4544
</ItemGroup>
4645

@@ -50,8 +49,8 @@
5049
<PrivateAssets>all</PrivateAssets>
5150
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5251
</PackageReference>
53-
<PackageReference Include="Avalonia" Version="11.0.2" />
54-
<PackageReference Include="Avalonia.Skia" Version="11.0.2" />
52+
<PackageReference Include="Avalonia" Version="11.3.4" />
53+
<PackageReference Include="Avalonia.Skia" Version="11.3.4" />
5554
<ProjectReference Include="..\..\ScottPlot5\ScottPlot.csproj" />
5655
</ItemGroup>
5756
</Project>

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.Blazor/ScottPlot.Blazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<!-- Package dependencies -->
5151
<ItemGroup>
5252
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
53-
<PackageReference Include="SkiaSharp.Views.Blazor" Version="2.88.9" />
53+
<PackageReference Include="SkiaSharp.Views.Blazor" Version="3.119.0" />
5454
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
5555
<PrivateAssets>all</PrivateAssets>
5656
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.Eto/ScottPlot.Eto.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>disable</ImplicitUsings>
77
<LangVersion>11</LangVersion>

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.Maui/ScottPlot.Maui.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
<ItemGroup>
6161
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
6262
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
63-
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.9" />
64-
<PackageReference Include="SkiaSharp.Views.Maui.Core" Version="2.88.9" />
63+
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="3.119.0" />
64+
<PackageReference Include="SkiaSharp.Views.Maui.Core" Version="3.119.0" />
6565
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
6666
<PrivateAssets>all</PrivateAssets>
6767
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.OpenGL/ScottPlot.OpenGL.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0-windows;net462</TargetFrameworks>
4+
<TargetFrameworks>net462;net8.0-windows</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>disable</ImplicitUsings>
77
<LangVersion>11</LangVersion>
@@ -52,11 +52,11 @@
5252
<ProjectReference Include="..\..\ScottPlot5\ScottPlot.csproj" />
5353
</ItemGroup>
5454

55-
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
56-
<PackageReference Include="OpenTK" Version="3.3.1" NoWarn="NU1701" />
57-
</ItemGroup>
58-
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
59-
<PackageReference Include="OpenTK" Version="4.3.0" NoWarn="NU1701" />
60-
</ItemGroup>
55+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
56+
<PackageReference Include="OpenTK" Version="3.3.1" NoWarn="NU1701" />
57+
</ItemGroup>
58+
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
59+
<PackageReference Include="OpenTK" Version="4.3.0" NoWarn="NU1701" />
60+
</ItemGroup>
6161

6262
</Project>

src/ScottPlot5/ScottPlot5 Controls/ScottPlot.WPF/SKGLElement.cs

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)