Skip to content

Add SkMesh C API for mesh specification, buffers, and canvas drawMesh#203

Draft
mattleibow wants to merge 1 commit into
skiasharpfrom
dev/skmesh-api
Draft

Add SkMesh C API for mesh specification, buffers, and canvas drawMesh#203
mattleibow wants to merge 1 commit into
skiasharpfrom
dev/skmesh-api

Conversation

@mattleibow

Copy link
Copy Markdown
Collaborator

Adds the C API shim for Skia's SkMesh, enabling custom vertex mesh drawing with SkSL shaders.

New functions

Mesh Specification:

  • sk_meshspecification_make — create from attributes, varyings, stride, and SkSL programs
  • sk_meshspecification_ref/unref — NVRefCnt management
  • sk_meshspecification_get_stride, sk_meshspecification_get_uniform_byte_size

Buffers:

  • sk_mesh_vertex_buffer_make/copy/get_size
  • sk_mesh_index_buffer_make/copy/get_size

Mesh:

  • sk_mesh_make — non-indexed mesh
  • sk_mesh_make_indexed — indexed mesh
  • sk_mesh_delete, sk_mesh_get_is_valid

Canvas:

  • sk_canvas_draw_mesh

Files changed

  • include/c/sk_types.h — opaque types, enums, structs
  • include/c/sk_mesh.h — new header
  • include/c/sk_canvas.h — drawMesh declaration
  • src/c/sk_mesh.cpp — new implementation
  • src/c/sk_canvas.cpp — drawMesh implementation
  • src/c/sk_types_priv.h — DEF_CLASS_MAP + As/To helpers
  • src/xamarin/SkiaKeeper.c — symbol retention
  • gn/core.gni — build entries

Companion to mono/SkiaSharp#3777

…vas drawMesh

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant