Verify Views files against decompiled, extract embedded types
Fixed files: - SkiaImageButton.cs: Added SVG support with multi-path search - SkiaNavigationPage.cs: Added LinuxApplication.IsGtkMode check - SkiaRefreshView.cs: Added ICommand support (Command, CommandParameter) - SkiaTemplatedView.cs: Added missing using statements Extracted embedded types to separate files (matching decompiled pattern): - From SkiaMenuBar.cs: MenuBarItem, MenuItem, SkiaMenuFlyout, MenuItemClickedEventArgs - From SkiaNavigationPage.cs: NavigationEventArgs - From SkiaTabbedPage.cs: TabItem - From SkiaVisualStateManager.cs: SkiaVisualStateGroupList, SkiaVisualStateGroup, SkiaVisualState, SkiaVisualStateSetter - From SkiaSwipeView.cs: SwipeItem, SwipeStartedEventArgs, SwipeEndedEventArgs - From SkiaFlyoutPage.cs: FlyoutLayoutBehavior (already separate) - From SkiaIndicatorView.cs: IndicatorShape (already separate) - From SkiaBorder.cs: SkiaFrame - From SkiaCarouselView.cs: PositionChangedEventArgs - From SkiaCollectionView.cs: SkiaSelectionMode, ItemsLayoutOrientation - From SkiaContentPresenter.cs: LayoutAlignment Verified matching decompiled: - SkiaContextMenu.cs, SkiaFlexLayout.cs, SkiaGraphicsView.cs Build: 0 errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
75
Rendering/LayeredRenderer.cs
Normal file
75
Rendering/LayeredRenderer.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Microsoft.Maui.Platform.Linux.Rendering;
|
||||
|
||||
public class LayeredRenderer : IDisposable
|
||||
{
|
||||
private readonly Dictionary<int, RenderLayer> _layers = new();
|
||||
private readonly object _lock = new();
|
||||
private bool _disposed;
|
||||
|
||||
public RenderLayer GetLayer(int zIndex)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (!_layers.TryGetValue(zIndex, out var layer))
|
||||
{
|
||||
layer = new RenderLayer(zIndex);
|
||||
_layers[zIndex] = layer;
|
||||
}
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveLayer(int zIndex)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (_layers.TryGetValue(zIndex, out var layer))
|
||||
{
|
||||
layer.Dispose();
|
||||
_layers.Remove(zIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Composite(SKCanvas canvas, SKRect bounds)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
foreach (var layer in _layers.Values.OrderBy(l => l.ZIndex))
|
||||
{
|
||||
layer.DrawTo(canvas, bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateAll()
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
foreach (var layer in _layers.Values)
|
||||
{
|
||||
layer.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed) return;
|
||||
_disposed = true;
|
||||
|
||||
lock (_lock)
|
||||
{
|
||||
foreach (var layer in _layers.Values)
|
||||
{
|
||||
layer.Dispose();
|
||||
}
|
||||
_layers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user