BLASTBufferQueue: Avoid unnecessary transactions

Currently every call to getOrCreateBLASTSurface produces a transaction.
This transaction has two parts, both of which can be eliminated:
	1. The first is the reparent. This was written when the
	client allocated the BLAST SurfaceControl, but now the WM
	allocates it and it has the correct parent to start, so
	we can just eliminate this.
	2. Showing the surface. We can eliminate this by just showing
	the surface by default.

Bug: 152501055
Test: Flip BLAST flag. Play.
Change-Id: If6e28e9153a09909fb3bb061980deb82c132dd5a
This commit is contained in:
Robert Carr
2020-04-02 12:28:36 -07:00
parent b164ea9d7a
commit cb250de686
2 changed files with 2 additions and 4 deletions

View File

@@ -1747,16 +1747,13 @@ public final class ViewRootImpl implements ViewParent,
|| !mBlastSurfaceControl.isValid()) {
return null;
}
if (mBlastBufferQueue == null) {
mBlastBufferQueue = new BLASTBufferQueue(
mBlastSurfaceControl, width, height);
}
mBlastBufferQueue.update(mBlastSurfaceControl, width, height);
mTransaction.show(mBlastSurfaceControl)
.reparent(mBlastSurfaceControl, mSurfaceControl)
.apply();
return mBlastBufferQueue.getSurface();
}

View File

@@ -127,6 +127,7 @@ class WindowSurfaceController {
mBLASTSurfaceControl = win.makeSurface()
.setParent(mSurfaceControl)
.setName("BLAST Adapter Layer")
.setHidden(false)
.setBLASTLayer()
.build();
}