Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9464091e authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

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

parents 7434322a 9a808a2e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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);
    }