Revert "Revert "[RenderEngine] Rebind output texture when unbinding framebuffer""
This reverts commit e76fc0c4a0dc80d564ecd6b99ab5b6913e0cd65d.
Reason for revert: Alec found another path to rebind output texture that
doesn't trip the emulator bug https://b.corp.google.com/issues/154665573
(included in the CL after this)
Bug: b/140158384
Change-Id: I8ae60b99d6baf2da81997889df5198d2960d4a58
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 737f8f8..d185050 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2336,6 +2336,9 @@
}
getBE().mLastSwapTime = currentTime;
+ // Cleanup any outstanding resources due to rendering a prior frame.
+ getRenderEngine().cleanupPostRender();
+
{
std::lock_guard lock(mTexturePoolMutex);
if (mTexturePool.size() < mTexturePoolSize) {