summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/CompositionEngine/tests/planner/TexturePoolTest.cpp
AgeCommit message (Collapse)Author
2021-07-16SF: Enable Layer Caching Texture Pool only for the active displayAdy Abraham
Limit the memory consuption of the Texture Pool to a single display Test: atest libcompositionengine_test Bug: 188839446 Change-Id: I61d73a72bc25e776ef18f4e3fbf2c3373e0257e4
2021-06-09Add a TexturePool class into layer cachingAlec Mouri
In order to reduce the risk of buffer allocations burning cycles during rendering, add a texture pool which preallocates a set of screen-sized buffers available for use for layer caching. This texture pool has some properties to ease implementation details: 1. Textures are allocated synchronously. It's not very hard to add asynchronous support, but that does add a bit of complexity and Android 12 is almost finalized. It's also not yet clear if asynchronous allocation is needed since we can just tune the min texture pool size so that more buffers are preallocated; although it is certainly more flexible if we're able to defer allocations off-thread. 2. The texture pool is soft-bounded. If needed additional textures may be allocated to allow for complex geometries, but beyond an upper bound any additional textures may be deallocated. 3. The texture pool only supports screen-sized buffers, so we don't allocate smaller scratch buffers to save on memory. However, typically layer caching only caches screen-sized buffers. This also means that if the display size changes, then the texture pool must be reallocated. Note that the "display size" really refers to the framebuffer size, not necessarily the app-visible display. Bug: 184860700 Test: builds, boots Test: libcompositionengine_test Change-Id: Ic084310bae2b41be49c2cfe9f8c5a20ff683d1ad