You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ImageSharp.Drawing/Processing/DRAWING_CANVAS.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,9 +76,10 @@ The command remains relatively close to the original user request. It may hold t
76
76
77
77
### Preparation
78
78
79
-
Preparation is the flush-time normalization step. In code this lives in `CompositionCommand.Prepare(...)`and the surrounding `CompositionCommandPreparer`.
79
+
Preparation is the flush-time normalization step that turns recorded intent into backend-ready geometry and metadata. It is split across two stages:
80
80
81
-
Preparation turns recorded intent into backend-ready geometry and metadata. That is where path transforms are applied, strokes become outlines, clip paths are applied, prepared geometry is built or reused, and raster interest is recomputed.
81
+
1.`DrawingCanvasBatcher<TPixel>.PrepareCommands(...)` runs first and only when needed. It applies command transforms, expands strokes to fill paths, and applies clip paths so that clipped commands reach the backend as ordinary fills. It also expands dashed strokes when a stroke pattern is present.
82
+
2. The CPU backend then calls `FlushScene.Create(...)`, which lowers each command into a row-oriented retained representation through `TryPrepareFillPath` / `TryPrepareStrokePath`. That is where prepared rasterizable geometry is built, brushes are bound to the prepared coordinate space, and bounds and raster interest are recomputed.
82
83
83
84
Preparation is where the architecture moves from "what the caller asked for" to "what the backend can execute".
84
85
@@ -363,12 +364,11 @@ If you want to move from the architecture into the code, this is the best order.
363
364
2.`DrawingCanvasExtensions.cs`
364
365
3.`DrawingCanvasBatcher{TPixel}.cs`
365
366
4.`CompositionCommand.cs`
366
-
5.`CompositionCommandPreparer.cs`
367
-
6.`DefaultDrawingBackend.cs`
368
-
7.`FlushScene.cs`
369
-
8.`WebGPUEnvironment.cs`
370
-
9.`WebGPUWindow{TPixel}.cs`, `WebGPURenderTarget{TPixel}.cs`, and `WebGPUDeviceContext{TPixel}.cs`
371
-
10.`WebGPUDrawingBackend` and its scene/dispatch types
367
+
5.`DefaultDrawingBackend.cs`
368
+
6.`FlushScene.cs`
369
+
7.`WebGPUEnvironment.cs`
370
+
8.`WebGPUWindow{TPixel}.cs`, `WebGPURenderTarget{TPixel}.cs`, and `WebGPUDeviceContext{TPixel}.cs`
371
+
9.`WebGPUDrawingBackend` and its scene/dispatch types
0 commit comments