This commit is contained in:
Matthew Leibowitz 2022-11-24 18:32:33 +02:00 коммит произвёл GitHub
Родитель 747a6f9c96
Коммит 1131738c9b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
21 изменённых файлов: 279 добавлений и 58 удалений

Просмотреть файл

@ -2,8 +2,8 @@
mdoc release 5.8.9
harfbuzz release 2.8.2
skia release m88
xunit release 2.4.1
xunit.runner.console release 2.4.1
xunit release 2.4.2
xunit.runner.console release 2.4.2
Xamarin.Forms release 4.8.0.1821
Xamarin.Forms.Platform.WPF release 4.8.0.1821
Xamarin.Forms.Platform.GTK release 4.8.0.1821

Просмотреть файл

@ -10,7 +10,7 @@
#addin nuget:?package=Xamarin.Nuget.Validator&version=1.1.1
#tool nuget:?package=mdoc&version=5.8.9
#tool nuget:?package=xunit.runner.console&version=2.4.1
#tool nuget:?package=xunit.runner.console&version=2.4.2
#tool nuget:?package=vswhere&version=2.8.4
using System.Linq;

Просмотреть файл

@ -15,8 +15,8 @@ variables:
MONO_VERSION_LINUX: 'stable-focal/snapshots/6.12.0.182'
XCODE_VERSION: 13.2.1
VISUAL_STUDIO_VERSION: '17/pre'
DOTNET_VERSION_PREVIEW: '6.0.402'
DOTNET_WORKLOAD_SOURCE: 'https://maui.blob.core.windows.net/metadata/rollbacks/6.0.540.json'
DOTNET_VERSION_PREVIEW: '6.0.403'
DOTNET_WORKLOAD_SOURCE: 'https://maui.blob.core.windows.net/metadata/rollbacks/6.0.547.json'
CONFIGURATION: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
THROW_ON_TEST_FAILURE: true

Просмотреть файл

@ -4,7 +4,7 @@ Param(
$ErrorActionPreference = 'Stop'
$uri = "https://xamarin.azureedge.net/GTKforWindows/Windows/gtk-sharp-$Version.msi"
$uri = "https://github.com/mono/gtk-sharp/releases/download/$Version/gtk-sharp-$Version.msi"
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
$tempDir = Join-Path "$HOME_DIR" "gtk-sharp-temp"

Просмотреть файл

@ -0,0 +1,198 @@
// Copied from https://github.com/dotnet/runtime/blob/41ba8e1eff54b62db76797709956e37d83f59d5e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.CodeAnalysis
{
#if !NETSTANDARD2_1
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class AllowNullAttribute : Attribute { }
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DisallowNullAttribute : Attribute { }
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MaybeNullAttribute : Attribute { }
/// <summary>Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullAttribute : Attribute { }
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MaybeNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter may be null.
/// </param>
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }
}
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }
}
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullIfNotNullAttribute : Attribute
{
/// <summary>Initializes the attribute with the associated parameter name.</summary>
/// <param name="parameterName">
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
/// </param>
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;
/// <summary>Gets the associated parameter name.</summary>
public string ParameterName { get; }
}
/// <summary>Applied to a method that will never return under any circumstance.</summary>
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DoesNotReturnAttribute : Attribute { }
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DoesNotReturnIfAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified parameter value.</summary>
/// <param name="parameterValue">
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
/// the associated parameter matches this value.
/// </param>
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
/// <summary>Gets the condition parameter value.</summary>
public bool ParameterValue { get; }
}
#endif
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MemberNotNullAttribute : Attribute
{
/// <summary>Initializes the attribute with a field or property member.</summary>
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
public MemberNotNullAttribute(string member) => Members = new[] { member };
/// <summary>Initializes the attribute with the list of field and property members.</summary>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
/// </param>
public MemberNotNullAttribute(params string[] members) => Members = members;
/// <summary>Gets field or property member names.</summary>
public string[] Members { get; }
}
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MemberNotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new[] { member };
}
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
/// </param>
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }
/// <summary>Gets field or property member names.</summary>
public string[] Members { get; }
}
}

Просмотреть файл

@ -30,12 +30,31 @@
<LangVersion Condition="$(IsWindows)">10.0</LangVersion>
<DotNetSdkManifestVersionRegex>\d+\.\d+\.\d+(-[a-z]+\.\d+)?</DotNetSdkManifestVersionRegex>
<DotNetSdkVersionRegex>\d+\.\d+</DotNetSdkVersionRegex>
<DotNetSdkManifestVersion>$([System.Text.RegularExpressions.Regex]::Match('$(MSBuildExtensionsPath)', '$(DotNetSdkManifestVersionRegex)'))</DotNetSdkManifestVersion>
<DotNetSdkManifestVersion Condition="'$(MSBuildRuntimeType)' == 'Core'">$([System.Text.RegularExpressions.Regex]::Match('$(MSBuildExtensionsPath)', '$(DotNetSdkManifestVersionRegex)'))</DotNetSdkManifestVersion>
<!-- TODO: find a way to detect the installed SDK version -->
<DotNetSdkManifestVersion Condition="'$(MSBuildRuntimeType)' != 'Core'"></DotNetSdkManifestVersion>
<DotNetSdkVersion Condition="'$(DotNetSdkManifestVersion)' != ''">$([System.Text.RegularExpressions.Regex]::Match('$(DotNetSdkManifestVersion)', '$(DotNetSdkVersionRegex)'))</DotNetSdkVersion>
<DotNetBaseVersion>6.0</DotNetBaseVersion>
<DotNetNextVersion Condition="'$(DotNetSdkVersion)' != '' and $([MSBuild]::VersionGreaterThan($(DotNetSdkVersion), $(DotNetBaseVersion)))">$(DotNetSdkVersion)</DotNetNextVersion>
</PropertyGroup>
<!-- Try determine which .NET workloads are installed for LOCAL builds -->
<PropertyGroup Condition="!$(IsCI)">
<DotNetWorkloadVersionRegex>\d+\.\d+\.\d+(-[a-z]+[\.\d+]+)?</DotNetWorkloadVersionRegex>
<DotNetWorkloadInstallLocation Condition="'$(DotNetWorkloadInstallLocation)' == '' and Exists('$(DOTNET_ROOT)\sdk-manifests\$(DotNetSdkManifestVersion)\microsoft.net.sdk.macos\WorkloadManifest.json')">$(DOTNET_ROOT)\sdk-manifests\$(DotNetSdkManifestVersion)\</DotNetWorkloadInstallLocation>
<DotNetWorkloadInstallLocation Condition="'$(DotNetWorkloadInstallLocation)' == '' and Exists('$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetSdkManifestVersion)\microsoft.net.sdk.macos\WorkloadManifest.json')">$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetSdkManifestVersion)\</DotNetWorkloadInstallLocation>
<DotNetWorkloadPacksInstallLocation Condition="'$(DotNetWorkloadInstallLocation)' != ''">$(DotNetWorkloadInstallLocation)..\..\packs\</DotNetWorkloadPacksInstallLocation>
<DotNetTizenWorkloadInstalledVersion Condition="Exists('$(DotNetWorkloadInstallLocation)samsung.net.sdk.tizen\WorkloadManifest.json')">$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\samsung.net.sdk.tizen\WorkloadManifest.json')), $(DotNetWorkloadVersionRegex)))</DotNetTizenWorkloadInstalledVersion>
<DotNetTVOSWorkloadInstalledVersion Condition="Exists('$(DotNetWorkloadInstallLocation)microsoft.net.sdk.tvos\WorkloadManifest.json')">$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\microsoft.net.sdk.tvos\WorkloadManifest.json')), '$(DotNetWorkloadVersionRegex)'))</DotNetTVOSWorkloadInstalledVersion>
<DotNetMacOSWorkloadInstalledVersion Condition="Exists('$(DotNetWorkloadInstallLocation)microsoft.net.sdk.macos\WorkloadManifest.json')">$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(DotNetWorkloadInstallLocation)\microsoft.net.sdk.macos\WorkloadManifest.json')), '$(DotNetWorkloadVersionRegex)'))</DotNetMacOSWorkloadInstalledVersion>
<DotNetTizenWorkloadIsInstalled Condition="Exists('$(DotNetWorkloadPacksInstallLocation)Samsung.Tizen.Sdk\$(DotNetTizenWorkloadInstalledVersion)\Sdk\AutoImport.props')">true</DotNetTizenWorkloadIsInstalled>
<DotNetTVOSWorkloadIsInstalled Condition="Exists('$(DotNetWorkloadPacksInstallLocation)Microsoft.tvOS.Sdk\$(DotNetMacOSWorkloadInstalledVersion)\Sdk\AutoImport.props')">true</DotNetTVOSWorkloadIsInstalled>
<DotNetMacOSWorkloadIsInstalled Condition="Exists('$(DotNetWorkloadPacksInstallLocation)Microsoft.macOS.Sdk\$(DotNetMacOSWorkloadInstalledVersion)\Sdk\AutoImport.props')">true</DotNetMacOSWorkloadIsInstalled>
<IsNetTizenSupported Condition="'$(DotNetTizenWorkloadIsInstalled)' != 'true'">false</IsNetTizenSupported>
<IsNetTVOSSupported Condition="'$(DotNetTVOSWorkloadIsInstalled)' != 'true'">false</IsNetTVOSSupported>
<IsNetMacOSSupported Condition="'$(DotNetMacOSWorkloadIsInstalled)' != 'true'">false</IsNetMacOSSupported>
</PropertyGroup>
<PropertyGroup>
<!-- Disable csc shared compilation to reduce memory usage on CI -->
<UseSharedCompilation>False</UseSharedCompilation>

Просмотреть файл

@ -54,8 +54,8 @@
<PackageReference Include="mdoc" Version="5.8.9" PrivateAssets="All" GeneratePathProperty="true" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
<ItemGroup Condition="'$(TargetFramework)' != '' and $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETCoreApp'">
<Compile Include="$(MSBuildThisFileDirectory)Common\NullableAttributes.generated.cs" Visible="false" />
</ItemGroup>
<!-- HACK: Do not copy the native bootstrap files -->

Просмотреть файл

@ -65,7 +65,7 @@
<ItemGroup>
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="xunit.skippablefact" Version="1.4.13" />
<PackageReference Include="Validation" Version="2.4.22" />

Просмотреть файл

@ -72,8 +72,9 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit.skippablefact" Version="1.3.12" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Просмотреть файл

@ -9,8 +9,9 @@
<SkipCopyToOutputDirectory>true</SkipCopyToOutputDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="XunitXml.TestLogger" Version="2.1.26" />
<PackageReference Include="xunit.skippablefact" Version="1.3.12" />
<PackageReference Include="coverlet.msbuild" Version="3.0.3" />

Просмотреть файл

@ -82,8 +82,9 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit.assemblyfixture" Version="2.0.3" />
<PackageReference Include="xunit.skippablefact" Version="1.3.12" />
<PackageReference Include="SharpVk" Version="0.4.2" />

Просмотреть файл

@ -9,8 +9,9 @@
<SkipCopyToOutputDirectory>true</SkipCopyToOutputDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="XunitXml.TestLogger" Version="2.1.26" />
<PackageReference Include="xunit.skippablefact" Version="1.3.12" />
<PackageReference Include="SharpVk" Version="0.4.2" />

Просмотреть файл

@ -19,9 +19,9 @@
<ItemGroup>
<PackageReference Include="Uno.Wasm.Bootstrap" Version="2.1.0" />
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="2.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
<PackageReference Include="xunit.runner.utility" Version="2.4.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\binding\SkiaSharp\SkiaSharp.csproj" />

Просмотреть файл

@ -85,7 +85,7 @@
<ItemGroup>
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1821" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="xunit.skippablefact" Version="1.4.13" />
<PackageReference Include="Validation" Version="2.4.22" />

Просмотреть файл

@ -117,9 +117,9 @@ namespace SkiaSharp.Tests
{
rgb.ToHsl(out var h, out var s, out var l);
Assert.Equal(other.Item1, h, Precision);
Assert.Equal(other.Item2, s, Precision);
Assert.Equal(other.Item3, l, Precision);
Assert.Equal((double)other.Item1, (double)h, Precision);
Assert.Equal((double)other.Item2, (double)s, Precision);
Assert.Equal((double)other.Item3, (double)l, Precision);
}
[SkippableTheory]
@ -128,10 +128,10 @@ namespace SkiaSharp.Tests
{
var back = SKColorF.FromHsl(other.Item1, other.Item2, other.Item3);
Assert.Equal(rgb.Red, back.Red, Precision);
Assert.Equal(rgb.Green, back.Green, Precision);
Assert.Equal(rgb.Blue, back.Blue, Precision);
Assert.Equal(rgb.Alpha, back.Alpha, Precision);
Assert.Equal((double)rgb.Red, (double)back.Red, Precision);
Assert.Equal((double)rgb.Green, (double)back.Green, Precision);
Assert.Equal((double)rgb.Blue, (double)back.Blue, Precision);
Assert.Equal((double)rgb.Alpha, (double)back.Alpha, Precision);
}
public static IEnumerable<object[]> GetColorRgbToHsvData()
@ -152,9 +152,9 @@ namespace SkiaSharp.Tests
{
rgb.ToHsv(out var h, out var s, out var v);
Assert.Equal(other.Item1, h, Precision);
Assert.Equal(other.Item2, s, Precision);
Assert.Equal(other.Item3, v, Precision);
Assert.Equal((double)other.Item1, (double)h, Precision);
Assert.Equal((double)other.Item2, (double)s, Precision);
Assert.Equal((double)other.Item3, (double)v, Precision);
}
[SkippableTheory]
@ -163,10 +163,10 @@ namespace SkiaSharp.Tests
{
var back = SKColorF.FromHsv(other.Item1, other.Item2, other.Item3);
Assert.Equal(rgb.Red, back.Red, Precision);
Assert.Equal(rgb.Green, back.Green, Precision);
Assert.Equal(rgb.Blue, back.Blue, Precision);
Assert.Equal(rgb.Alpha, back.Alpha, Precision);
Assert.Equal((double)rgb.Red, (double)back.Red, Precision);
Assert.Equal((double)rgb.Green, (double)back.Green, Precision);
Assert.Equal((double)rgb.Blue, (double)back.Blue, Precision);
Assert.Equal((double)rgb.Alpha, (double)back.Alpha, Precision);
}
public static IEnumerable<object[]> GetClampData()

Просмотреть файл

@ -69,9 +69,9 @@ namespace SkiaSharp.Tests
float h, s, l;
rgb.ToHsl(out h, out s, out l);
Assert.Equal(other.Item1, h, Precision);
Assert.Equal(other.Item2, s, Precision);
Assert.Equal(other.Item3, l, Precision);
Assert.Equal((double)other.Item1, (double)h, Precision);
Assert.Equal((double)other.Item2, (double)s, Precision);
Assert.Equal((double)other.Item3, (double)l, Precision);
// to RGB
SKColor back = SKColor.FromHsl(other.Item1, other.Item2, other.Item3);
@ -107,9 +107,9 @@ namespace SkiaSharp.Tests
float h, s, v;
rgb.ToHsv(out h, out s, out v);
Assert.Equal(other.Item1, h, Precision);
Assert.Equal(other.Item2, s, Precision);
Assert.Equal(other.Item3, v, Precision);
Assert.Equal((double)other.Item1, (double)h, Precision);
Assert.Equal((double)other.Item2, (double)s, Precision);
Assert.Equal((double)other.Item3, (double)v, Precision);
// to RGB
SKColor back = SKColor.FromHsv(other.Item1, other.Item2, other.Item3);

Просмотреть файл

@ -240,7 +240,7 @@ namespace SkiaSharp.Tests
var textPath = font.GetTextPath(text, SKPoint.Empty);
var pathWidth = textPath.TightBounds.Width;
Assert.Equal(pathWidth, diff, 2);
Assert.Equal((double)pathWidth, (double)diff, 2);
}
[SkippableFact]

Просмотреть файл

@ -227,8 +227,8 @@ namespace SkiaSharp.Tests
var resultRotateValue = matrixRotate.MapPoint(new SKPoint(5, 25));
Assert.Equal(new SKPoint(0f, 0f), resultRotateZero);
Assert.Equal(0, resultRotateValue.X, PRECISION);
Assert.Equal(25, resultRotateValue.Y, PRECISION);
Assert.Equal((double)0, (double)resultRotateValue.X, PRECISION);
Assert.Equal((double)25, (double)resultRotateValue.Y, PRECISION);
}
[SkippableFact]

Просмотреть файл

@ -235,8 +235,8 @@ namespace SkiaSharp.Tests
var matrix = SKMatrix.CreateRotationDegrees(90);
var newPoint = matrix.MapPoint(point);
Assert.Equal(10, newPoint.X, PRECISION);
Assert.Equal(40, newPoint.Y, PRECISION);
Assert.Equal((double)10, (double)newPoint.X, PRECISION);
Assert.Equal((double)40, (double)newPoint.Y, PRECISION);
}
[Obsolete]

Просмотреть файл

@ -542,7 +542,7 @@ namespace SkiaSharp.Tests
var textPath = paint.GetTextPath(text, 0, 0);
var pathWidth = textPath.TightBounds.Width;
Assert.Equal(pathWidth, diff, 2);
Assert.Equal((double)pathWidth, (double)diff, 2);
}
[SkippableFact]

Просмотреть файл

@ -275,16 +275,16 @@ namespace SkiaSharp.Tests
path.RCubicTo(-34.64102137842175f, 19.9999998f, 0f, 40f, 0f, 40f);
var bounds = path.Bounds;
Assert.Equal(-34.641022f, bounds.Left, Precision);
Assert.Equal(-25.814698f, bounds.Top, Precision);
Assert.Equal(-6.215782e-07f, bounds.Right, Precision);
Assert.Equal(14.185303f, bounds.Bottom, Precision);
Assert.Equal((double)-34.641022f, (double)bounds.Left, Precision);
Assert.Equal((double)-25.814698f, (double)bounds.Top, Precision);
Assert.Equal((double)-6.215782e-07f, (double)bounds.Right, Precision);
Assert.Equal((double)14.185303f, (double)bounds.Bottom, Precision);
var tightBounds = path.TightBounds;
Assert.Equal(-15.396009f, tightBounds.Left, Precision);
Assert.Equal(-25.814698f, tightBounds.Top, Precision);
Assert.Equal(0f, tightBounds.Right, Precision);
Assert.Equal(14.185303f, tightBounds.Bottom, Precision);
Assert.Equal((double)-15.396009f, (double)tightBounds.Left, Precision);
Assert.Equal((double)-25.814698f, (double)tightBounds.Top, Precision);
Assert.Equal((double)0f, (double)tightBounds.Right, Precision);
Assert.Equal((double)14.185303f, (double)tightBounds.Bottom, Precision);
}
}
@ -327,8 +327,8 @@ namespace SkiaSharp.Tests
Assert.Equal(rect.Left, bounds.Left);
Assert.Equal(rect.Top, bounds.Top);
Assert.Equal(rect.Right, bounds.Right, Precision);
Assert.Equal(rect.Bottom, bounds.Bottom, Precision);
Assert.Equal((double)rect.Right, (double)bounds.Right, Precision);
Assert.Equal((double)rect.Bottom, (double)bounds.Bottom, Precision);
}
[SkippableFact]