Skip to content

Commit 6b49a4e

Browse files
AndreCLandrecl-djoefAndré Castro Lundin
authored
Feature/upgrade oxyplot.skiasharp (oxyplot#2161)
* TASK-002: Add .NET 10.0 support - update project files, packages, and fix API incompatibilities * TASK-003: Complete .NET 10.0 upgrade testing and validation * Remove files * Nuget upgrades * Changelog and contributors * Fixes from PR comments * Upgrade multiple packages and projects --------- Co-authored-by: André Castro Lundin <andre.lundin@djoef.dk> Co-authored-by: André Castro Lundin <andre.c.lundin@twoday.com>
1 parent e9792bb commit 6b49a4e

19 files changed

Lines changed: 82 additions & 47 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ All notable changes to this project will be documented in this file.
1010
### Fixed
1111
- DateTimeAxis converting local time rather than UTC to TimeZone
1212

13+
### Changed
14+
- Target .NET 10, remove target .NET 6 (out of support and incompatible with nuget updates)
15+
- Various nuget package upgrades
16+
1317
## [2.2.0] - 2024-09-03
1418

1519
### Added

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,4 @@ Dmytro Shaurin
156156
Rustam Sayfutdinov
157157
Konstantin Stukov <havendv@gmail.com>
158158
jorgectf
159+
AndreCL

Source/Examples/ExampleLibrary/ExampleLibrary.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net462;net6.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;net462;net6.0;net8.0;net10.0</TargetFrameworks>
4+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
45
<PackageId>OxyPlot.ExampleLibrary</PackageId>
56
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
67
<Description>Example models for OxyPlot.</Description>
78
<PackageTags>plotting plot charting chart</PackageTags>
8-
<LangVersion>11</LangVersion>
9+
<LangVersion>14</LangVersion>
910
</PropertyGroup>
1011
<ItemGroup>
1112
<None Remove="Resources\DodgyContourData.tsv" />
@@ -22,10 +23,9 @@
2223
<EmbeddedResource Include="Resources\Y.txt" />
2324
</ItemGroup>
2425
<ItemGroup>
25-
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
26-
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
26+
<ProjectReference Include="..\..\OxyPlot\OxyPlot.csproj" />
2727
</ItemGroup>
2828
<ItemGroup>
29-
<ProjectReference Include="..\..\OxyPlot\OxyPlot.csproj" />
29+
<PackageReference Update="DotNet.ReproducibleBuilds" Version="2.0.2" />
3030
</ItemGroup>
31-
</Project>
31+
</Project>

Source/OxyPlot.ImageSharp.Tests/OxyPlot.ImageSharp.Tests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
4+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
45
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
56
<Description>OxyPlot ImageSharp unit tests</Description>
67
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -11,7 +12,7 @@
1112
<ProjectReference Include="..\OxyPlot\OxyPlot.csproj" />
1213
</ItemGroup>
1314
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1516
<PackageReference Include="NUnit" Version="3.14.0" />
1617
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
1718
</ItemGroup>

Source/OxyPlot.ImageSharp/ImageRenderContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public override void DrawImage(
316316
var doPad = interpolate;
317317

318318
var srcRough = new Rectangle((int)Math.Floor(src.X), (int)Math.Floor(src.Y), (int)Math.Ceiling(src.Width + 3), (int)Math.Ceiling(src.Height + 3));
319-
srcRough.Intersect(sourceImage.Bounds());
319+
srcRough.Intersect(sourceImage.Bounds);
320320
var srcOffset = new PointF(srcRough.X - src.X, srcRough.Y - src.Y);
321321
srcOffset.Offset(0.5f, 0.5f); // texel alignment for resampler
322322
if (doPad)
@@ -345,7 +345,7 @@ public override void DrawImage(
345345
sourceImage.Mutate(img =>
346346
{
347347
img.Transform(rescale, resampler);
348-
destRough.Intersect(sourceImage.Bounds());
348+
destRough.Intersect(sourceImage.Bounds);
349349
img.Crop(destRough);
350350
});
351351

@@ -633,7 +633,7 @@ private void EnsureClippedRegion()
633633
/// <param name="rectangle">The region to copy.</param>
634634
private void Blit(Image<Rgba32> source, Image<Rgba32> destination, Rectangle rectangle)
635635
{
636-
rectangle.Intersect(source.Bounds());
636+
rectangle.Intersect(source.Bounds);
637637

638638
for (int i = rectangle.Left; i < rectangle.Right; i++)
639639
{

Source/OxyPlot.ImageSharp/OxyPlot.ImageSharp.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<LangVersion>9</LangVersion>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
3+
<LangVersion>12</LangVersion>
4+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
5+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
56
<Description>OxyPlot is a plotting library for .NET. This is package is based on SixLabors.ImageSharp.</Description>
67
<PackageTags>plotting plot charting chart imagesharp</PackageTags>
78
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -10,8 +11,8 @@
1011
<WarningsAsErrors />
1112
</PropertyGroup>
1213
<ItemGroup>
13-
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.9" />
14-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0" />
14+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
15+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
1516
</ItemGroup>
1617
<ItemGroup>
1718
<ProjectReference Include="..\OxyPlot\OxyPlot.csproj" />

Source/OxyPlot.SkiaSharp.Tests/OxyPlot.SkiaSharp.Tests.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
3+
<TargetFrameworks>net462;net8.0;net10.0</TargetFrameworks>
4+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
45
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
56
<Description>OxyPlot SkiaSharp unit tests</Description>
67
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
78
<Platforms>AnyCPU;x86;x64</Platforms>
8-
<LangVersion>8</LangVersion>
9+
<LangVersion>14</LangVersion>
910
</PropertyGroup>
1011
<PropertyGroup Condition="'$(TargetFramework)|$(Platform)'=='net462|AnyCPU'">
1112
<PlatformTarget>x86</PlatformTarget>
@@ -22,8 +23,11 @@
2223
<ProjectReference Include="..\OxyPlot\OxyPlot.csproj" />
2324
</ItemGroup>
2425
<ItemGroup>
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.0" />
26-
<PackageReference Include="NUnit" Version="3.14.0" />
27-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
26+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
27+
<PackageReference Include="NUnit" Version="4.5.1" />
28+
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<PackageReference Update="DotNet.ReproducibleBuilds" Version="2.0.2" />
2832
</ItemGroup>
2933
</Project>

Source/OxyPlot.SkiaSharp.Tests/PngAssert.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ public static void AreEqual(string expected, string actual, string message, stri
3535
{
3636
EnsureFolder(expected);
3737
File.Copy(actual, expected);
38-
Assert.Fail("File not found: {0}", expected);
38+
Assert.Fail(string.Format("File not found: {0}", expected));
3939
}
4040

4141
if (expectedImage.GetLength(0) != actualImage.GetLength(0))
4242
{
43-
Assert.Fail("Expected height: {0}\nActual height:{1}\n{2}", expectedImage.GetLength(0), actualImage.GetLength(0), message);
43+
Assert.Fail(string.Format("Expected height: {0}\nActual height:{1}\n{2}", expectedImage.GetLength(0), actualImage.GetLength(0), message));
4444
}
4545

4646
if (expectedImage.GetLength(1) != actualImage.GetLength(1))
4747
{
48-
Assert.Fail("Expected width: {0}\nActual width:{1}\n{2}", expectedImage.GetLength(1), actualImage.GetLength(1), message);
48+
Assert.Fail(string.Format("Expected width: {0}\nActual width:{1}\n{2}", expectedImage.GetLength(1), actualImage.GetLength(1), message));
4949
}
5050

5151
var w = expectedImage.GetLength(0);
@@ -87,13 +87,13 @@ public static void AreEqual(string expected, string actual, string message, stri
8787
File.WriteAllBytes(output, encoder.Encode(differenceImage));
8888
}
8989

90-
Assert.Fail(
90+
Assert.Fail(string.Format(
9191
"{0}:\nPixel differences: {1}\nExpected image: {2}\nActual image: {3}\nDiff image: {4}",
9292
message,
9393
differences,
9494
Path.GetFullPath(expected),
9595
Path.GetFullPath(actual),
96-
Path.GetFullPath(output));
96+
Path.GetFullPath(output)));
9797
}
9898
}
9999

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462;net6.0-windows;net8.0-windows</TargetFrameworks>
3+
<TargetFrameworks>net462;net6.0-windows7.0;net8.0-windows7.0;net10.0-windows7.0</TargetFrameworks>
4+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
45
<UseWPF>true</UseWPF>
56
<Description>OxyPlot is a plotting library for .NET. This package targets WPF applications and uses the SkiaSharp renderer.</Description>
67
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
78
<GenerateDocumentationFile>True</GenerateDocumentationFile>
89
<PackageTags>plotting plot charting chart wpf</PackageTags>
9-
<LangVersion>8</LangVersion>
10+
<LangVersion>14</LangVersion>
1011
<SignAssembly>true</SignAssembly>
1112
<AssemblyOriginatorKeyFile>OxyPlot.SkiaSharp.Wpf.snk</AssemblyOriginatorKeyFile>
1213
</PropertyGroup>
1314
<ItemGroup>
14-
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
15+
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="3.119.2" />
1516
<None Include="OxyPlot.SkiaSharp.Wpf.snk" />
1617
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
1718
</ItemGroup>
@@ -20,4 +21,7 @@
2021
<ProjectReference Include="..\OxyPlot.Wpf.Shared\OxyPlot.Wpf.Shared.csproj" />
2122
<ProjectReference Include="..\OxyPlot\OxyPlot.csproj" />
2223
</ItemGroup>
24+
<ItemGroup>
25+
<PackageReference Update="DotNet.ReproducibleBuilds" Version="2.0.2" />
26+
</ItemGroup>
2327
</Project>

Source/OxyPlot.SkiaSharp/OxyPlot.SkiaSharp.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<LangVersion>8</LangVersion>
44
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
55
<Copyright>Copyright (c) 2020 OxyPlot contributors</Copyright>
6-
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
6+
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
7+
<AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
78
<Authors>OxyPlot contributors</Authors>
89
<Description>OxyPlot is a plotting library for .NET. This package provides rendering based on SkiaSharp.</Description>
910
<PackageTags>plotting plot charting chart skiasharp skia pdf</PackageTags>
@@ -13,13 +14,16 @@
1314
<AssemblyOriginatorKeyFile>OxyPlot.SkiaSharp.snk</AssemblyOriginatorKeyFile>
1415
</PropertyGroup>
1516
<ItemGroup>
16-
<PackageReference Include="SkiaSharp" Version="2.88.8" />
17-
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.8" />
17+
<PackageReference Include="SkiaSharp" Version="3.119.2" />
18+
<PackageReference Include="SkiaSharp.HarfBuzz" Version="3.119.2" />
1819
</ItemGroup>
1920
<ItemGroup>
2021
<None Include="OxyPlot.SkiaSharp.snk" />
2122
</ItemGroup>
2223
<ItemGroup>
2324
<ProjectReference Include="..\OxyPlot\OxyPlot.csproj" />
2425
</ItemGroup>
26+
<ItemGroup>
27+
<PackageReference Update="DotNet.ReproducibleBuilds" Version="2.0.2" />
28+
</ItemGroup>
2529
</Project>

0 commit comments

Comments
 (0)