Skip to content

Commit

Permalink
fix: WPF points to SkiaWpfIslands, default to Unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
mcNets authored and MartinZikmund committed Dec 12, 2024
1 parent 9e08db8 commit f1cf07b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/Uno.UI.Runtime.Skia.Wpf/WpfHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public WpfHost(Dispatcher dispatcher, Func<WinUIApplication> appBuilder)
_dispatcher = dispatcher;
_appBuilder = appBuilder;

PlatformRuntimeHelper.SkiaPlatform = UnoRuntimePlatform.SkiaWpf;
PlatformRuntimeHelper.SkiaPlatform = UnoRuntimePlatform.SkiaWpfIslands;
}

internal WpfHost(Func<WinUIApplication> appBuilder, Func<WpfApplication>? wpfAppBuilder)
Expand All @@ -45,7 +45,7 @@ internal WpfHost(Func<WinUIApplication> appBuilder, Func<WpfApplication>? wpfApp
_dispatcher = _wpfApp.Dispatcher;
_appBuilder = appBuilder;

PlatformRuntimeHelper.SkiaPlatform = UnoRuntimePlatform.SkiaWpf;
PlatformRuntimeHelper.SkiaPlatform = UnoRuntimePlatform.SkiaWpfIslands;
}

internal static WpfHost? Current => _current;
Expand Down
2 changes: 2 additions & 0 deletions src/Uno.UI.Runtime.Skia.X11/X11ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ static X11ApplicationHost()
}
}

PlatformRuntimeHelper.SkiaPlatform = UnoRuntimePlatform.SkiaX11;

ApiExtensibility.Register(typeof(Uno.ApplicationModel.Core.ICoreApplicationExtension), _ => new X11CoreApplicationExtension());
ApiExtensibility.Register(typeof(Windows.UI.ViewManagement.IApplicationViewExtension), o => new X11ApplicationViewExtension(o));
ApiExtensibility.Register(typeof(Windows.Graphics.Display.IDisplayInformationExtension), o => new X11DisplayInformationExtension(o, null));
Expand Down
7 changes: 3 additions & 4 deletions src/Uno.UI.Toolkit/UnoRuntimePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

public enum UnoRuntimePlatform
{
Unknown,
Android,
iOS,
MacCatalyst,
MacOSX,
WebAssembly,
Windows,
Skia,
SkiaGtk,
SkiaWpf,
SkiaWpfIslands,
SkiaX11,
SkiaFrameBuffer,
SkiaMacOS,
Unknown
SkiaMacOS
}
2 changes: 1 addition & 1 deletion src/Uno.UI/Helpers/PlatformRuntimeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Uno.UI.Helpers;

public static class PlatformRuntimeHelper
{
internal static UnoRuntimePlatform SkiaPlatform { get; set; } = UnoRuntimePlatform.Skia;
internal static UnoRuntimePlatform SkiaPlatform { get; set; } = UnoRuntimePlatform.Unknown;

public static UnoRuntimePlatform Current => GetPlatform();

Expand Down
7 changes: 3 additions & 4 deletions src/Uno.UI/Helpers/UnoRuntimePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ namespace Uno.UI.Helpers;

public enum UnoRuntimePlatform
{
Unknown,
Android,
iOS,
MacCatalyst,
MacOSX,
WebAssembly,
Windows,
Skia,
SkiaGtk,
SkiaWpf,
SkiaWpfIslands,
SkiaX11,
SkiaFrameBuffer,
SkiaMacOS,
Unknown
SkiaMacOS
}
43 changes: 9 additions & 34 deletions src/Uno.UI/Helpers/Xaml/UnoRuntimePlatformExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,12 @@ namespace Uno.UI.Helpers;

internal static class UnoRuntimePlatformExtensions
{
public static bool IsSkia(UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.SkiaFrameBuffer
|| platform == UnoRuntimePlatform.SkiaGtk
|| platform == UnoRuntimePlatform.SkiaMacOS
|| platform == UnoRuntimePlatform.SkiaWpf
|| platform == UnoRuntimePlatform.SkiaX11;
}

public static bool IsAndroid(this UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.Android;
}

public static bool IsiOS(this UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.iOS;
}

public static bool IsMacCatalyst(this UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.MacCatalyst;
}

public static bool IsMacOS(this UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.MacOSX;
}

public static bool IsWebAssembly(this UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.WebAssembly;
}
}
public static bool IsSkia(UnoRuntimePlatform platform)
{
return platform == UnoRuntimePlatform.SkiaFrameBuffer
|| platform == UnoRuntimePlatform.SkiaGtk
|| platform == UnoRuntimePlatform.SkiaMacOS
|| platform == UnoRuntimePlatform.SkiaWpfIslands
|| platform == UnoRuntimePlatform.SkiaX11;
}
}

0 comments on commit f1cf07b

Please sign in to comment.