From b445ea9d68a060b57157add6a93296f5838c7b00 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 29 May 2023 22:34:57 +0600 Subject: [PATCH] Borking changes --- nukebuild/RefAssemblyGenerator.cs | 10 ++ .../ControlCatalog.NetCore.csproj | 1 + .../InvalidationAwareSurfaceView.cs | 2 +- src/Avalonia.Base/AvaloniaLocator.cs | 4 + src/Avalonia.Base/Input/DragDropDevice.cs | 2 + src/Avalonia.Base/Input/IInputDevice.cs | 2 +- src/Avalonia.Base/Input/IInputManager.cs | 2 +- .../Input/IKeyboardNavigationHandler.cs | 1 + src/Avalonia.Base/Input/InputManager.cs | 2 +- .../Input/KeyboardNavigationHandler.cs | 5 +- src/Avalonia.Base/Input/Raw/RawDragEvent.cs | 2 + .../Input/Raw/RawInputEventArgs.cs | 2 + .../Input/Raw/RawKeyEventArgs.cs | 3 + .../Input/Raw/RawMouseWheelEventArgs.cs | 3 + .../Input/Raw/RawPointerEventArgs.cs | 3 + .../Input/Raw/RawPointerGestureEventArgs.cs | 3 + .../Input/Raw/RawSizeEventArgs.cs | 2 + .../Input/Raw/RawTextInputEventArgs.cs | 3 + .../Input/Raw/RawTouchEventArgs.cs | 2 + src/Avalonia.Base/Media/Brush.cs | 2 +- src/Avalonia.Base/Media/DrawingBrush.cs | 2 +- src/Avalonia.Base/Media/VisualBrush.cs | 2 +- .../Metadata/PrivateApiAttribute.cs | 2 +- .../Platform/IModuleEnvironmentChecker.cs | 7 -- .../Platform/IPlatformThreadingInterface.cs | 2 +- src/Avalonia.Base/Platform/IRenderTarget.cs | 2 + .../Platform/Interop/IDynamicLibraryLoader.cs | 1 - .../Platform/Interop/Utf8Buffer.cs | 2 +- .../Rendering/DefaultRenderTimer.cs | 2 + src/Avalonia.Base/Rendering/DirtyRects.cs | 87 --------------- src/Avalonia.Base/Rendering/DirtyVisuals.cs | 104 ------------------ .../Rendering/DisplayDirtyRect.cs | 51 --------- .../Rendering/DisplayDirtyRects.cs | 62 ----------- .../Rendering/IDeferredRendererLock.cs | 11 -- src/Avalonia.Base/Rendering/IRenderTimer.cs | 2 +- .../Rendering/IVisualBrushInitialize.cs | 2 +- .../Rendering/ManagedDeferredRendererLock.cs | 11 -- .../Rendering/SceneInvalidatedEventArgs.cs | 2 +- .../Rendering/SleepLoopRenderTimer.cs | 2 + .../Rendering/UiThreadRenderTimer.cs | 2 + .../VisualTree/IVisualWithRoundRectClip.cs | 5 +- src/Avalonia.Controls/Application.cs | 18 +-- .../Platform/INativeApplicationCommands.cs | 2 +- .../Platform/IPlatformNativeSurfaceHandle.cs | 2 +- .../ManagedPopupPositioner.cs | 4 + .../ManagedPopupPositionerPopupImplHelper.cs | 2 + .../Diagnostics/Controls/Application.cs | 9 -- src/Avalonia.X11/X11Window.cs | 2 +- .../Output/DrmBindings.cs | 2 +- .../Output/DrmOutput.cs | 1 + .../Avalonia.Direct2D1.csproj | 2 +- .../Avalonia.Direct2D1/Direct2DChecker.cs | 24 ---- .../Avalonia.Win32/WindowImpl.AppWndProc.cs | 14 +-- src/Windows/Avalonia.Win32/WindowImpl.cs | 4 +- tests/Avalonia.UnitTests/NullRenderer.cs | 7 +- 55 files changed, 90 insertions(+), 422 deletions(-) delete mode 100644 src/Avalonia.Base/Platform/IModuleEnvironmentChecker.cs delete mode 100644 src/Avalonia.Base/Rendering/DirtyRects.cs delete mode 100644 src/Avalonia.Base/Rendering/DirtyVisuals.cs delete mode 100644 src/Avalonia.Base/Rendering/DisplayDirtyRect.cs delete mode 100644 src/Avalonia.Base/Rendering/DisplayDirtyRects.cs delete mode 100644 src/Avalonia.Base/Rendering/IDeferredRendererLock.cs delete mode 100644 src/Avalonia.Base/Rendering/ManagedDeferredRendererLock.cs delete mode 100644 src/Windows/Avalonia.Direct2D1/Direct2DChecker.cs diff --git a/nukebuild/RefAssemblyGenerator.cs b/nukebuild/RefAssemblyGenerator.cs index dc96849fe7..54e428c442 100644 --- a/nukebuild/RefAssemblyGenerator.cs +++ b/nukebuild/RefAssemblyGenerator.cs @@ -123,6 +123,16 @@ public class RefAssemblyGenerator } } + foreach (var cl in type.NestedTypes) + { + ProcessType(cl, obsoleteCtor); + if (hideMembers) + { + var dflags = TypeAttributes.Public; + cl.Attributes = ((cl.Attributes | dflags) ^ dflags) | TypeAttributes.NotPublic; + } + } + foreach (var m in type.Properties) MarkAsUnstable(m, obsoleteCtor, forceUnstable); foreach (var m in type.Events) diff --git a/samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj b/samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj index 877d475fb6..37719b77d8 100644 --- a/samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj +++ b/samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj @@ -16,6 +16,7 @@ + diff --git a/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs b/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs index 47297a4f76..3fb78591bc 100644 --- a/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs +++ b/src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs @@ -10,7 +10,7 @@ using Avalonia.Platform; namespace Avalonia.Android { - internal abstract class InvalidationAwareSurfaceView : SurfaceView, ISurfaceHolderCallback, IPlatformNativeSurfaceHandle + internal abstract class InvalidationAwareSurfaceView : SurfaceView, ISurfaceHolderCallback, INativePlatformHandleSurface { bool _invalidateQueued; readonly object _lock = new object(); diff --git a/src/Avalonia.Base/AvaloniaLocator.cs b/src/Avalonia.Base/AvaloniaLocator.cs index 8ec245507b..1fd266cca3 100644 --- a/src/Avalonia.Base/AvaloniaLocator.cs +++ b/src/Avalonia.Base/AvaloniaLocator.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; +using Avalonia.Metadata; #pragma warning disable CS1591 // Enable me later namespace Avalonia { + [PrivateApi] public class AvaloniaLocator : IAvaloniaDependencyResolver { private readonly IAvaloniaDependencyResolver? _parentScope; @@ -114,11 +116,13 @@ namespace Avalonia } } + [PrivateApi] public interface IAvaloniaDependencyResolver { object? GetService(Type t); } + [PrivateApi] public static class LocatorExtensions { public static T? GetService(this IAvaloniaDependencyResolver resolver) diff --git a/src/Avalonia.Base/Input/DragDropDevice.cs b/src/Avalonia.Base/Input/DragDropDevice.cs index 04d4693352..5ad20111fc 100644 --- a/src/Avalonia.Base/Input/DragDropDevice.cs +++ b/src/Avalonia.Base/Input/DragDropDevice.cs @@ -2,9 +2,11 @@ using Avalonia.VisualTree; using System.Linq; using Avalonia.Input.Raw; +using Avalonia.Metadata; namespace Avalonia.Input { + [PrivateApi] public class DragDropDevice : IDragDropDevice { public static readonly DragDropDevice Instance = new DragDropDevice(); diff --git a/src/Avalonia.Base/Input/IInputDevice.cs b/src/Avalonia.Base/Input/IInputDevice.cs index fe4f584f18..658b87c6b2 100644 --- a/src/Avalonia.Base/Input/IInputDevice.cs +++ b/src/Avalonia.Base/Input/IInputDevice.cs @@ -3,7 +3,7 @@ using Avalonia.Metadata; namespace Avalonia.Input { - [NotClientImplementable] + [NotClientImplementable, PrivateApi] public interface IInputDevice { /// diff --git a/src/Avalonia.Base/Input/IInputManager.cs b/src/Avalonia.Base/Input/IInputManager.cs index 658226a519..fc18799e7a 100644 --- a/src/Avalonia.Base/Input/IInputManager.cs +++ b/src/Avalonia.Base/Input/IInputManager.cs @@ -8,7 +8,7 @@ namespace Avalonia.Input /// Receives input from the windowing subsystem and dispatches it to interested parties /// for processing. /// - [NotClientImplementable] + [NotClientImplementable, PrivateApi] public interface IInputManager { /// diff --git a/src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs b/src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs index 3bcd6d6206..6ab0031f31 100644 --- a/src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs +++ b/src/Avalonia.Base/Input/IKeyboardNavigationHandler.cs @@ -15,6 +15,7 @@ namespace Avalonia.Input /// /// This method can only be called once, typically by the owner itself on creation. /// + [PrivateApi] void SetOwner(IInputRoot owner); /// diff --git a/src/Avalonia.Base/Input/InputManager.cs b/src/Avalonia.Base/Input/InputManager.cs index e87665fd54..c9b1751b2a 100644 --- a/src/Avalonia.Base/Input/InputManager.cs +++ b/src/Avalonia.Base/Input/InputManager.cs @@ -8,7 +8,7 @@ namespace Avalonia.Input /// Receives input from the windowing subsystem and dispatches it to interested parties /// for processing. /// - public class InputManager : IInputManager + internal class InputManager : IInputManager { private readonly LightweightSubject _preProcess = new(); private readonly LightweightSubject _process = new(); diff --git a/src/Avalonia.Base/Input/KeyboardNavigationHandler.cs b/src/Avalonia.Base/Input/KeyboardNavigationHandler.cs index 7a83501ce4..d979acbdf4 100644 --- a/src/Avalonia.Base/Input/KeyboardNavigationHandler.cs +++ b/src/Avalonia.Base/Input/KeyboardNavigationHandler.cs @@ -10,7 +10,7 @@ namespace Avalonia.Input /// Handles keyboard navigation for a window. /// [Unstable] - public class KeyboardNavigationHandler : IKeyboardNavigationHandler + public sealed class KeyboardNavigationHandler : IKeyboardNavigationHandler { /// /// The window to which the handler belongs. @@ -24,6 +24,7 @@ namespace Avalonia.Input /// /// This method can only be called once, typically by the owner itself on creation. /// + [PrivateApi] public void SetOwner(IInputRoot owner) { if (_owner != null) @@ -102,7 +103,7 @@ namespace Avalonia.Input /// /// The event sender. /// The event args. - protected virtual void OnKeyDown(object? sender, KeyEventArgs e) + void OnKeyDown(object? sender, KeyEventArgs e) { if (e.Key == Key.Tab) { diff --git a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs index c903aad684..8ade3d8af5 100644 --- a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs +++ b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs @@ -1,7 +1,9 @@ using System; +using Avalonia.Metadata; namespace Avalonia.Input.Raw { + [PrivateApi] public class RawDragEvent : RawInputEventArgs { public Point Location { get; set; } diff --git a/src/Avalonia.Base/Input/Raw/RawInputEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawInputEventArgs.cs index cf4d37b6da..fa1953de50 100644 --- a/src/Avalonia.Base/Input/Raw/RawInputEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawInputEventArgs.cs @@ -1,4 +1,5 @@ using System; +using Avalonia.Metadata; namespace Avalonia.Input.Raw { @@ -11,6 +12,7 @@ namespace Avalonia.Input.Raw /// pre-processing they are consumed by the relevant and turned into /// standard Avalonia events. /// + [PrivateApi] public class RawInputEventArgs : EventArgs { /// diff --git a/src/Avalonia.Base/Input/Raw/RawKeyEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawKeyEventArgs.cs index 6ed073d006..b80d09e420 100644 --- a/src/Avalonia.Base/Input/Raw/RawKeyEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawKeyEventArgs.cs @@ -1,3 +1,5 @@ +using Avalonia.Metadata; + namespace Avalonia.Input.Raw { public enum RawKeyEventType @@ -6,6 +8,7 @@ namespace Avalonia.Input.Raw KeyUp } + [PrivateApi] public class RawKeyEventArgs : RawInputEventArgs { public RawKeyEventArgs( diff --git a/src/Avalonia.Base/Input/Raw/RawMouseWheelEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawMouseWheelEventArgs.cs index a752275980..e370ca3708 100644 --- a/src/Avalonia.Base/Input/Raw/RawMouseWheelEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawMouseWheelEventArgs.cs @@ -1,6 +1,9 @@ +using Avalonia.Metadata; + namespace Avalonia.Input.Raw { + [PrivateApi] public class RawMouseWheelEventArgs : RawPointerEventArgs { public RawMouseWheelEventArgs( diff --git a/src/Avalonia.Base/Input/Raw/RawPointerEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawPointerEventArgs.cs index ebedc9e6e8..595f4c0c66 100644 --- a/src/Avalonia.Base/Input/Raw/RawPointerEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawPointerEventArgs.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Avalonia.Metadata; namespace Avalonia.Input.Raw { @@ -31,6 +32,7 @@ namespace Avalonia.Input.Raw /// /// A raw mouse event. /// + [PrivateApi] public class RawPointerEventArgs : RawInputEventArgs { private RawPointerPoint _point; @@ -124,6 +126,7 @@ namespace Avalonia.Input.Raw internal IInputElement? InputHitTestResult { get; set; } } + [PrivateApi] public record struct RawPointerPoint { /// diff --git a/src/Avalonia.Base/Input/Raw/RawPointerGestureEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawPointerGestureEventArgs.cs index 5a6dbda9a7..379ca65ea8 100644 --- a/src/Avalonia.Base/Input/Raw/RawPointerGestureEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawPointerGestureEventArgs.cs @@ -1,5 +1,8 @@ +using Avalonia.Metadata; + namespace Avalonia.Input.Raw { + [PrivateApi] public class RawPointerGestureEventArgs : RawPointerEventArgs { public RawPointerGestureEventArgs( diff --git a/src/Avalonia.Base/Input/Raw/RawSizeEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawSizeEventArgs.cs index b6a364eab9..a0eb5934eb 100644 --- a/src/Avalonia.Base/Input/Raw/RawSizeEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawSizeEventArgs.cs @@ -1,7 +1,9 @@ using System; +using Avalonia.Metadata; namespace Avalonia.Input.Raw { + [PrivateApi] public class RawSizeEventArgs : EventArgs { public RawSizeEventArgs(Size size) diff --git a/src/Avalonia.Base/Input/Raw/RawTextInputEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawTextInputEventArgs.cs index cd1cf29bcf..3ecbf24bdd 100644 --- a/src/Avalonia.Base/Input/Raw/RawTextInputEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawTextInputEventArgs.cs @@ -1,5 +1,8 @@ +using Avalonia.Metadata; + namespace Avalonia.Input.Raw { + [PrivateApi] public class RawTextInputEventArgs : RawInputEventArgs { public RawTextInputEventArgs( diff --git a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs index 3e842e6e3f..7adab89d2e 100644 --- a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs @@ -1,7 +1,9 @@ using System; +using Avalonia.Metadata; namespace Avalonia.Input.Raw { + [PrivateApi] public class RawTouchEventArgs : RawPointerEventArgs { public RawTouchEventArgs(IInputDevice device, ulong timestamp, IInputRoot root, diff --git a/src/Avalonia.Base/Media/Brush.cs b/src/Avalonia.Base/Media/Brush.cs index 3c888d13cf..986e3221e6 100644 --- a/src/Avalonia.Base/Media/Brush.cs +++ b/src/Avalonia.Base/Media/Brush.cs @@ -118,7 +118,7 @@ namespace Avalonia.Media OnReferencedFromCompositor(c); } - protected virtual void OnReferencedFromCompositor(Compositor c) + private protected virtual void OnReferencedFromCompositor(Compositor c) { if (Transform is ICompositionRenderResource resource) resource.AddRefOnCompositor(c); diff --git a/src/Avalonia.Base/Media/DrawingBrush.cs b/src/Avalonia.Base/Media/DrawingBrush.cs index f324c02536..b710351b98 100644 --- a/src/Avalonia.Base/Media/DrawingBrush.cs +++ b/src/Avalonia.Base/Media/DrawingBrush.cs @@ -60,7 +60,7 @@ namespace Avalonia.Media private InlineDictionary _renderDataDictionary; - protected override void OnReferencedFromCompositor(Compositor c) + private protected override void OnReferencedFromCompositor(Compositor c) { _renderDataDictionary.Add(c, CreateServerContent(c)); base.OnReferencedFromCompositor(c); diff --git a/src/Avalonia.Base/Media/VisualBrush.cs b/src/Avalonia.Base/Media/VisualBrush.cs index 2b604d684f..15d4f39d6c 100644 --- a/src/Avalonia.Base/Media/VisualBrush.cs +++ b/src/Avalonia.Base/Media/VisualBrush.cs @@ -64,7 +64,7 @@ namespace Avalonia.Media private InlineDictionary _renderDataDictionary; - protected override void OnReferencedFromCompositor(Compositor c) + private protected override void OnReferencedFromCompositor(Compositor c) { _renderDataDictionary.Add(c, CreateServerContent(c)); base.OnReferencedFromCompositor(c); diff --git a/src/Avalonia.Base/Metadata/PrivateApiAttribute.cs b/src/Avalonia.Base/Metadata/PrivateApiAttribute.cs index 70f24f815a..8246d4a18d 100644 --- a/src/Avalonia.Base/Metadata/PrivateApiAttribute.cs +++ b/src/Avalonia.Base/Metadata/PrivateApiAttribute.cs @@ -3,7 +3,7 @@ using System; namespace Avalonia.Metadata; [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Constructor - | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)] + | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Struct)] public sealed class PrivateApiAttribute : Attribute { diff --git a/src/Avalonia.Base/Platform/IModuleEnvironmentChecker.cs b/src/Avalonia.Base/Platform/IModuleEnvironmentChecker.cs deleted file mode 100644 index d8d3a19af6..0000000000 --- a/src/Avalonia.Base/Platform/IModuleEnvironmentChecker.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Avalonia.Platform -{ - public interface IModuleEnvironmentChecker - { - bool IsCompatible { get; } - } -} \ No newline at end of file diff --git a/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs b/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs index 4fe4a2e6b9..71b339ec50 100644 --- a/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs +++ b/src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs @@ -8,7 +8,7 @@ namespace Avalonia.Platform /// /// Provides platform-specific services relating to threading. /// - [Unstable] + [PrivateApi] public interface IPlatformThreadingInterface { /// diff --git a/src/Avalonia.Base/Platform/IRenderTarget.cs b/src/Avalonia.Base/Platform/IRenderTarget.cs index 31ad84341d..2b4584483e 100644 --- a/src/Avalonia.Base/Platform/IRenderTarget.cs +++ b/src/Avalonia.Base/Platform/IRenderTarget.cs @@ -1,4 +1,5 @@ using System; +using Avalonia.Metadata; using Avalonia.Rendering; namespace Avalonia.Platform @@ -9,6 +10,7 @@ namespace Avalonia.Platform /// /// The interface used for obtaining drawing context from surfaces you can render on. /// + [PrivateApi] public interface IRenderTarget : IDisposable { /// diff --git a/src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs b/src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs index d9db4b71d5..56c50e340d 100644 --- a/src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs +++ b/src/Avalonia.Base/Platform/Interop/IDynamicLibraryLoader.cs @@ -3,7 +3,6 @@ using Avalonia.Metadata; namespace Avalonia.Platform.Interop { - [Unstable] public interface IDynamicLibraryLoader { IntPtr LoadLibrary(string dll); diff --git a/src/Avalonia.Base/Platform/Interop/Utf8Buffer.cs b/src/Avalonia.Base/Platform/Interop/Utf8Buffer.cs index 7a0b5b34cd..8fef283b58 100644 --- a/src/Avalonia.Base/Platform/Interop/Utf8Buffer.cs +++ b/src/Avalonia.Base/Platform/Interop/Utf8Buffer.cs @@ -5,7 +5,7 @@ using System.Text; namespace Avalonia.Platform.Interop { - public class Utf8Buffer : SafeHandle + internal class Utf8Buffer : SafeHandle { private GCHandle _gcHandle; private byte[]? _data; diff --git a/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs b/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs index 7b0fecf675..74c8bd107a 100644 --- a/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs @@ -1,4 +1,5 @@ using System; +using Avalonia.Metadata; using Avalonia.Platform; namespace Avalonia.Rendering @@ -10,6 +11,7 @@ namespace Avalonia.Rendering /// This class may be overridden by platform implementations to use a specialized timer /// implementation. /// + [PrivateApi] public class DefaultRenderTimer : IRenderTimer { private IRuntimePlatform? _runtime; diff --git a/src/Avalonia.Base/Rendering/DirtyRects.cs b/src/Avalonia.Base/Rendering/DirtyRects.cs deleted file mode 100644 index 610163191d..0000000000 --- a/src/Avalonia.Base/Rendering/DirtyRects.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -namespace Avalonia.Rendering -{ - /// - /// Tracks dirty rectangles. - /// - internal class DirtyRects : IEnumerable - { - private List _rects = new List(); - - /// - /// Gets a value indicating whether the collection of dirty rectangles is empty. - /// - public bool IsEmpty => _rects.Count == 0; - - /// - /// Adds a dirty rectangle, extending an existing dirty rectangle if it intersects. - /// - /// The dirt rectangle. - /// - /// We probably want to do this more intelligently because: - /// - Adding e.g. the top left quarter of a scene and the bottom left quarter of a scene - /// will cause the whole scene to be invalidated if they overlap by a single pixel - /// - Adding two adjacent rectangles that don't overlap will not cause them to be - /// coalesced - /// - It only coalesces the first intersecting rectangle found - one needs to - /// call at the end of the draw cycle to coalesce the rest. - /// - public void Add(Rect rect) - { - if (rect.Width != 0 || rect.Height != 0) - { - for (var i = 0; i < _rects.Count; ++i) - { - var r = _rects[i]; - - if (r.Intersects(rect)) - { - _rects[i] = r.Union(rect); - return; - } - } - - _rects.Add(rect); - } - } - - /// - /// Works around our flimsy dirt-rect coalescing algorithm. - /// - /// - /// See the comments in . - /// - public void Coalesce() - { - for (var i = _rects.Count - 1; i >= 0; --i) - { - var a = _rects[i]; - - for (var j = 0; j < i; ++j) - { - var b = _rects[j]; - - if (i < _rects.Count && a.Intersects(b)) - { - _rects[i] = _rects[i].Union(b); - _rects.RemoveAt(i); - } - } - } - } - - /// - /// Gets the dirty rectangles. - /// - /// A collection of dirty rectangles - public IEnumerator GetEnumerator() => _rects.GetEnumerator(); - - /// - /// Gets the dirty rectangles. - /// - /// A collection of dirty rectangles - IEnumerator IEnumerable.GetEnumerator() => _rects.GetEnumerator(); - } -} diff --git a/src/Avalonia.Base/Rendering/DirtyVisuals.cs b/src/Avalonia.Base/Rendering/DirtyVisuals.cs deleted file mode 100644 index dfadbdf614..0000000000 --- a/src/Avalonia.Base/Rendering/DirtyVisuals.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Avalonia.VisualTree; - -namespace Avalonia.Rendering -{ - /// - /// Stores a list of dirty visuals for an . - /// - /// - /// This class stores the dirty visuals for a scene, ordered by their distance to the root - /// visual. TODO: We probably want to put an upper limit on the number of visuals that can be - /// stored and if we reach that limit, assume all visuals are dirty. - /// - internal class DirtyVisuals : IEnumerable - { - private SortedDictionary> _inner = new SortedDictionary>(); - private Dictionary _index = new Dictionary(); - private int _enumerating; - - /// - /// Gets the number of dirty visuals. - /// - public int Count => _index.Count; - - /// - /// Adds a visual to the dirty list. - /// - /// The dirty visual. - public void Add(Visual visual) - { - if (_enumerating > 0) - { - throw new InvalidOperationException("Visual was invalidated during a render pass"); - } - - var distance = visual.CalculateDistanceFromAncestor((Visual?)visual.GetVisualRoot()); - - if (_index.TryGetValue(visual, out var existingDistance)) - { - if (distance == existingDistance) - { - return; - } - - _inner[existingDistance].Remove(visual); - _index.Remove(visual); - } - - if (!_inner.TryGetValue(distance, out var list)) - { - list = new List(); - _inner.Add(distance, list); - } - - list.Add(visual); - _index.Add(visual, distance); - } - - /// - /// Clears the list. - /// - public void Clear() - { - if (_enumerating > 0) - { - throw new InvalidOperationException("Cannot clear while enumerating"); - } - - _inner.Clear(); - _index.Clear(); - } - - /// - /// Gets the dirty visuals, in ascending order of distance to their root. - /// - /// A collection of visuals. - public IEnumerator GetEnumerator() - { - _enumerating++; - try - { - foreach (var i in _inner) - { - foreach (var j in i.Value) - { - yield return j; - } - } - } - finally - { - _enumerating--; - } - } - - /// - /// Gets the dirty visuals, in ascending order of distance to their root. - /// - /// A collection of visuals. - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } -} diff --git a/src/Avalonia.Base/Rendering/DisplayDirtyRect.cs b/src/Avalonia.Base/Rendering/DisplayDirtyRect.cs deleted file mode 100644 index 7a89e5b3cc..0000000000 --- a/src/Avalonia.Base/Rendering/DisplayDirtyRect.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace Avalonia.Rendering -{ - /// - /// Holds the state for a dirty rect rendered when is set. - /// - internal class DisplayDirtyRect - { - public static readonly TimeSpan TimeToLive = TimeSpan.FromMilliseconds(250); - - /// - /// Initializes a new instance of the class. - /// - /// The dirt rect. - public DisplayDirtyRect(Rect rect) - { - Rect = rect; - ResetLifetime(); - } - - /// - /// Gets the bounds of the dirty rectangle. - /// - public Rect Rect { get; } - - /// - /// Gets the time at which the rectangle was made dirty. - /// - public DateTimeOffset Born { get; private set; } - - /// - /// Gets the time at which the rectangle should no longer be displayed. - /// - public DateTimeOffset Dies { get; private set; } - - /// - /// Gets the opacity at which to display the dirty rectangle. - /// - public double Opacity => (Dies - DateTimeOffset.UtcNow).TotalMilliseconds / TimeToLive.TotalMilliseconds; - - /// - /// Resets the rectangle's lifetime. - /// - public void ResetLifetime() - { - Born = DateTimeOffset.UtcNow; - Dies = Born + TimeToLive; - } - } -} diff --git a/src/Avalonia.Base/Rendering/DisplayDirtyRects.cs b/src/Avalonia.Base/Rendering/DisplayDirtyRects.cs deleted file mode 100644 index 2ffc1b4118..0000000000 --- a/src/Avalonia.Base/Rendering/DisplayDirtyRects.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Avalonia.Rendering -{ - /// - /// Holds a collection of objects and manages their aging. - /// - internal class DisplayDirtyRects : IEnumerable - { - private List _inner = new List(); - - /// - /// Adds new new dirty rect to the collection. - /// - /// - public void Add(Rect rect) - { - foreach (var r in _inner) - { - if (r.Rect == rect) - { - r.ResetLifetime(); - return; - } - } - - _inner.Add(new DisplayDirtyRect(rect)); - } - - /// - /// Removes dirty rects one they are no longer active. - /// - public void Tick() - { - var now = DateTimeOffset.UtcNow; - - for (var i = _inner.Count - 1; i >= 0; --i) - { - var r = _inner[i]; - - if (now > r.Dies) - { - _inner.RemoveAt(i); - } - } - } - - /// - /// Gets the dirty rects. - /// - /// A collection of objects. - public IEnumerator GetEnumerator() => _inner.GetEnumerator(); - - /// - /// Gets the dirty rects. - /// - /// A collection of objects. - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } -} diff --git a/src/Avalonia.Base/Rendering/IDeferredRendererLock.cs b/src/Avalonia.Base/Rendering/IDeferredRendererLock.cs deleted file mode 100644 index 1c6bd69158..0000000000 --- a/src/Avalonia.Base/Rendering/IDeferredRendererLock.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using Avalonia.Metadata; - -namespace Avalonia.Rendering -{ - [Unstable] - public interface IDeferredRendererLock - { - IDisposable? TryLock(); - } -} diff --git a/src/Avalonia.Base/Rendering/IRenderTimer.cs b/src/Avalonia.Base/Rendering/IRenderTimer.cs index 14fcffd6a9..396e84d492 100644 --- a/src/Avalonia.Base/Rendering/IRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/IRenderTimer.cs @@ -6,7 +6,7 @@ namespace Avalonia.Rendering /// /// Defines the interface implemented by an application render timer. /// - [NotClientImplementable] + [PrivateApi] public interface IRenderTimer { /// diff --git a/src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs b/src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs index b5ab8ed0bd..227e6c1f1f 100644 --- a/src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs +++ b/src/Avalonia.Base/Rendering/IVisualBrushInitialize.cs @@ -8,7 +8,7 @@ namespace Avalonia.Rendering /// . /// [Unstable] - public interface IVisualBrushInitialize + internal interface IVisualBrushInitialize { /// /// Ensures that the control is ready to use as the visual in a visual brush. diff --git a/src/Avalonia.Base/Rendering/ManagedDeferredRendererLock.cs b/src/Avalonia.Base/Rendering/ManagedDeferredRendererLock.cs deleted file mode 100644 index 0397a32bfd..0000000000 --- a/src/Avalonia.Base/Rendering/ManagedDeferredRendererLock.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Threading; -using Avalonia.Utilities; - -namespace Avalonia.Rendering -{ - internal class ManagedDeferredRendererLock : DisposableLock, IDeferredRendererLock - { - - } -} diff --git a/src/Avalonia.Base/Rendering/SceneInvalidatedEventArgs.cs b/src/Avalonia.Base/Rendering/SceneInvalidatedEventArgs.cs index cac4d1693a..fcccd9c752 100644 --- a/src/Avalonia.Base/Rendering/SceneInvalidatedEventArgs.cs +++ b/src/Avalonia.Base/Rendering/SceneInvalidatedEventArgs.cs @@ -5,7 +5,7 @@ namespace Avalonia.Rendering /// /// Provides data for the event. /// - public class SceneInvalidatedEventArgs : EventArgs + internal class SceneInvalidatedEventArgs : EventArgs { /// /// Initializes a new instance of the class. diff --git a/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs b/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs index cd43a3ef20..3ad4ea94d0 100644 --- a/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs @@ -1,9 +1,11 @@ using System; using System.Diagnostics; using System.Threading; +using Avalonia.Metadata; namespace Avalonia.Rendering { + [PrivateApi] public class SleepLoopRenderTimer : IRenderTimer { private Action? _tick; diff --git a/src/Avalonia.Base/Rendering/UiThreadRenderTimer.cs b/src/Avalonia.Base/Rendering/UiThreadRenderTimer.cs index c50f8870a0..06dc34c10a 100644 --- a/src/Avalonia.Base/Rendering/UiThreadRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/UiThreadRenderTimer.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using Avalonia.Metadata; using Avalonia.Reactive; using Avalonia.Threading; @@ -8,6 +9,7 @@ namespace Avalonia.Rendering /// /// Render timer that ticks on UI thread. Useful for debugging or bootstrapping on new platforms /// + [PrivateApi] public class UiThreadRenderTimer : DefaultRenderTimer { /// diff --git a/src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs b/src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs index 0079515a63..d85f50b591 100644 --- a/src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs +++ b/src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs @@ -3,14 +3,11 @@ using System.ComponentModel; namespace Avalonia.VisualTree { - [Obsolete("Internal API, will be removed in future versions, you've been warned"), EditorBrowsable(EditorBrowsableState.Never)] - public interface IVisualWithRoundRectClip + internal interface IVisualWithRoundRectClip { /// /// Gets a value indicating the corner radius of control's clip bounds /// - [Obsolete("Internal API, will be removed in future versions, you've been warned"), EditorBrowsable(EditorBrowsableState.Never)] CornerRadius ClipToBoundsRadius { get; } - } } diff --git a/src/Avalonia.Controls/Application.cs b/src/Avalonia.Controls/Application.cs index f266aebcb4..b98ad123f1 100644 --- a/src/Avalonia.Controls/Application.cs +++ b/src/Avalonia.Controls/Application.cs @@ -118,25 +118,13 @@ namespace Avalonia /// public DataTemplates DataTemplates => _dataTemplates ?? (_dataTemplates = new DataTemplates()); - /// - /// Gets the application's focus manager. - /// - /// - /// The application's focus manager. - /// - public IFocusManager? FocusManager - { - get; - private set; - } - /// /// Gets the application's input manager. /// /// /// The application's input manager. /// - public InputManager? InputManager + internal InputManager? InputManager { get; private set; @@ -238,7 +226,7 @@ namespace Avalonia public virtual void RegisterServices() { AvaloniaSynchronizationContext.InstallIfNeeded(); - FocusManager = new FocusManager(); + var focusManager = new FocusManager(); InputManager = new InputManager(); var settings = AvaloniaLocator.Current.GetRequiredService(); @@ -250,7 +238,7 @@ namespace Avalonia .Bind().ToConstant(this) .Bind().ToConstant(this) .Bind().ToConstant(this) - .Bind().ToConstant(FocusManager) + .Bind().ToConstant(focusManager) .Bind().ToConstant(InputManager) .Bind().ToTransient() .Bind().ToConstant(DragDropDevice.Instance); diff --git a/src/Avalonia.Controls/Platform/INativeApplicationCommands.cs b/src/Avalonia.Controls/Platform/INativeApplicationCommands.cs index 6720b8aa2c..d837e4155e 100644 --- a/src/Avalonia.Controls/Platform/INativeApplicationCommands.cs +++ b/src/Avalonia.Controls/Platform/INativeApplicationCommands.cs @@ -3,7 +3,7 @@ namespace Avalonia.Controls.Platform /// /// Native Menu Default Application Commands /// - public interface INativeApplicationCommands + internal interface INativeApplicationCommands { void HideApp(); void ShowAll(); diff --git a/src/Avalonia.Controls/Platform/IPlatformNativeSurfaceHandle.cs b/src/Avalonia.Controls/Platform/IPlatformNativeSurfaceHandle.cs index 6ad07b1b13..068ee39e84 100644 --- a/src/Avalonia.Controls/Platform/IPlatformNativeSurfaceHandle.cs +++ b/src/Avalonia.Controls/Platform/IPlatformNativeSurfaceHandle.cs @@ -4,7 +4,7 @@ using Avalonia.Metadata; namespace Avalonia.Platform { [Unstable] - public interface IPlatformNativeSurfaceHandle : IPlatformHandle + public interface INativePlatformHandleSurface : IPlatformHandle { PixelSize Size { get; } double Scaling { get; } diff --git a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs index 9a60725c7e..f1a5159069 100644 --- a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs +++ b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositioner.cs @@ -2,9 +2,11 @@ using System; using System.Collections.Generic; using System.Linq; using System.Transactions; +using Avalonia.Metadata; namespace Avalonia.Controls.Primitives.PopupPositioning { + [PrivateApi] public interface IManagedPopupPositionerPopup { IReadOnlyList Screens { get; } @@ -13,6 +15,7 @@ namespace Avalonia.Controls.Primitives.PopupPositioning void MoveAndResize(Point devicePoint, Size virtualSize); } + [PrivateApi] public class ManagedPopupPositionerScreenInfo { public Rect Bounds { get; } @@ -29,6 +32,7 @@ namespace Avalonia.Controls.Primitives.PopupPositioning /// An implementation for platforms on which a popup can be /// arbitrarily positioned. /// + [PrivateApi] public class ManagedPopupPositioner : IPopupPositioner { private readonly IManagedPopupPositionerPopup _popup; diff --git a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs index 51a21323d9..41a2a98fd3 100644 --- a/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs +++ b/src/Avalonia.Controls/Primitives/PopupPositioning/ManagedPopupPositionerPopupImplHelper.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Avalonia.Metadata; using Avalonia.Platform; namespace Avalonia.Controls.Primitives.PopupPositioning @@ -8,6 +9,7 @@ namespace Avalonia.Controls.Primitives.PopupPositioning /// /// This class is used to simplify integration of IPopupImpl implementations with popup positioner /// + [PrivateApi] public class ManagedPopupPositionerPopupImplHelper : IManagedPopupPositionerPopup { private readonly IWindowBaseImpl _parent; diff --git a/src/Avalonia.Diagnostics/Diagnostics/Controls/Application.cs b/src/Avalonia.Diagnostics/Diagnostics/Controls/Application.cs index 0791815120..06dbb7d50e 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/Controls/Application.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/Controls/Application.cs @@ -59,15 +59,6 @@ namespace Avalonia.Diagnostics.Controls public Avalonia.Controls.Templates.DataTemplates DataTemplates => _application.DataTemplates; - /// - /// Gets the application's focus manager. - /// - /// - /// The application's focus manager. - /// - public Input.IFocusManager? FocusManager => - _application.FocusManager; - /// /// Gets the application's input manager. /// diff --git a/src/Avalonia.X11/X11Window.cs b/src/Avalonia.X11/X11Window.cs index eee69b7485..7df275b4c2 100644 --- a/src/Avalonia.X11/X11Window.cs +++ b/src/Avalonia.X11/X11Window.cs @@ -1324,7 +1324,7 @@ namespace Avalonia.X11 public bool IsEnabled => !_disabled; - public class SurfacePlatformHandle : IPlatformNativeSurfaceHandle + public class SurfacePlatformHandle : INativePlatformHandleSurface { private readonly X11Window _owner; diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs index 070e1a95bc..850ea6d4a6 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmBindings.cs @@ -115,7 +115,7 @@ namespace Avalonia.LinuxFramebuffer.Output } - public void Dump() + internal void Dump() { void Print(int off, string s) { diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs index 0135cb3d1f..c91498fe05 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs @@ -49,6 +49,7 @@ namespace Avalonia.LinuxFramebuffer.Output _outputOptions = options; Init(card, resources, connector, modeInfo); } + public DrmOutput(string path = null, bool connectorsForceProbe = false, DrmOutputOptions options = null) { if(options != null) diff --git a/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj b/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj index 3c2d7b3322..9d4b04d244 100644 --- a/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj +++ b/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Windows/Avalonia.Direct2D1/Direct2DChecker.cs b/src/Windows/Avalonia.Direct2D1/Direct2DChecker.cs deleted file mode 100644 index d1233ca4e7..0000000000 --- a/src/Windows/Avalonia.Direct2D1/Direct2DChecker.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Avalonia.Platform; - -namespace Avalonia.Direct2D1 -{ - class Direct2DChecker : IModuleEnvironmentChecker - { - //Direct2D backend doesn't work on some machines anymore - public bool IsCompatible - { - get - { - try - { - Direct2D1Platform.InitializeDirect2D(); - return true; - } - catch - { - return false; - } - } - } - } -} diff --git a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs index 2a3255bb70..b256a9433d 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs @@ -594,7 +594,6 @@ namespace Avalonia.Win32 case WindowsMessage.WM_PAINT: { using (NonPumpingSyncContext.Use(NonPumpingWaitHelperImpl.Instance)) - using (_rendererLock.Lock()) { if (BeginPaint(_hwnd, out PAINTSTRUCT ps) != IntPtr.Zero) { @@ -616,12 +615,6 @@ namespace Avalonia.Win32 case WindowsMessage.WM_SIZE: { - using (NonPumpingSyncContext.Use(NonPumpingWaitHelperImpl.Instance)) - using (_rendererLock.Lock()) - { - // Do nothing here, just block until the pending frame render is completed on the render thread - } - var size = (SizeCommand)wParam; if (Resized != null && @@ -837,11 +830,8 @@ namespace Avalonia.Win32 return IntPtr.Zero; } } - - using (_rendererLock.Lock()) - { - return DefWindowProc(hWnd, msg, wParam, lParam); - } + + return DefWindowProc(hWnd, msg, wParam, lParam); } private Lazy?>? CreateLazyIntermediatePoints(POINTER_INFO info) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index 6ca59ca38c..793782fe1f 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -70,7 +70,6 @@ namespace Avalonia.Win32 private readonly TouchDevice _touchDevice; private readonly WindowsMouseDevice _mouseDevice; private readonly PenDevice _penDevice; - private readonly ManagedDeferredRendererLock _rendererLock; private readonly FramebufferManager _framebuffer; private readonly object? _gl; private readonly bool _wmPointerEnabled; @@ -128,7 +127,6 @@ namespace Avalonia.Win32 IsResizable = true, Decorations = SystemDecorations.Full }; - _rendererLock = new ManagedDeferredRendererLock(); var glPlatform = AvaloniaLocator.Current.GetService(); @@ -1497,7 +1495,7 @@ namespace Avalonia.Win32 public void Dispose() => _owner._resizeReason = _restore; } - private class WindowImplPlatformHandle : IPlatformNativeSurfaceHandle + private class WindowImplPlatformHandle : INativePlatformHandleSurface { private readonly WindowImpl _owner; public WindowImplPlatformHandle(WindowImpl owner) => _owner = owner; diff --git a/tests/Avalonia.UnitTests/NullRenderer.cs b/tests/Avalonia.UnitTests/NullRenderer.cs index 1b59aa30eb..a001ec0d6e 100644 --- a/tests/Avalonia.UnitTests/NullRenderer.cs +++ b/tests/Avalonia.UnitTests/NullRenderer.cs @@ -12,7 +12,12 @@ public sealed class NullRenderer : IRenderer { public RendererDiagnostics Diagnostics { get; } = new(); - public event EventHandler? SceneInvalidated; + event EventHandler? IRenderer.SceneInvalidated + { + add { } + remove { } + } + public NullRenderer() {