SurfaceView: Release BBQ where we release Surface

This more closesly mirrors the timing of pre-BLAST behavior. There
are also some concerns that we may not reach releaseSurfaces if our
first call to tryReleaseSurface came through ViewRoot#doDie.

Bug: 176691195
Test: Existing tests pass
Change-Id: I211a3e80eab1e847a4d6ade47ff19cf131de8f39
This commit is contained in:
Robert Carr
2021-02-02 15:54:28 -08:00
parent 1999828918
commit 57c853f230

View File

@@ -877,6 +877,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
synchronized (mSurfaceControlLock) {
mSurface.release();
if (mBlastBufferQueue != null) {
mBlastBufferQueue.destroy();
mBlastBufferQueue = null;
}
if (mRtHandlingPositionUpdates) {
mRtReleaseSurfaces = true;
@@ -901,10 +905,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
transaction.remove(mBlastSurfaceControl);
mBlastSurfaceControl = null;
}
if (mBlastBufferQueue != null) {
mBlastBufferQueue.destroy();
mBlastBufferQueue = null;
}
}
private boolean performSurfaceTransaction(ViewRootImpl viewRoot, Translator translator,