Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72 am: 7f46d57c67 am: 3da075357f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: I47c5a466c839630b7666ac4ddc4bebae6d561dfd
This commit is contained in:
Rob Carr
2020-06-29 22:22:55 +00:00
committed by Automerger Merge Worker

View File

@@ -471,6 +471,13 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
}
private void performDrawFinished() {
if (mDeferredDestroySurfaceControl != null) {
synchronized (mSurfaceControlLock) {
mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
mDeferredDestroySurfaceControl = null;
}
}
if (mPendingReportDraws > 0) {
mDrawFinished = true;
if (mAttachedToWindow) {
@@ -1194,13 +1201,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
+ "finishedDrawing");
}
if (mDeferredDestroySurfaceControl != null) {
synchronized (mSurfaceControlLock) {
mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
mDeferredDestroySurfaceControl = null;
}
}
runOnUiThread(this::performDrawFinished);
}