Skip to content

Commit

Permalink
Adding the hight performance skia
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Jun 7, 2024
1 parent 6c8b174 commit 0cc1def
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions X11/UnoInk/UnoHacker/SkiaVisual.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.UI.Composition;
using Microsoft.UI.Xaml;

using SkiaSharp;

using Uno.UI.Composition;

namespace Uno.Skia;

public class SkiaVisual : Visual
{
public static SkiaVisual CreateAndInsertTo(UIElement element)
{
var visual = element.Visual;
var skiaVisual = new SkiaVisual(visual.Compositor);
visual.Children.InsertAtBottom(skiaVisual);
return skiaVisual;
}

private SkiaVisual(Compositor compositor) : base(compositor)
{
}

internal override void Draw(in DrawingSession session)
{
OnDraw?.Invoke(this, session.Surface);
}

public event EventHandler<SKSurface>? OnDraw;
}

0 comments on commit 0cc1def

Please sign in to comment.