From 92e08bf997bcd1459df4d2efe9fd51993908dd3e Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 1 Apr 2020 14:29:13 -0700 Subject: SurfaceView: Ensure we don't fill unused BLAST Transaction. If BLAST is enabled and we somehow end up in positionLost or setParentSpaceRectangle without having called setUseBLASTSyncTransaction we will end up putting operations in to a Transaction which will never be applied. This condition should be considered a bug, but it's best to defend against it. To compensate, rather than checking the global use BLAST flag, we check if the current draw is actually using BLAST. Bug: 152663327 Bug: 152780239 Test: Existing tests pass Change-Id: I3c05b83400b59be82a339933fc8ef1382d4f0e21 --- core/java/android/view/ViewRootImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) (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..95e0f9485019 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -9595,4 +9595,12 @@ public final class ViewRootImpl implements ViewParent, boolean useBLAST() { return mUseBLASTAdapter; } + + /** + * Returns true if we are about to or currently processing a draw directed + * in to a BLAST transaction. + */ + boolean isDrawingToBLASTTransaction() { + return mNextReportConsumeBLAST; + } } -- cgit v1.2.3