Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create class for managing image buffer pools #5

Open
jtackaberry opened this issue Jul 25, 2021 · 0 comments
Open

Create class for managing image buffer pools #5

jtackaberry opened this issue Jul 25, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jtackaberry
Copy link
Owner

jtackaberry commented Jul 25, 2021

Some widgets, like rtk.Entry and rtk.Viewport, create their own backing stores. As Reaper has a fairly low limit on the number of available image buffers (1024), this restricts the number of those widgets that can be created.

The idea is to create a class that works along side rtk.Image to create rtk-internal buffers. REAPER images can be 8192x8192 in size, and with 1024 of them, that's quite a lot of image buffer space to work with. We just need to be cleverer about allocation.

The buffer pool class should:

  • dynamically allocate REAPER buffers (using rtk.Image) with the full 8192x8192 resolution as needed
  • provide an API to allocate rtk buffers (sub regions from the REAPER buffer), bin-packing across available REAPER buffers based on the requested geometry. The subregion would use rtk.Image:viewport()
  • maintain a refcount for each REAPER buffer
  • support Lua GC to automatically release subregions and decref the REAPER buffer
  • free REAPER buffers when no more refs exist
@jtackaberry jtackaberry added the enhancement New feature or request label Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant