Skip to content

Commit d1a302c

Browse files
committed
feat: HW acceleration on Skia.iOS
1 parent 265ac96 commit d1a302c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Uno.UI.Runtime.Skia.AppleUIKit/UI/Xaml/RootViewController.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Uno.UI.Runtime.Skia.AppleUIKit;
2020

2121
internal class RootViewController : UINavigationController, IRotationAwareViewController, IAppleUIKitXamlRootHost
2222
{
23-
private SKCanvasView? _skCanvasView;
23+
private SKMetalView? _skCanvasView;
2424
private XamlRoot? _xamlRoot;
2525
private UIView? _textInputLayer;
2626
private UIView? _nativeOverlayLayer;
@@ -57,7 +57,9 @@ public RootViewController(NativeHandle handle)
5757
public void Initialize()
5858
{
5959
_textInputLayer = new UIView();
60-
_skCanvasView = new SKCanvasView();
60+
_skCanvasView = new SKMetalView();
61+
_skCanvasView.Paused = false;
62+
_skCanvasView.EnableSetNeedsDisplay = false;
6163
_skCanvasView.BackgroundColor = UIColor.Red;
6264
_skCanvasView.Frame = View!.Bounds;
6365
_skCanvasView.AutoresizingMask = UIViewAutoresizing.All;
@@ -89,7 +91,7 @@ public void Initialize()
8991

9092
public SKColor BackgroundColor { get; set; } = SKColors.White;
9193

92-
private void OnPaintSurface(object? sender, SKPaintSurfaceEventArgs e)
94+
private void OnPaintSurface(object? sender, SKPaintMetalSurfaceEventArgs e)
9395
{
9496
if (_xamlRoot?.VisualTree.RootElement is { } rootElement)
9597
{

0 commit comments

Comments
 (0)