Refactor drawing API #56

Open
opened 2022-12-08 03:58:59 +00:00 by mars · 0 comments
Owner

Changes to be made:

  • Create a host-side, script-accessible DrawList structure.
  • Add draw calls to draw all of the shape primitives to a DrawList.
  • Add a method to add a finished DrawList to another unfinished DrawList with configurable offset, clipping rect, and tint (alpha too).
  • Implement an optional tessellation utility function to convert a DrawList into a tree of indexed triangle lists with draw commands.
  • Pass host-managed DrawList IDs into script panel draw callbacks to receive their draw commands.
  • Refactor the SAO UI to use the new drawing API.
  • Remove draw_indexed() from the scripting ABI.

Notes:

  • The adding of TextLayouts to DrawListss should store the glyphs in the layout as a vector of glyphs and not a reference to a TextLayout. This removes the need to reference-count TextLayouts in DrawLists.
  • DrawLists should have a finish() method in order to lock a DrawList from future modification, and exclude the possibility of a cyclic graph of nested DrawLists.
  • It's probably about time that I implement some generic data stores that can manage both a Runtime-scoped store of identifiers and a script-scoped map of local IDs to Runtime IDs.
Changes to be made: - Create a host-side, script-accessible `DrawList` structure. - Add draw calls to draw all of the shape primitives to a `DrawList`. - Add a method to add a finished `DrawList` to another unfinished `DrawList` with configurable offset, clipping rect, and tint (alpha too). - Implement an optional tessellation utility function to convert a `DrawList` into a tree of indexed triangle lists with draw commands. - Pass host-managed `DrawList` IDs into script panel draw callbacks to receive their draw commands. - Refactor the SAO UI to use the new drawing API. - Remove `draw_indexed()` from the scripting ABI. Notes: - The adding of `TextLayout`s to `DrawLists`s should store the glyphs in the layout as a vector of glyphs and not a reference to a `TextLayout`. This removes the need to reference-count `TextLayout`s in `DrawList`s. - `DrawList`s should have a `finish()` method in order to lock a `DrawList` from future modification, and exclude the possibility of a cyclic graph of nested `DrawList`s. - It's probably about time that I implement some generic data stores that can manage both a Runtime-scoped store of identifiers and a script-scoped map of local IDs to Runtime IDs.
mars added the
feature
consistency
labels 2022-12-08 03:58:59 +00:00
mars self-assigned this 2022-12-08 03:58:59 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: canary/canary-rs#56
No description provided.