mirror of
https://github.com/androidx/media.git
synced 2025-05-16 12:09:50 +08:00

In `TextOverlay` and `DrawableOverlay`, treat `Bitmap` as a buffer, where we allocate it rarely and reuse it as long as possible before making a new one. In `BitmapOverlay`, avoid allocating GL textures too often as well. Strongly reduces allocations and memory usage growth (saving ~100-150 MB on 4k60fps at high end), at the cost of more code complexity and low-end using 70MB more, on 1/1 comparisons. PiperOrigin-RevId: 585990602