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

Commit 673f20da authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clean up SurfaceView."

parents c642905b 60557b5b
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -692,7 +692,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                try {
                    redrawNeeded |= visible && !mDrawFinished;

                    SurfaceHolder.Callback callbacks[] = null;
                    SurfaceHolder.Callback[] callbacks = null;

                    final boolean surfaceChanged = creating;
                    if (mSurfaceCreated && (surfaceChanged || (!visible && visibleChanged))) {
@@ -819,7 +819,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                if (!isHardwareAccelerated() || !mRtHandlingPositionUpdates) {
                    try {
                        if (DEBUG) Log.d(TAG, String.format("%d updateSurfacePosition UI, " +
                                "postion = [%d, %d, %d, %d]", System.identityHashCode(this),
                                "position = [%d, %d, %d, %d]", System.identityHashCode(this),
                                mScreenRect.left, mScreenRect.top,
                                mScreenRect.right, mScreenRect.bottom));
                        setParentSpaceRectangle(mScreenRect, -1);
@@ -842,9 +842,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
            mDeferredDestroySurfaceControl = null;
        }

        runOnUiThread(() -> {
            performDrawFinished();
        });
        runOnUiThread(this::performDrawFinished);
    }

    /**
@@ -918,7 +916,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                if (DEBUG) {
                    Log.d(TAG, String.format(
                            "%d updateSurfacePosition RenderWorker, frameNr = %d, "
                                    + "postion = [%d, %d, %d, %d]",
                                    + "position = [%d, %d, %d, %d]",
                            System.identityHashCode(this), frameNumber,
                            left, top, right, bottom));
                }
@@ -954,7 +952,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
    };

    private SurfaceHolder.Callback[] getSurfaceCallbacks() {
        SurfaceHolder.Callback callbacks[];
        SurfaceHolder.Callback[] callbacks;
        synchronized (mCallbacks) {
            callbacks = new SurfaceHolder.Callback[mCallbacks.size()];
            mCallbacks.toArray(callbacks);
+1 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,7 @@ public final class ViewTreeObserver {
     * be called manually if you are forcing the drawing on a View or a hierarchy of Views
     * that are not attached to a Window or in the GONE state.
     *
     * @return True if the current draw should be canceled and resceduled, false otherwise.
     * @return True if the current draw should be canceled and rescheduled, false otherwise.
     */
    @SuppressWarnings("unchecked")
    public final boolean dispatchOnPreDraw() {