Add Experimental Avalonia Renderer Package and Catalog Sample. - #415
Add Experimental Avalonia Renderer Package and Catalog Sample.#415JimBobSquarePants wants to merge 9 commits into
Conversation
Move the Avalonia rendering backend out of the sample app into a new `SixLabors.ImageSharp.Drawing.Renderers.Avalonia` project, add shared versioning support for independently versioned packages, and update the control catalog to consume the packaged renderer and Avalonia CI packages. This also adds `Region` path scan conversion plus region containment/intersection APIs so the renderer can implement geometry fill intersection checks, and includes related dependency and solution updates.
Updates `GlyphRunImpl` to default to `HintingMode.Full` instead of `Standard`, including the stored run hinting mode and initial `GlyphOptions`. It also maps Avalonia `Strong` hinting (and the fallback case) to `HintingMode.Full`, keeping glyph geometry and decoration intersection calculations aligned with fully hinted rendering.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
======================================
- Coverage 79% 79% -1%
======================================
Files 232 232
Lines 27356 27610 +254
Branches 3113 3172 +59
======================================
- Hits 21875 21874 -1
- Misses 4589 4843 +254
- Partials 892 893 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Avalonia has no real supported path for a third-party renderer today. This package exists only through workarounds, and this first sample is Windows-only because of them. I want to lay out exactly what I had to do, why, and what Avalonia needs to add so that anyone can bring their own renderer. What the renderer is
Where WebGPU stands per platform
I also checked the other route: render offscreen and import through Why the whole approach is a workaround Every step below is a hack around a missing extension point. None of it should exist.
What Avalonia needs to provide for third-party renderers Two changes would remove all of the above. A. A native surface in
B. A composition-safe custom @MikeCodesDotNET, these are the two changes Avalonia needs before anyone can bring their own renderer. Can the team take them on? Until they exist, this renderer stays experimental and Windows-only. |
Open our own Xlib Display and pair it with the XID Avalonia exposes, since window ids are valid across connections to the same server.
Select Win32 software rendering from the renderer initializer when the application has not configured Win32PlatformOptions: always in Cpu mode, and in Auto mode when the WebGPU probe fails. Composited windows do not display framebuffer output. Removes the sample-only override. Use GetModuleHandle(null) for the HWND surface, the module Avalonia registers its window class against.
Prerequisites
Description
Adds a new
SixLabors.ImageSharp.Drawing.Renderers.Avaloniapackage that implements Avalonia rendering and text shaping using ImageSharp.Drawing and SixLabors.Fonts.The renderer supports CPU framebuffer and WebGPU native-surface rendering, with automatic or explicit backend selection. It covers Avalonia geometry, regions, images, glyph runs, render targets, layers, and effects.
This also adds an adapted upstream Avalonia Control Catalog as a comprehensive visual sample. The catalog can switch between the ImageSharp and Skia renderers and select the CPU or WebGPU backend for comparison.
Supporting changes include path-backed Region construction and region containment/intersection operations required by Avalonia geometry handling, plus the associated package, dependency, and solution updates.
ControlCatalog_C8zMvZ1Lm8.mp4