Summary:
Bitmaps are not cheap to create. Also, bitmaps are used from the main thread to capture the contents of a view but can be used and processed by background threads.
BitmapPool aims to solve both problems.
- It is a pool that can be used to recycle bitmaps.
- The recyclable bitmap can be processed by a background thread which can explicitly recycle the bitmap once done with it, hence putting it back into the pool.
UPDATE: D39815821
That diff changes the approach by defining a single default pool which can handle bitmaps of different sizes.
Reviewed By: LukeDefeo
Differential Revision: D39812212
fbshipit-source-id: 065eea656f4139aeb9d09cd5a5c7dddfc9c8edfd