[sf] Move texture deletion to main thread via pool
Places deleted texture names into the texture pool, and adds code to
postComposition to either generate textures if the pool is low or delete
them if it is overfilled.
Bug: 129393280
Test: Manual, systrace with gesture nav and observe deferred deletions
Test: libsurfaceflinger_unittest, which was updated to pass
Change-Id: I683ad5b817a29f679def22f0b746223aac3241d9
diff --git a/services/surfaceflinger/tests/unittests/CompositionTest.cpp b/services/surfaceflinger/tests/unittests/CompositionTest.cpp
index bebfa6c..7c0ecb3 100644
--- a/services/surfaceflinger/tests/unittests/CompositionTest.cpp
+++ b/services/surfaceflinger/tests/unittests/CompositionTest.cpp
@@ -856,7 +856,7 @@
}
static void cleanupInjectedLayers(CompositionTest* test) {
- EXPECT_CALL(*test->mMessageQueue, postMessage(_, 0)).Times(2);
+ EXPECT_CALL(*test->mMessageQueue, postMessage(_, 0)).Times(1);
Base::cleanupInjectedLayers(test);
}