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
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,9 @@ Before looking at the flow, it helps to define the major terms in the sense used
59
59
60
60
It is not the rasterizer. It is the object that makes the public drawing model coherent.
61
61
62
-
Callers reach that model through `IImageProcessingContext.Paint(...)`.
62
+
Callers usually reach that model through `IImageProcessingContext.Paint(...)`.
63
+
64
+
When callers already have an `ImageFrame` or `ImageFrame<TPixel>`, the public `CreateCanvas(...)` frame extensions create a canvas directly over that frame. The caller owns the returned canvas and must dispose it to replay recorded work into the frame.
63
65
64
66
`DrawingCanvas<TPixel>` is the typed implementation that carries the target pixel format for brush normalization,
65
67
readback, and backend execution. Factory methods return `DrawingCanvas` so CPU and GPU entry points expose the same
@@ -106,7 +108,7 @@ There are two backend-selection paths in the architecture:
106
108
- specialized infrastructure can construct a canvas with an explicit backend
107
109
108
110
The ordinary CPU entry point is `Paint(...)` on `IImageProcessingContext`, which routes into the typed
109
-
implementation internally.
111
+
implementation internally. Public `ImageFrame` canvas extensions provide the lower-level frame entry point for callers that want to own the canvas lifetime directly.
110
112
111
113
That explicit-backend path matters for the WebGPU helpers. `WebGPUWindow`, `WebGPUExternalSurface`, and `WebGPURenderTarget` create canvases that point directly at their owned `WebGPUDrawingBackend` instance instead of storing that backend on the caller's `Configuration`.
0 commit comments