summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceView.java
diff options
context:
space:
mode:
authorchaviw <chaviw@google.com>2019-06-07 16:33:50 -0700
committerchaviw <chaviw@google.com>2019-06-25 17:09:03 -0700
commit9f6171e7b2711e539f9c7aa3b8bc04a46f4d0df2 (patch)
tree632613b7425f4f30af56b5e1ad009b47d1ed6ed8 /core/java/android/view/SurfaceView.java
parent95013b0b6be1aef345c6f1997491fa83ebaf5b1b (diff)
Deleted SurfaceControl.remove method
Updated all callers of SC.remove to use Transaction.remove(sc) and apply immediately since that's the equivalent. Eventually, the transactions that contain remove could combine with other transactions if it makes sense to avoid duplicate applies. Test: SurfaceControlTest Change-Id: I13c6ec86de6a6d60f142c2269337557510dd006d
Diffstat (limited to 'core/java/android/view/SurfaceView.java')
-rw-r--r--core/java/android/view/SurfaceView.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index f7654716e31f..f661e0646d75 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -200,6 +200,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
private int mPendingReportDraws;
private SurfaceControl.Transaction mRtTransaction = new SurfaceControl.Transaction();
+ private SurfaceControl.Transaction mTmpTransaction = new SurfaceControl.Transaction();
public SurfaceView(Context context) {
this(context, null);
@@ -339,7 +340,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
updateSurface();
if (mSurfaceControl != null) {
- mSurfaceControl.remove();
+ mTmpTransaction.remove(mSurfaceControl).apply();
}
mSurfaceControl = null;
@@ -534,13 +535,14 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
private void releaseSurfaces() {
if (mSurfaceControl != null) {
- mSurfaceControl.remove();
+ mTmpTransaction.remove(mSurfaceControl);
mSurfaceControl = null;
}
if (mBackgroundControl != null) {
- mBackgroundControl.remove();
+ mTmpTransaction.remove(mBackgroundControl);
mBackgroundControl = null;
}
+ mTmpTransaction.apply();
}
/** @hide */
@@ -849,7 +851,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
}
if (mDeferredDestroySurfaceControl != null) {
- mDeferredDestroySurfaceControl.remove();
+ mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
mDeferredDestroySurfaceControl = null;
}