You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a minimal example that repeats the bug. This is my MainView.cs
public partial class MainView : UserControl {
public MainView() {
InitializeComponent();
Dispatcher.UIThread.Post(
() => {
using (DrawingContext context = ViewModel.Bitmap.CreateDrawingContext()) {
context.Custom(new CustomDrawOperation());
}
Image.InvalidateVisual();
},
DispatcherPriority.ApplicationIdle);
}
MainViewModel ViewModel => (MainViewModel)DataContext!;
public override void EndInit() {
base.EndInit();
}
public class CustomDrawOperation : ICustomDrawOperation {
static CustomDrawOperation() {
string sksl = """
half4 main(vec2 fragCoord) {
return vec4(0,0,0,255);
}
""";
string error;
var runtimeEffect = SKRuntimeEffect.Create(sksl, out error);
var shader = runtimeEffect.ToShader(false);
paint = new SKPaint {
Shader = shader,
};
}
private static SKPaint paint;
public Rect Bounds { get; }
public void Dispose() {
}
public bool Equals(ICustomDrawOperation? other) {
return ReferenceEquals(this, other);
}
public bool HitTest(Point p) {
return Bounds.Contains(p);
}
public void Render(ImmediateDrawingContext context) {
var skiaFeature = context.TryGetFeature(typeof(ISkiaSharpApiLeaseFeature)) as ISkiaSharpApiLeaseFeature;
if (skiaFeature == null) { return; }
using (var lease = skiaFeature.Lease()) {
SKCanvas canvas = lease.SkCanvas;
canvas.DrawPaint(paint); \\ SEHException occurs here
}
}
}
The error code of SEHException is -2147467259, which is 0x80004005. In Common HRESULT Values, it's E_FAIL, Unspecified failure. I have no idea what's happening.
Please download the zip file for more detail. AvaloniaApplication2.zip
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I made a minimal example that repeats the bug. This is my MainView.cs
The error code of SEHException is -2147467259, which is 0x80004005. In Common HRESULT Values, it's E_FAIL, Unspecified failure. I have no idea what's happening.
Please download the zip file for more detail.
AvaloniaApplication2.zip
Beta Was this translation helpful? Give feedback.
All reactions