Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev

This commit is contained in:
Rob Carr
2020-06-29 21:42:03 +00:00
committed by Android (Google) Code Review

View File

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