Skip to content

Commit

Permalink
Remove enable drawing on unix switch (#64084)
Browse files Browse the repository at this point in the history
* Remove enable drawing on unix switch

* Update some tests and not run tests that need Drawing on non Windows

* PR Feedback, just turn off the switch
  • Loading branch information
safern authored Jan 21, 2022
1 parent 35482cb commit 7ed266e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,34 +87,8 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly()
return !(bool)typeof(LambdaExpression).GetMethod("get_CanCompileToIL").Invoke(null, Array.Empty<object>());
}

// Please make sure that you have the libgdiplus dependency installed.
// For details, see https://docs.microsoft.com/dotnet/core/install/dependencies?pivots=os-macos&tabs=netcore31#libgdiplus
public static bool IsDrawingSupported
{
get
{
#if NETCOREAPP
if (!IsWindows)
{
if (IsMobile)
{
return false;
}
else if (IsOSX)
{
return NativeLibrary.TryLoad("libgdiplus.dylib", out _);
}
else
{
return NativeLibrary.TryLoad("libgdiplus.so", out _) || NativeLibrary.TryLoad("libgdiplus.so.0", out _);
}
}
#endif

return IsNotWindowsNanoServer && IsNotWindowsServerCore;

}
}
// Drawing is not supported on non windows platforms in .NET 7.0+.
public static bool IsDrawingSupported => IsWindows && IsNotWindowsNanoServer && IsNotWindowsServerCore;

public static bool IsAsyncFileIOSupported => !IsBrowser && !(IsWindows && IsMonoRuntime); // https://github.com/dotnet/runtime/issues/34582

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ namespace System
{
internal static partial class LocalAppContextSwitches
{
private static int s_enableUnixSupport;
public static bool EnableUnixSupport
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
return GetCachedSwitchValue(@"System.Drawing.EnableUnixSupport", ref s_enableUnixSupport);
}
get => false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net48</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;net48</TargetFrameworks>
<IgnoreForCI Condition="'$(TargetsMobile)' == 'true'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
Expand Down

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

0 comments on commit 7ed266e

Please sign in to comment.