diff options
| author | Robert Carr <racarr@google.com> | 2020-04-01 14:29:13 -0700 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2020-04-03 15:07:35 -0700 |
| commit | 92e08bf997bcd1459df4d2efe9fd51993908dd3e (patch) | |
| tree | 51d3619707157d59a0036cc768ec8411e250e275 /core/java/android/view/ViewRootImpl.java | |
| parent | b164ea9d7ab9d1e9771069310f919e408c43ccee (diff) | |
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
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 8 |
1 files changed, 8 insertions, 0 deletions
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; + } } |
