Open
Description
Is your feature request related to a problem? Please describe.
Currently, it's impossible to create a copy of SKVertices as a "slice" of original one. It's common practice in low-level graphics to reuse the same array with different "regions" of it determined by offset and count. I have troubles to make it work with SkiaSharp as the third-party API provides me with complete merged array of vertices and indexes that I want to use without additional allocations.
Describe the solution you'd like
An extended main method could look like that (reflects the native call completely):
SKVertices CreateCopy (SKVertexMode vmode, int vertexOffset, int vertexCount, SKPoint[] positions, SKPoint[] texs, SKColor[] colors, int indexOffset, int indexCount, UInt16[] indices)
With the native call inside:
fixed (SKPoint* p = positions)
fixed (SKPoint* t = texs)
fixed (SKColor* c = colors)
fixed (UInt16* i = indices) {
return GetObject (SkiaApi.sk_vertices_make_copy (vmode, vertexCount, p + vertexOffset, t + vertexOffset, (uint*)c + vertexOffset, indexCount, i + indexOffset));
}
Describe alternatives you've considered
Split input arrays into parts manually. Unoptimized solution with additional allocations.
PR: #2432
Metadata
Metadata
Assignees
Type
Projects
Status
New