From cb250de686d3a4b318c11ea7970d91fc5ff3c041 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 2 Apr 2020 12:28:36 -0700 Subject: 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 --- core/java/android/view/ViewRootImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 35f955f7e78b..b5e8dd8212e3 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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(); } -- cgit v1.2.3