зеркало из https://github.com/mono/SkiaSharp.git
Never dispose the native statics (#1863)
This commit is contained in:
Родитель
65fdb4ec3f
Коммит
b87980d971
|
@ -265,10 +265,11 @@ namespace SkiaSharp
|
|||
private sealed class SKColorSpaceStatic : SKColorSpace
|
||||
{
|
||||
internal SKColorSpaceStatic (IntPtr x)
|
||||
: base (x, true)
|
||||
: base (x, false)
|
||||
{
|
||||
IgnorePublicDispose = true;
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,10 +301,11 @@ namespace SkiaSharp
|
|||
private sealed class SKDataStatic : SKData
|
||||
{
|
||||
internal SKDataStatic (IntPtr x)
|
||||
: base (x, true)
|
||||
: base (x, false)
|
||||
{
|
||||
IgnorePublicDispose = true;
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,10 +202,11 @@ namespace SkiaSharp
|
|||
private sealed class SKFontManagerStatic : SKFontManager
|
||||
{
|
||||
internal SKFontManagerStatic (IntPtr x)
|
||||
: base (x, true)
|
||||
: base (x, false)
|
||||
{
|
||||
IgnorePublicDispose = true;
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,9 @@ namespace SkiaSharp
|
|||
internal SKFontStyleStatic (SKFontStyleWeight weight, SKFontStyleWidth width, SKFontStyleSlant slant)
|
||||
: base (weight, width, slant)
|
||||
{
|
||||
IgnorePublicDispose = true;
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -458,10 +458,11 @@ namespace SkiaSharp
|
|||
private sealed class SKTypefaceStatic : SKTypeface
|
||||
{
|
||||
internal SKTypefaceStatic (IntPtr x)
|
||||
: base (x, true)
|
||||
: base (x, false)
|
||||
{
|
||||
IgnorePublicDispose = true;
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,6 +204,8 @@ Task ("tests-netfx")
|
|||
|
||||
void RunDesktopTest (string arch)
|
||||
{
|
||||
if (Skip(arch)) return;
|
||||
|
||||
RunMSBuild ("./tests/SkiaSharp.Desktop.Tests.sln", platform: arch == "AnyCPU" ? "Any CPU" : arch);
|
||||
|
||||
// SkiaSharp.Tests.dll
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace SkiaSharp.Tests
|
|||
public static IEnumerable<object[]> InteropDelegatesData =>
|
||||
InteropDelegates.Select(m => new object[] { m });
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableFact]
|
||||
public void DelegateTypesAreValid()
|
||||
{
|
||||
|
@ -59,6 +60,7 @@ namespace SkiaSharp.Tests
|
|||
Assert.NotEmpty(del);
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(InteropDelegatesData))]
|
||||
public void DelegateTypesHaveAttributes(Type delegateType)
|
||||
|
@ -66,6 +68,7 @@ namespace SkiaSharp.Tests
|
|||
Assert.NotNull(delegateType.GetCustomAttribute<UnmanagedFunctionPointerAttribute>());
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(InteropMembersData))]
|
||||
public void ApiTypesAreNotInvalid(MethodInfo method, string delegateName)
|
||||
|
@ -89,6 +92,7 @@ namespace SkiaSharp.Tests
|
|||
}
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(InteropMembersData))]
|
||||
public void ApiReturnTypesArePrimitives(MethodInfo method, string delegateName)
|
||||
|
@ -115,6 +119,7 @@ namespace SkiaSharp.Tests
|
|||
}
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(InteropMembersData))]
|
||||
public void ApiTypesAreMarshalledCorrectly(MethodInfo method, string delegateName)
|
||||
|
@ -187,6 +192,7 @@ namespace SkiaSharp.Tests
|
|||
}
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableTheory]
|
||||
// too old
|
||||
[InlineData("80.0", "0.0", "[80.0, 81.0)")]
|
||||
|
@ -230,24 +236,28 @@ namespace SkiaSharp.Tests
|
|||
}
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableFact]
|
||||
public void TestLibraryVersions()
|
||||
{
|
||||
Assert.True(SkiaSharpVersion.CheckNativeLibraryCompatible());
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableFact]
|
||||
public void TestLibraryVersionsDoesNotThrow()
|
||||
{
|
||||
SkiaSharpVersion.CheckNativeLibraryCompatible(true);
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableFact]
|
||||
public void TestVersionsString()
|
||||
{
|
||||
Assert.Equal(SkiaSharpVersion.Native.ToString(2), SkiaSharpVersion.NativeString);
|
||||
}
|
||||
|
||||
[Trait(CategoryKey, ApiCategory)]
|
||||
[SkippableFact]
|
||||
public void PlatformConfigurationIsMuslOverrideCanBeFoundViaReflection()
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace SkiaSharp.Tests
|
|||
{
|
||||
protected const string CategoryKey = "Category";
|
||||
|
||||
protected const string ApiCategory = "API";
|
||||
protected const string GpuCategory = "GPU";
|
||||
protected const string MatchCharacterCategory = "MatchCharacter";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче