Method InvokeWithFilledSpan
InvokeWithFilledSpan(int, char, ReadOnlySpanAction<char>, bool)
Allocates a Span<T> of the specified length, fills it with the given character, and invokes the provided action with the resulting ReadOnlySpan<T>. Uses stack allocation if the span size is below the threshold; otherwise falls back to heap.
public static void InvokeWithFilledSpan(int count, char ch, SkiaHelper.ReadOnlySpanAction<char> action, bool invokeOnEmpty = false)
Parameters
countintThe number of characters to allocate and fill.
chcharThe character to fill the span with.
actionSkiaHelper.ReadOnlySpanAction<char>The callback to invoke with the filled span.
invokeOnEmptyboolIf
true, the action will be invoked with an empty span whencountis zero or negative. Iffalse, the action will be skipped in that case.