From 59773cbdd42d7d6dfd03db0be7022fbbb8735325 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 1 Apr 2020 14:35:07 -0700 Subject: [PATCH] SurfaceView: Use BLAST transaction when visibility changes. If visibility changes we will try and hide the Surfaces from the RT. We want to sync this with ViewRoot drawing so we enable BLAST sync for the next frame in this case. Bug: 152663327 Bug: 152780239 Test: Existing tests pass Change-Id: I9cd157954a3ce87a8f95a7be97d6d5c7f324327b --- core/java/android/view/SurfaceView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index c89e0c9fc60ed..0e57aad115be0 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -1037,7 +1037,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall mTmpTransaction.setWindowCrop(mSurfaceControl, mSurfaceWidth, mSurfaceHeight); } - } else if ((layoutSizeChanged || positionChanged) && + } else if ((layoutSizeChanged || positionChanged || visibleChanged) && viewRoot.useBLAST()) { viewRoot.setUseBLASTSyncTransaction(); }