A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
828 B

using System;
using Avalonia.Metal;
using CoreAnimation;
namespace Avalonia.iOS;
internal class MetalDrawingSession : IMetalPlatformSurfaceRenderingSession
{
private readonly MetalDevice _device;
private readonly ICAMetalDrawable _drawable;
public MetalDrawingSession(MetalDevice device, ICAMetalDrawable drawable, PixelSize size, double scaling)
{
_device = device;
_drawable = drawable;
Size = size;
Scaling = scaling;
Texture = _drawable.Texture.Handle;
}
public void Dispose()
{
var buffer = _device.Queue.CommandBuffer();
buffer.PresentDrawable(_drawable);
buffer.Commit();
}
public IntPtr Texture { get; }
public PixelSize Size { get; }
public double Scaling { get; }
public bool IsYFlipped => false;
}