Skip to content

passing a buffer object to canvas.toBuffer to reduce gc thrash #2356

Open
@mreinstein

Description

@mreinstein

toBuffer is very handy for blitting a canvas into some other graphics system:

const buffer = canvas.toBuffer('raw')
// blit buffer here

It would be really nice to pass in an existing buffer as an optional parameter, so it could be re-filled on each toBuffer invocation.
That would cut down on gc pressure quite a bit, especially in a tight render loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions