Status: Production Ready ✅
High-performance .NET 8.0 bindings for the Vello Sparse Strips CPU renderer with 100% API coverage.
- ✅ 100% API Coverage - All 34 RenderContext methods implemented
- ✅ Complete Feature Set - Images, gradients, blending, clipping, masking, glyphs
- ✅ Zero-Allocation Rendering - Span<T>/stackalloc for text, gradients, PNG I/O (Phase 1 & 2 complete)
- ✅ High Performance - Zero-copy pixel access via ReadOnlySpan<T>
- ✅ Modern .NET 8.0 - LibraryImport, blittable structs, Span<T> APIs
- ✅ SIMD Support - SSE2, AVX, AVX2, AVX512, NEON
- ✅ Multithreading - Configurable worker threads
- ✅ Cross-Platform - Windows, Linux, macOS (x64, ARM64)
- ✅ Safe API - IDisposable pattern, automatic cleanup
- ✅ Comprehensive Testing - 113 tests (100% passing, including 32 performance tests)
- ✅ 15 Examples - Comprehensive example applications
- Rust 1.86+ (for vello_cpu_ffi)
- .NET 8.0 SDK (for C# bindings)
- Platform-specific tools:
- Windows: MSVC or MinGW
- Linux: GCC/Clang
- macOS: Xcode Command Line Tools
For convenience, the scripts/ directory exposes one-liners per target platform. Each script builds the Vello CPU FFI native library for both Debug and Release profiles:
These helpers focus solely on the native Rust artifacts (including the wasm32-unknown-emscripten static archive). Build the .NET projects separately via dotnet build or dotnet publish.
Detailed setup notes for each platform (toolchain requirements, manual steps, and artifact locations) are available in docs/native-build.md.
Install the Avalonia host control from NuGet:
Drop the reusable VelloSurface into XAML and bind an IVelloRenderer implementation that drives your scene logic:
The control handles render-loop scheduling, context pooling, and stride-aware blitting into WriteableBitmaps. Subscribe to FrameStatsUpdated for averaged FPS/frame-time telemetry when profiling high-performance scenes.
See dotnet/samples/Vello.Samples/ for 15 complete examples:
- Simple rectangle - Basic solid color rendering
- Linear gradient - Gradient fills with extend modes
- Radial gradient - Circular gradients
- Bezier paths - Complex path drawing with curves
- Transforms - Affine transformations
- Zero-copy access - Direct pixel manipulation with Span
- PNG I/O - Save and load PNG images
- Blend modes - 28 blend mode combinations
- Stroke styles - Line joins, caps, and dashing
- Sweep gradient - Angular gradients
- Blurred rounded rectangles - Blur effects
- Clipping - Path-based clipping
- Text rendering - Font loading and glyph rendering
- Masking - Alpha and luminance masks
- Raster images - Image rendering with quality settings
Complete documentation is available in the docs/ folder:
- docs/STATUS.md - Project status and completion summary
- docs/API_COVERAGE.md - Complete API coverage matrix (34/34 methods)
- docs/FFI_DESIGN.md - FFI architecture and design decisions
- docs/IMPLEMENTATION_PLAN.md - Development phases and plan
- Rust FFI Layer (vello_cpu_ffi) - C-ABI wrapper around vello_cpu
- P/Invoke Layer (Vello.Native) - Low-level .NET interop (internal)
- Safe Wrapper (Vello) - High-level C# API (public)
- Opaque handles for Rust types (prevents misuse)
- Blittable structures for geometry (zero marshalling cost)
- LibraryImport for source-generated P/Invoke
- Span<T> for zero-copy pixel access
- IDisposable for deterministic cleanup
All critical rendering paths now support zero-allocation rendering using Span<T> and stackalloc:
- Text rendering (≤256 chars): 0 allocations (was 5 per call)
- Gradients (≤32 stops): 0 allocations (was 1 per call)
- Glyph rendering (≤256 glyphs): 0 allocations (was 1 per call)
- PNG loading: Zero-copy from ReadOnlySpan<byte> sources
- PNG export: Try-pattern with pre-allocated buffers
- Pixel byte access: Zero-copy direct memory access
- Zero-copy pixel access - Direct memory access via Span<PremulRgba8>
- Blittable types - No marshalling overhead
- SIMD optimizations - Automatic hardware detection (SSE2, AVX, AVX2, AVX512, NEON)
- Multithreading - Configurable worker threads
- Stackalloc - Automatic stack allocation for typical sizes, heap for large data
Example configuration:
| Windows | ✅ | ✅ | Planned |
| Linux | ✅ | ✅ | Planned |
| macOS | ✅ | ✅ | Planned |
✅ COMPLETE - Production Ready ✅
All implementation phases have been completed:
- ✅ Phase 1: Planning and Design
- ✅ Phase 2: Rust FFI Layer (3,300+ lines)
- ✅ Phase 3: .NET Binding Layer (4,500+ lines)
- ✅ Phase 4: Core Rendering Methods
- ✅ Phase 5: Advanced Features (gradients, images, text, masking)
- ✅ Phase 6: Testing & Validation (85 tests, 81 active, 100% passing)
- ✅ Phase 7: Documentation
100% API Coverage: All 34 RenderContext methods implemented
See docs/STATUS.md for detailed completion status.
All vello_cpu RenderContext features are fully implemented:
- ✅ Raster Images - Image rendering with quality and extend modes
- ✅ Gradients - Linear, Radial, and Sweep gradients
- ✅ Blurred Rounded Rectangles - Blur effects with standard deviation
- ✅ Blending & Compositing - 16 Mix modes × 14 Compose modes = 28 combinations
- ✅ Clipping - Path-based clipping layers
- ✅ Masking - Alpha and luminance masks
- ✅ Glyphs - All glyph types (CFF, Bitmap, COLRv0, COLRv1)
- ✅ Paint Transforms - Affine transformations for paint
- ✅ Fill Rules - NonZero and EvenOdd winding rules
- ✅ Strokes - Width, joins, caps, miter limits, dashing
See docs/API_COVERAGE.md for the complete method-by-method comparison.
Contributions welcome! The implementation is complete, but improvements are always appreciated.
This project is licensed under Apache-2.0 OR MIT, matching the Vello project.
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Built on top of Vello Sparse Strips by the Linebender community.
.png)

