Commit ebf73b1
DrawingCanvas API: Replace imperative extension methods with stateful canvas-based drawing model (#377)
* Migrate SolidBrush tests
* Migrate SweetGradientBrush tests
* Migrate RecolorBrush tests
* Migrate SolidBezier tests
* Migrate Blending tests
* Migrate Clip tests
* Migrate robustness tests
* Migrate Issues tests
* Migrate SVGPath tests
* Cleanup references
* Optimize refs
* Remove legacy APIs
* Fix build
* Update ImageSharp.Drawing.sln
* Include binaries use streaming for composition
* Update ImageSharp.Drawing.Tests.csproj
* Use tolerance comparer
* Update DrawingCanvasTests.RegionAndState.cs
* Skip WebGPU drawing tests on Linux
* Skip WebGPU tests for all CI
* Remove rasterizer config
* Replace PolygonScanner with DefaultRasterizer and optimize
* Feng shui all the things.
* Remove unused type
* Reuse WorkerScratch across rasterizer calls + optimizations
* Fix tile mapping and dispatch dimensions
* Use output texture for readback to avoid copy
* Add CSR shaders; restructure WebGPU shaders & tests
* Switch to CSR-based composite shaders
* Add start_cover fast path; skip outside edges
* Compute CSR on CPU; refactor coverage rasterizer
* Update DrawingCanvasTests.Process.cs
* Switch edge buffers to IMemoryOwner
* Pre-split edges into band-sorted buffers (remove CSR)
* Add small-geometry fast path to rasterizer
* Update reference images
* Update Draw_NormalizeOutputFalse_MatchesReference_Rgba32.png
* Bump tolerance
* Fix #344
* Fix #367
* Fix #244
* Add AntialiasThreshold and aliased mode
* Remove FillPath API from drawing backends
* Add WebGPUWindowDemo and backend feature checks
* Make API public
* Remove NormalizeOutput
* Move stroking to the GPU
* Add GPU stroke expand shader & refactor strokes
* Add per-band stroke rasterization and StrokeEdgeFlags
* Update docs
* Update reference images
* GPU: add gradient, pattern & recolor brushes
* Replace DashPathSplitter with GenerateDashes extension
* Add ReleaseFrameResources and WebGPU CPU cache key
* Add new text measuring tests
* Migrate drawing transforms to Matrix4x4
* Attempt to run WebGPU tests in CI
* Use explicit theory with runtime support check
* Update build-and-test.yml
* Cache WebGPU support and gate drawing backend
* Use PNG for comparison
* Update WebGPUDrawingBackendTests.cs
* Remove duplicate assertion
* Verify WebGPU compute pipeline in ProbeSupport
* Add RemoteExecutor and WebGPU probe
* Add missing tests.
* Add GPU layer compositing and shared WGSL snippets
* Remove reference codecs and simplify tests
* Add pre-flattened paths and FlattenAndTransform helper
* Optimize Bezier subdivision and list allocation
* Use IMemoryOwner for edge and band offset buffers
* Cleanup
* Use auto-properties; drop isRoot flag
* Add no AA rectangle tests
* Remove some copying.
* Update dependencies
* Refactor path flattening and remove tessellation
* Handle different separators in SVG parsing
* Cache flattening properly.
* Refactor CPU to actually follow architecture
* Refactor composition preparation and batching
* Fix orientation, update ref output
* Update refs
* semi-reasonable performance
* Update FlushScene.cs
* Remove GeometryPreparationCache and cache bands
* Remove obsolete enforceFillOrientation flag
* Remove enforceFillOrientation; simplify Reverse
* Reimplement all GPU brushes
* Support per-draw blend mode and alpha in WebGPU
* Extract DeviceSharedState to WebGPURuntime
* Add inline layer support to compositing pipeline
* Refactor brush renderers and FlushScene parallel loop
* Refactor WebGPU encoder and linearize path model
* Cleanup and document
* Treat TargetFramework as local in csproj
* Pass layer bounds and refactor rasterizer spans
* Buffer contiguous spans to batch row callbacks
* Apply DestinationOffset for path point translation
* Add aliased fine-pass threshold shader and plumbing
* Move WGSL sources to Shaders/WgslSource
* Add 3rd part notices
* Add WebGPU scene support & optimize encoding
* Add docs and helpers for WebGPU shaders & backend
* Add sample; add WebGPU chunking.
* Use CI solution in scripts; tweak sample csproj
* Update refs
* Update WgslSourceGenerator.cs
* Add tolerance
* Update ci-test.ps1
* Update docs.
* add Skia "benchmark backend" options to DrawingBackendBenchmark
* tmp - progress capture only
* Improve GPU perf
* Fix chunking
* cleanup
* Cache and reuse scheduling arena across flushes
* Add reusable WebGPU scene resource arena
* Refactor scheduling & resource arena helpers
* Remove debug logging
* Add slowpath transform
* Apply transforms
* Fix gradient brushes
* Fix GPU stroking and ImageBrush
* Fix GPU brush transforms
* Test pass.
* Implement retained stroke rasterization and stroke commands
* Clean up public API
* Centralize WebGPU probes into WebGPURuntime
* Patch test, update docs
* Honor MaxDegreeOfParallelism in flush
* Add Fill symmetry, new Pie polygon, and migrate to extensions
* Simplify tests and update docs
* detangle build version numbers
* Add PathBuilder shape helpers; normalize angles to degrees
* Fix tests
* Add ParallelExecutionHelper for partitioning
* Update refs
* Update ImageSharp ref
* Cleanup API and fix demo FPS display
* Inline explicit layers; remove compose pass, fix issues
* Include square line cap in bounds; update WebGPU tests
* Improve coverage a little
* Add emoji grid text rendering test and bump Fonts
* Fix parallel bounds, use configuration
* Replace Lease-based runtime with shared API
* Remove HybridCanvasFrame and hybrid APIs
* Replace TryReadback API with Readback methods, remove Shutdown
* benchmark parallel efficiency and overhead
* Introduce safe WebGPU handle wrappers
* Use WebGPUEnvironmentError for probe results
* Use error codes in test attributes.
* Make ToLinearGeometry() cache threadsafe.
* Merge -> Concat
* Use inline array, fix GPU retry counter logic
* Update src/ImageSharp.Drawing/Processing/Backends/DefaultDrawingBackend.cs
Co-authored-by: Anton Firszov <antonfir@gmail.com>
* Update src/ImageSharp.Drawing/Processing/Backends/ParallelExecutionHelper.cs
Co-authored-by: Anton Firszov <antonfir@gmail.com>
* Update ParallelExecutionHelper.cs
* ProcessWithCanvas -> Paint
* Process -> Apply
* Add useful scripts.
* restructure solutions and fix DrawShapesWithImageSharp sample
* make the lines benchmark resizable
* Refactor WebGPU handles and render targets
* Use safe handle refs for WebGPU native calls via using
* Use DrawingOptions in composition and stroke commands
* Fix tests
* Update WebGPU docs.
* Align chunk tile heights to 16-row bins
* Add more efficient path-row shaders and sparse tile handling
* Fix benchmark resize handling
* Add hosted window API and samples + fix bugs/perf
* Remove overly defensive guards
* Make CloneForClearOperation internal
* Use IEnumerable for DrawGlyphs
* Unify text measurement API to TextMetrics
* Remove InnerJoin config, ensure WebGPU configuration coverage
* Remove WebGPUTextureTransfer and use Readback APIs
* Remove partial modifier from DrawingCanvas
* Rename DrawingCanvasExtensions class
* Full cleanup pass
* Use WebGPUHostedSurface and normalize API
* Treat DeviceLost a non-fatal until it is.
* Refactor WebGPU resource allocation to throw
* Replace TryReadRegion with ReadRegion (throws)
* Add Apply readback scene and UI wiring
* Make NativeSurface abstract, simplify, and add WebGPU surface
* Make types internal
* Add WebGPU path-gradient support and remove fallback behavior
* Move canvas convenience APIs to extensions
* Normalize stroke docs.
* Update TextBuilderTests.cs
* Update PathTests.cs
* More Path extensions tests
* Add FillPath_UncontainedGeometry WebGPU test
* Handle point strokes in WebGPU encoder
* Use Allocator/IMemoryOwner instead of ArrayPool
* Use WebGPUNativeTarget and refactor native surface
* Rename HostedSurface to ExternalSurface
* Remove FramebufferSize from WebGPUSurfaceFrame
* Remove Present method; auto-present on Dispose
* Make presentMode readonly; remove properties
* Introduce DrawingCanvas base type and APIs
* Introduce FlattenedPointBuilder and rendering optimizations
* Add rich drawing samples and assets. Fix SaveLayer clipping
* Clean up images that shouldn't be there.
* Tweak sample
* Add files to LFS
* Dispose Canvas then ensure surface handle release
* Make DrawingCanvas factory internal and update tests
* ImageSharp.Drawing.All
* simplify CompositePixelRegistration storage and related lookup methods
* fix xmldoc leftover
* delete unused code
* Add retained drawing scenes and refactor WebGPU
* Remove TPixel generics from WebGPU API
* Refactor drawing backend API and WebGPU helpers
* Add partitioned parallel encoding for WebGPU scenes
* Add WebGPU uncaptured-error handling and safety
* Add retain regression tests
* Remove TryGetOrCreateSharedBuffer
* Refactor WebGPU buffer creation helpers to remove Try
* delete unused code
* delete more dead code
* Rename Graphics to DeviceContext and make field
* Remove WebGPUNativeSurfaceFactory
* Add ReadbackImage API and Buffer2DRegion usage
* Migrate Create to WebGPUNativeSurface
* Use native frames for WebGPU staging and flush
* Fix binning regression.
* Align GPU ImageBrush with CPU
* Convert shape extensions to DrawingCanvas methods
* Use explicit native mappings instead of casts
* Refactor WebGPU native surface and chunking
* Add WebGPU environment options and preference
* Update tolerances
* Trim test output name length
* Make diagnostics internal; drop int encodings, cleanup
* Update tests/ImageSharp.Drawing.Tests/Processing/Backends/WebGPUDrawingBackendTests.cs
Co-authored-by: Anton Firszov <antonfir@gmail.com>
* Remove unused docs
* Update to latest Fonts and add APIs, tests and samples
* Update the sample to allow general closed paths
* Optimize scenes, tweak docs.
* Support continuous and on-demand rendering in samples
---------
Co-authored-by: antonfirsov <antonfir@gmail.com>1 parent 6d2010b commit ebf73b1
2,508 files changed
Lines changed: 72394 additions & 40351 deletions
File tree
- .github/workflows
- samples
- DrawShapesWithImageSharp
- DrawingBackendBenchmark
- WebGPUExternalSurfaceDemo
- Controls
- Properties
- Scenes
- WebGPUWindowDemo
- src
- ImageSharp.Drawing.WebGPU.ShaderGen
- ImageSharp.Drawing.WebGPU
- RemoteExecutor
- Shaders
- WgslSource
- buildTransitive
- ImageSharp.Drawing
- Common/Extensions
- Helpers
- PolygonGeometry
- Processing
- Backends
- Extensions
- Processors
- Drawing
- Text
- Shapes
- Helpers
- PolygonGeometry
- Rasterization
- Text
- Text
- Utilities
- tests
- ImageSharp.Drawing.Benchmarks
- Drawing
- ImageSharp.Drawing.ManualBenchmarks
- ImageSharp.Drawing.Tests
- Drawing
- Paths
- Text
- Helpers
- Issues
- PolygonGeometry
- Processing
- Backends
- Rasterization
- Shapes
- Issues
- PolygonClipper
- Scan
- TestUtilities
- Attributes
- ReferenceCodecs
- Tests
- Utilities
- Images
- Input
- Bmp
- Gif
- issues
- Jpg
- baseline
- JpegSnoopReports
- issues
- JpegSnoopReports
- fuzz
- progressive
- JpegSnoopReports
- Png
- issues
- Svg
- Tga
- ReferenceOutput
- Drawing
- ClearSolidBrushTests
- ClipTests
- DrawBezierTests
- DrawComplexPolygonTests
- DrawLinesTests
- DrawPathTests
- DrawPolygonTests
- DrawingCanvasTests
- DrawingRobustnessTests
- FillComplexPolygonTests
- FillImageBrushTests
- FillOutsideBoundsTests
- FillPathTests
- FillPatternBrushTests
- FillPolygonTests
- FillSolidBrushTests
- GradientBrushes
- FillEllipticGradientBrushTests
- FillLinearGradientBrushTests
- FillPathGradientBrushTests
- FillRadialGradientBrushTests
- FillSweepGradientBrushTests
- ProcessWithDrawingCanvasTests
- RecolorImageTests
- SolidBezierTests
- SolidFillBlendedShapesTests
- Text/DrawTextOnImageTests
- WebGPUDrawingBackendTests
- Issue_134
- Issue_323
- Issue_330
- Issue_344
- Issue_367
- Issue_462
- RasterizerExtensionsTests
- SvgPath
- TestImageExtensionsTests
- TestImageProviderTests
- SaveTestOutputFileMultiFrame_Rgba32_giphy.gif
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | 327 | | |
336 | 328 | | |
337 | 329 | | |
338 | 330 | | |
339 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
| 347 | + | |
| 348 | + | |
343 | 349 | | |
| 350 | + | |
| 351 | + | |
344 | 352 | | |
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
348 | 360 | | |
349 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
350 | 366 | | |
351 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
352 | 372 | | |
353 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
354 | 378 | | |
355 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
356 | 384 | | |
357 | 385 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
362 | 450 | | |
363 | 451 | | |
364 | 452 | | |
| |||
384 | 472 | | |
385 | 473 | | |
386 | 474 | | |
387 | | - | |
388 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
389 | 481 | | |
390 | 482 | | |
391 | 483 | | |
392 | 484 | | |
393 | 485 | | |
| 486 | + | |
394 | 487 | | |
395 | 488 | | |
396 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | | - | |
| 75 | + | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments