Automattic / Automattic/node-canvas
passing a buffer object to `canvas.toBuffer` to reduce gc thrash
Open
Feature
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
`toBuffer` is very handy for blitting a canvas into some other graphics system:
```javascript
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.