Browse Source

fix compile issues.

repros/web-null-signature
Dan Walmsley 4 years ago
parent
commit
b5ae0eb36b
  1. 5
      src/Web/Avalonia.Blazor/BlazorSingleViewLifetime.cs
  2. 29
      src/Web/Avalonia.Blazor/BlazorSkiaGpu.cs
  3. 51
      src/Web/Avalonia.Blazor/BlazorSkiaGpuRenderSession.cs
  4. 66
      src/Web/Avalonia.Blazor/BlazorSkiaGpuRenderTarget.cs
  5. 25
      src/Web/Avalonia.Blazor/BlazorSkiaSurface.cs
  6. 245
      src/Web/Avalonia.Blazor/Keycodes.cs
  7. 215
      src/Web/Avalonia.Blazor/RazorViewTopLevelImpl.cs
  8. 2
      src/Web/Avalonia.Blazor/SKTypefaceCollection.cs

5
src/Web/Avalonia.Blazor/BlazorSingleViewLifetime.cs

@ -1,5 +1,4 @@
using Avalonia.Blazor;
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
namespace Avalonia.Blazor
@ -24,4 +23,4 @@ namespace Avalonia.Blazor
return builder;
}
}
}
}

29
src/Web/Avalonia.Blazor/BlazorSkiaGpu.cs

@ -2,25 +2,26 @@ using System.Collections.Generic;
using Avalonia;
using Avalonia.Skia;
namespace Avalonia.Blazor;
public class BlazorSkiaGpu : ISkiaGpu
namespace Avalonia.Blazor
{
public ISkiaGpuRenderTarget? TryCreateRenderTarget(IEnumerable<object> surfaces)
public class BlazorSkiaGpu : ISkiaGpu
{
foreach (var surface in surfaces)
public ISkiaGpuRenderTarget? TryCreateRenderTarget(IEnumerable<object> surfaces)
{
if (surface is BlazorSkiaSurface blazorSkiaSurface)
foreach (var surface in surfaces)
{
return new BlazorSkiaGpuRenderTarget(blazorSkiaSurface);
if (surface is BlazorSkiaSurface blazorSkiaSurface)
{
return new BlazorSkiaGpuRenderTarget(blazorSkiaSurface);
}
}
}
return null;
}
return null;
}
public ISkiaSurface TryCreateSurface(PixelSize size, ISkiaGpuRenderSession session)
{
return null;
public ISkiaSurface TryCreateSurface(PixelSize size, ISkiaGpuRenderSession session)
{
return null;
}
}
}
}

51
src/Web/Avalonia.Blazor/BlazorSkiaGpuRenderSession.cs

@ -1,38 +1,39 @@
using Avalonia.Skia;
using SkiaSharp;
namespace Avalonia.Blazor;
internal class BlazorSkiaGpuRenderSession : ISkiaGpuRenderSession
namespace Avalonia.Blazor
{
private readonly SKSurface _surface;
public BlazorSkiaGpuRenderSession(BlazorSkiaSurface blazorSkiaSurface, GRBackendRenderTarget renderTarget)
internal class BlazorSkiaGpuRenderSession : ISkiaGpuRenderSession
{
_surface = SKSurface.Create(blazorSkiaSurface.Context, renderTarget, blazorSkiaSurface.Origin, blazorSkiaSurface.ColorType);
private readonly SKSurface _surface;
GrContext = blazorSkiaSurface.Context;
ScaleFactor = blazorSkiaSurface.Scaling;
public BlazorSkiaGpuRenderSession(BlazorSkiaSurface blazorSkiaSurface, GRBackendRenderTarget renderTarget)
{
_surface = SKSurface.Create(blazorSkiaSurface.Context, renderTarget, blazorSkiaSurface.Origin, blazorSkiaSurface.ColorType);
SurfaceOrigin = blazorSkiaSurface.Origin;
}
GrContext = blazorSkiaSurface.Context;
public void Dispose()
{
_surface.Flush();
ScaleFactor = blazorSkiaSurface.Scaling;
GrContext.Flush();
_surface.Dispose();
}
SurfaceOrigin = blazorSkiaSurface.Origin;
}
public GRContext GrContext { get; }
public void Dispose()
{
_surface.Flush();
public SKSurface SkSurface => _surface;
public double ScaleFactor { get; }
GrContext.Flush();
public GRSurfaceOrigin SurfaceOrigin { get; }
}
_surface.Dispose();
}
public GRContext GrContext { get; }
public SKSurface SkSurface => _surface;
public double ScaleFactor { get; }
public GRSurfaceOrigin SurfaceOrigin { get; }
}
}

66
src/Web/Avalonia.Blazor/BlazorSkiaGpuRenderTarget.cs

@ -1,47 +1,47 @@
using Avalonia;
using Avalonia.Skia;
using SkiaSharp;
namespace Avalonia.Blazor;
internal class BlazorSkiaGpuRenderTarget : ISkiaGpuRenderTarget
namespace Avalonia.Blazor
{
private readonly GRBackendRenderTarget _renderTarget;
private readonly BlazorSkiaSurface _blazorSkiaSurface;
private readonly PixelSize _size;
public BlazorSkiaGpuRenderTarget(BlazorSkiaSurface blazorSkiaSurface)
internal class BlazorSkiaGpuRenderTarget : ISkiaGpuRenderTarget
{
_size = blazorSkiaSurface.Size;
var glFbInfo = new GRGlFramebufferInfo(blazorSkiaSurface.GlInfo.FboId, blazorSkiaSurface.ColorType.ToGlSizedFormat());
private readonly GRBackendRenderTarget _renderTarget;
private readonly BlazorSkiaSurface _blazorSkiaSurface;
private readonly PixelSize _size;
public BlazorSkiaGpuRenderTarget(BlazorSkiaSurface blazorSkiaSurface)
{
_blazorSkiaSurface = blazorSkiaSurface;
_renderTarget = new GRBackendRenderTarget(
(int)(blazorSkiaSurface.Size.Width * blazorSkiaSurface.Scaling),
(int)(blazorSkiaSurface.Size.Height * blazorSkiaSurface.Scaling),
blazorSkiaSurface.GlInfo.Samples,
blazorSkiaSurface.GlInfo.Stencils, glFbInfo);
_size = blazorSkiaSurface.Size;
var glFbInfo = new GRGlFramebufferInfo(blazorSkiaSurface.GlInfo.FboId, blazorSkiaSurface.ColorType.ToGlSizedFormat());
{
_blazorSkiaSurface = blazorSkiaSurface;
_renderTarget = new GRBackendRenderTarget(
(int)(blazorSkiaSurface.Size.Width * blazorSkiaSurface.Scaling),
(int)(blazorSkiaSurface.Size.Height * blazorSkiaSurface.Scaling),
blazorSkiaSurface.GlInfo.Samples,
blazorSkiaSurface.GlInfo.Stencils, glFbInfo);
}
}
}
public void Dispose()
{
_renderTarget.Dispose();
}
public void Dispose()
{
_renderTarget.Dispose();
}
public ISkiaGpuRenderSession BeginRenderingSession()
{
return new BlazorSkiaGpuRenderSession(_blazorSkiaSurface, _renderTarget);
}
public ISkiaGpuRenderSession BeginRenderingSession()
{
return new BlazorSkiaGpuRenderSession(_blazorSkiaSurface, _renderTarget);
}
public bool IsCorrupted
{
get
public bool IsCorrupted
{
var result = _size.Width != _renderTarget.Width || _size.Height != _renderTarget.Height;
get
{
var result = _size.Width != _renderTarget.Width || _size.Height != _renderTarget.Height;
return result;
return result;
}
}
}
}
}

25
src/Web/Avalonia.Blazor/BlazorSkiaSurface.cs

@ -2,19 +2,20 @@ using Avalonia;
using Avalonia.Blazor.Interop;
using SkiaSharp;
namespace Avalonia.Blazor;
internal class BlazorSkiaSurface
namespace Avalonia.Blazor
{
public SKColorType ColorType { get; set; }
public PixelSize Size { get; set; }
internal class BlazorSkiaSurface
{
public SKColorType ColorType { get; set; }
public PixelSize Size { get; set; }
public GRContext Context { get; set; }
public GRContext Context { get; set; }
public GRSurfaceOrigin Origin { get; set; }
public GRSurfaceOrigin Origin { get; set; }
public double Scaling { get; set; }
public double Scaling { get; set; }
public SKHtmlCanvasInterop.GLInfo GlInfo { get; set; }
}
public SKHtmlCanvasInterop.GLInfo GlInfo { get; set; }
}
}

245
src/Web/Avalonia.Blazor/Keycodes.cs

@ -1,127 +1,128 @@
using System.Collections.Generic;
using Avalonia.Input;
namespace Avalonia.Blazor;
internal static class Keycodes
namespace Avalonia.Blazor
{
public static Dictionary<string, Key> KeyCodes = new()
internal static class Keycodes
{
{ "Escape", Key.Escape },
{ "Digit1", Key.D1 },
{ "Digit2", Key.D2 },
{ "Digit3", Key.D3 },
{ "Digit4", Key.D4 },
{ "Digit5", Key.D5 },
{ "Digit6", Key.D6 },
{ "Digit7", Key.D7 },
{ "Digit8", Key.D8 },
{ "Digit9", Key.D9 },
{ "Digit0", Key.D0 },
{ "Minus", Key.OemMinus },
//{ "Equal" , Key. },
{ "Backspace", Key.Back },
{ "Tab", Key.Tab },
{ "KeyQ", Key.Q },
{ "KeyW", Key.W },
{ "KeyE", Key.E },
{ "KeyR", Key.R },
{ "KeyT", Key.T },
{ "KeyY", Key.Y },
{ "KeyU", Key.U },
{ "KeyI", Key.I },
{ "KeyO", Key.O },
{ "KeyP", Key.P },
{ "BracketLeft", Key.OemOpenBrackets },
{ "BracketRight", Key.OemCloseBrackets },
{ "Enter", Key.Enter },
{ "ControlLeft", Key.LeftCtrl },
{ "KeyA", Key.A },
{ "KeyS", Key.S },
{ "KeyD", Key.D },
{ "KeyF", Key.F },
{ "KeyG", Key.G },
{ "KeyH", Key.H },
{ "KeyJ", Key.J },
{ "KeyK", Key.K },
{ "KeyL", Key.L },
{ "Semicolon", Key.OemSemicolon },
{ "Quote", Key.OemQuotes },
//{ "Backquote" , Key. },
{ "ShiftLeft", Key.LeftShift },
{ "Backslash", Key.OemBackslash },
{ "KeyZ", Key.Z },
{ "KeyX", Key.X },
{ "KeyC", Key.C },
{ "KeyV", Key.V },
{ "KeyB", Key.B },
{ "KeyN", Key.N },
{ "KeyM", Key.M },
{ "Comma", Key.OemComma },
{ "Period", Key.OemPeriod },
//{ "Slash" , Key. },
{ "ShiftRight", Key.RightShift },
{ "NumpadMultiply", Key.Multiply },
{ "AltLeft", Key.LeftAlt },
{ "Space", Key.Space },
{ "CapsLock", Key.CapsLock },
{ "F1", Key.F1 },
{ "F2", Key.F2 },
{ "F3", Key.F3 },
{ "F4", Key.F4 },
{ "F5", Key.F5 },
{ "F6", Key.F6 },
{ "F7", Key.F7 },
{ "F8", Key.F8 },
{ "F9", Key.F9 },
{ "F10", Key.F10 },
{ "NumLock", Key.NumLock },
{ "ScrollLock", Key.Scroll },
{ "Numpad7", Key.NumPad7 },
{ "Numpad8", Key.NumPad8 },
{ "Numpad9", Key.NumPad9 },
{ "NumpadSubtract", Key.Subtract },
{ "Numpad4", Key.NumPad4 },
{ "Numpad5", Key.NumPad5 },
{ "Numpad6", Key.NumPad6 },
{ "NumpadAdd", Key.Add },
{ "Numpad1", Key.NumPad1 },
{ "Numpad2", Key.NumPad2 },
{ "Numpad3", Key.NumPad3 },
{ "Numpad0", Key.NumPad0 },
{ "NumpadDecimal", Key.Decimal },
{ "Unidentified", Key.NoName },
//{ "IntlBackslash" , Key.bac },
{ "F11", Key.F11 },
{ "F12", Key.F12 },
//{ "IntlRo" , Key.Ro },
//{ "Unidentified" , Key. },
{ "Convert", Key.ImeConvert },
{ "KanaMode", Key.KanaMode },
{ "NonConvert", Key.ImeNonConvert },
//{ "Unidentified" , Key. },
{ "NumpadEnter", Key.Enter },
{ "ControlRight", Key.RightCtrl },
{ "NumpadDivide", Key.Divide },
{ "PrintScreen", Key.PrintScreen },
{ "AltRight", Key.RightAlt },
//{ "Unidentified" , Key. },
{ "Home", Key.Home },
{ "ArrowUp", Key.Up },
{ "PageUp", Key.PageUp },
{ "ArrowLeft", Key.Left },
{ "ArrowRight", Key.Right },
{ "End", Key.End },
{ "ArrowDown", Key.Down },
{ "PageDown", Key.PageDown },
{ "Insert", Key.Insert },
{ "Delete", Key.Delete },
//{ "Unidentified" , Key. },
{ "AudioVolumeMute", Key.VolumeMute },
{ "AudioVolumeDown", Key.VolumeDown },
{ "AudioVolumeUp", Key.VolumeUp },
//{ "NumpadEqual" , Key. },
{ "Pause", Key.Pause },
{ "NumpadComma", Key.OemComma }
};
}
public static Dictionary<string, Key> KeyCodes = new()
{
{ "Escape", Key.Escape },
{ "Digit1", Key.D1 },
{ "Digit2", Key.D2 },
{ "Digit3", Key.D3 },
{ "Digit4", Key.D4 },
{ "Digit5", Key.D5 },
{ "Digit6", Key.D6 },
{ "Digit7", Key.D7 },
{ "Digit8", Key.D8 },
{ "Digit9", Key.D9 },
{ "Digit0", Key.D0 },
{ "Minus", Key.OemMinus },
//{ "Equal" , Key. },
{ "Backspace", Key.Back },
{ "Tab", Key.Tab },
{ "KeyQ", Key.Q },
{ "KeyW", Key.W },
{ "KeyE", Key.E },
{ "KeyR", Key.R },
{ "KeyT", Key.T },
{ "KeyY", Key.Y },
{ "KeyU", Key.U },
{ "KeyI", Key.I },
{ "KeyO", Key.O },
{ "KeyP", Key.P },
{ "BracketLeft", Key.OemOpenBrackets },
{ "BracketRight", Key.OemCloseBrackets },
{ "Enter", Key.Enter },
{ "ControlLeft", Key.LeftCtrl },
{ "KeyA", Key.A },
{ "KeyS", Key.S },
{ "KeyD", Key.D },
{ "KeyF", Key.F },
{ "KeyG", Key.G },
{ "KeyH", Key.H },
{ "KeyJ", Key.J },
{ "KeyK", Key.K },
{ "KeyL", Key.L },
{ "Semicolon", Key.OemSemicolon },
{ "Quote", Key.OemQuotes },
//{ "Backquote" , Key. },
{ "ShiftLeft", Key.LeftShift },
{ "Backslash", Key.OemBackslash },
{ "KeyZ", Key.Z },
{ "KeyX", Key.X },
{ "KeyC", Key.C },
{ "KeyV", Key.V },
{ "KeyB", Key.B },
{ "KeyN", Key.N },
{ "KeyM", Key.M },
{ "Comma", Key.OemComma },
{ "Period", Key.OemPeriod },
//{ "Slash" , Key. },
{ "ShiftRight", Key.RightShift },
{ "NumpadMultiply", Key.Multiply },
{ "AltLeft", Key.LeftAlt },
{ "Space", Key.Space },
{ "CapsLock", Key.CapsLock },
{ "F1", Key.F1 },
{ "F2", Key.F2 },
{ "F3", Key.F3 },
{ "F4", Key.F4 },
{ "F5", Key.F5 },
{ "F6", Key.F6 },
{ "F7", Key.F7 },
{ "F8", Key.F8 },
{ "F9", Key.F9 },
{ "F10", Key.F10 },
{ "NumLock", Key.NumLock },
{ "ScrollLock", Key.Scroll },
{ "Numpad7", Key.NumPad7 },
{ "Numpad8", Key.NumPad8 },
{ "Numpad9", Key.NumPad9 },
{ "NumpadSubtract", Key.Subtract },
{ "Numpad4", Key.NumPad4 },
{ "Numpad5", Key.NumPad5 },
{ "Numpad6", Key.NumPad6 },
{ "NumpadAdd", Key.Add },
{ "Numpad1", Key.NumPad1 },
{ "Numpad2", Key.NumPad2 },
{ "Numpad3", Key.NumPad3 },
{ "Numpad0", Key.NumPad0 },
{ "NumpadDecimal", Key.Decimal },
{ "Unidentified", Key.NoName },
//{ "IntlBackslash" , Key.bac },
{ "F11", Key.F11 },
{ "F12", Key.F12 },
//{ "IntlRo" , Key.Ro },
//{ "Unidentified" , Key. },
{ "Convert", Key.ImeConvert },
{ "KanaMode", Key.KanaMode },
{ "NonConvert", Key.ImeNonConvert },
//{ "Unidentified" , Key. },
{ "NumpadEnter", Key.Enter },
{ "ControlRight", Key.RightCtrl },
{ "NumpadDivide", Key.Divide },
{ "PrintScreen", Key.PrintScreen },
{ "AltRight", Key.RightAlt },
//{ "Unidentified" , Key. },
{ "Home", Key.Home },
{ "ArrowUp", Key.Up },
{ "PageUp", Key.PageUp },
{ "ArrowLeft", Key.Left },
{ "ArrowRight", Key.Right },
{ "End", Key.End },
{ "ArrowDown", Key.Down },
{ "PageDown", Key.PageDown },
{ "Insert", Key.Insert },
{ "Delete", Key.Delete },
//{ "Unidentified" , Key. },
{ "AudioVolumeMute", Key.VolumeMute },
{ "AudioVolumeDown", Key.VolumeDown },
{ "AudioVolumeUp", Key.VolumeUp },
//{ "NumpadEqual" , Key. },
{ "Pause", Key.Pause },
{ "NumpadComma", Key.OemComma }
};
}
}

215
src/Web/Avalonia.Blazor/RazorViewTopLevelImpl.cs

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Avalonia;
using Avalonia.Blazor;
using Avalonia.Blazor.Interop;
using Avalonia.Controls;
using Avalonia.Controls.Platform;
@ -13,153 +9,154 @@ using Avalonia.Platform;
using Avalonia.Rendering;
using SkiaSharp;
namespace Avalonia.Blazor;
internal class RazorViewTopLevelImpl : ITopLevelImplWithTextInputMethod
namespace Avalonia.Blazor
{
private Size _clientSize;
private BlazorSkiaSurface? _currentSurface;
private IInputRoot? _inputRoot;
private Stopwatch _sw = Stopwatch.StartNew();
private readonly ITextInputMethodImpl _textInputMethod;
public RazorViewTopLevelImpl(ITextInputMethodImpl textInputMethod)
internal class RazorViewTopLevelImpl : ITopLevelImplWithTextInputMethod
{
_textInputMethod = textInputMethod;
}
private Size _clientSize;
private BlazorSkiaSurface? _currentSurface;
private IInputRoot? _inputRoot;
private Stopwatch _sw = Stopwatch.StartNew();
private readonly ITextInputMethodImpl _textInputMethod;
public ulong Timestamp => (ulong)_sw.ElapsedMilliseconds;
public RazorViewTopLevelImpl(ITextInputMethodImpl textInputMethod)
{
_textInputMethod = textInputMethod;
}
public ulong Timestamp => (ulong)_sw.ElapsedMilliseconds;
internal void SetSurface(GRContext context, SKHtmlCanvasInterop.GLInfo glInfo, SKColorType colorType, PixelSize size, double scaling)
{
_currentSurface = new BlazorSkiaSurface
{
Context = context,
GlInfo = glInfo,
ColorType = colorType,
Size = size,
Scaling = scaling,
Origin = GRSurfaceOrigin.BottomLeft
};
}
public void SetClientSize(SKSize size, double dpi)
{
var newSize = new Size(size.Width, size.Height);
internal void SetSurface(GRContext context, SKHtmlCanvasInterop.GLInfo glInfo, SKColorType colorType, PixelSize size, double scaling)
{
_currentSurface = new BlazorSkiaSurface
{
Context = context,
GlInfo = glInfo,
ColorType = colorType,
Size = size,
Scaling = scaling,
Origin = GRSurfaceOrigin.BottomLeft
};
}
if (newSize != _clientSize)
public void SetClientSize(SKSize size, double dpi)
{
_clientSize = newSize;
var newSize = new Size(size.Width, size.Height);
if (_currentSurface is { })
if (newSize != _clientSize)
{
_currentSurface.Size = new PixelSize((int)(size.Width), (int)(size.Height));
}
_clientSize = newSize;
Resized?.Invoke(newSize, PlatformResizeReason.User);
if (_currentSurface is { })
{
_currentSurface.Size = new PixelSize((int)(size.Width), (int)(size.Height));
}
Resized?.Invoke(newSize, PlatformResizeReason.User);
}
}
}
public void RawMouseEvent(RawPointerEventType type, Point p, RawInputModifiers modifiers)
{
if (_inputRoot is { })
public void RawMouseEvent(RawPointerEventType type, Point p, RawInputModifiers modifiers)
{
Input?.Invoke(new RawPointerEventArgs(MouseDevice, Timestamp, _inputRoot, type, p, modifiers));
if (_inputRoot is { })
{
Input?.Invoke(new RawPointerEventArgs(MouseDevice, Timestamp, _inputRoot, type, p, modifiers));
}
}
}
public void RawMouseWheelEvent( Point p, Vector v, RawInputModifiers modifiers)
{
if (_inputRoot is { })
public void RawMouseWheelEvent(Point p, Vector v, RawInputModifiers modifiers)
{
Input?.Invoke(new RawMouseWheelEventArgs(MouseDevice, Timestamp, _inputRoot, p, v, modifiers));
if (_inputRoot is { })
{
Input?.Invoke(new RawMouseWheelEventArgs(MouseDevice, Timestamp, _inputRoot, p, v, modifiers));
}
}
}
public void RawKeyboardEvent (RawKeyEventType type, string key, RawInputModifiers modifiers)
{
if (Keycodes.KeyCodes.TryGetValue(key, out var avkey))
public void RawKeyboardEvent(RawKeyEventType type, string key, RawInputModifiers modifiers)
{
if (_inputRoot is { })
if (Keycodes.KeyCodes.TryGetValue(key, out var avkey))
{
Input?.Invoke(new RawKeyEventArgs(KeyboardDevice, Timestamp, _inputRoot, type, avkey, modifiers));
if (_inputRoot is { })
{
Input?.Invoke(new RawKeyEventArgs(KeyboardDevice, Timestamp, _inputRoot, type, avkey, modifiers));
}
}
}
}
public void RawTextEvent(string text)
{
if (_inputRoot is { })
public void RawTextEvent(string text)
{
Input?.Invoke(new RawTextInputEventArgs(KeyboardDevice, Timestamp, _inputRoot, text));
if (_inputRoot is { })
{
Input?.Invoke(new RawTextInputEventArgs(KeyboardDevice, Timestamp, _inputRoot, text));
}
}
}
public void Dispose()
{
public void Dispose()
{
}
}
public IRenderer CreateRenderer(IRenderRoot root)
{
var loop = AvaloniaLocator.Current.GetService<IRenderLoop>();
public IRenderer CreateRenderer(IRenderRoot root)
{
var loop = AvaloniaLocator.Current.GetService<IRenderLoop>();
return new DeferredRenderer(root, loop);
}
return new DeferredRenderer(root, loop);
}
public void Invalidate(Rect rect)
{
//Console.WriteLine("invalidate rect called");
}
public void Invalidate(Rect rect)
{
//Console.WriteLine("invalidate rect called");
}
public void SetInputRoot(IInputRoot inputRoot)
{
_inputRoot = inputRoot;
}
public void SetInputRoot(IInputRoot inputRoot)
{
_inputRoot = inputRoot;
}
public Point PointToClient(PixelPoint point) => new Point(point.X, point.Y);
public Point PointToClient(PixelPoint point) => new Point(point.X, point.Y);
public PixelPoint PointToScreen(Point point) => new PixelPoint((int)point.X, (int)point.Y);
public PixelPoint PointToScreen(Point point) => new PixelPoint((int)point.X, (int)point.Y);
public void SetCursor(ICursorImpl cursor)
{
// nop
}
public void SetCursor(ICursorImpl cursor)
{
// nop
public IPopupImpl CreatePopup()
{
return null;
}
}
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel)
{
public IPopupImpl CreatePopup()
{
return null;
}
}
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel)
{
}
public Size ClientSize => _clientSize;
public Size? FrameSize => null;
public double RenderScaling => 1;
public Size ClientSize => _clientSize;
public Size? FrameSize => null;
public double RenderScaling => 1;
public IEnumerable<object> Surfaces => new[] { _currentSurface };
public IEnumerable<object> Surfaces => new[] { _currentSurface };
internal BlazorSkiaSurface Surface => _currentSurface;
internal BlazorSkiaSurface Surface => _currentSurface;
public Action<RawInputEventArgs> Input { get; set; }
public Action<Rect> Paint { get; set; }
public Action<Size, PlatformResizeReason> Resized { get; set; }
public Action<double> ScalingChanged { get; set; }
public Action<WindowTransparencyLevel> TransparencyLevelChanged { get; set; }
public Action Closed { get; set; }
public Action LostFocus { get; set; }
public IMouseDevice MouseDevice { get; } = new MouseDevice();
public Action<RawInputEventArgs> Input { get; set; }
public Action<Rect> Paint { get; set; }
public Action<Size, PlatformResizeReason> Resized { get; set; }
public Action<double> ScalingChanged { get; set; }
public Action<WindowTransparencyLevel> TransparencyLevelChanged { get; set; }
public Action Closed { get; set; }
public Action LostFocus { get; set; }
public IMouseDevice MouseDevice { get; } = new MouseDevice();
public IKeyboardDevice KeyboardDevice { get; } = BlazorWindowingPlatform.Keyboard;
public WindowTransparencyLevel TransparencyLevel { get; }
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels { get; }
public IKeyboardDevice KeyboardDevice { get; } = BlazorWindowingPlatform.Keyboard;
public WindowTransparencyLevel TransparencyLevel { get; }
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels { get; }
public ITextInputMethodImpl TextInputMethod => _textInputMethod;
}
public ITextInputMethodImpl TextInputMethod => _textInputMethod;
}
}

2
src/Web/Avalonia.Blazor/SKTypefaceCollection.cs

@ -1,6 +1,4 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Media;
using SkiaSharp;

Loading…
Cancel
Save