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

Commit 1d7957fa authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Clear mSyncGroups when VRI does a performTraversal"

parents d72c3e16 aa295ddb
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1122,14 +1122,15 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
     * @hide
     */
    @Override
    public void surfaceSyncStarted() {
    public void vriDrawStarted(boolean isWmSync) {
        ViewRootImpl viewRoot = getViewRootImpl();
        if (viewRoot != null) {
        synchronized (mSyncGroups) {
            if (isWmSync && viewRoot != null) {
                for (SurfaceSyncGroup syncGroup : mSyncGroups) {
                    viewRoot.addToSync(syncGroup);
                }
            }
            mSyncGroups.clear();
        }
    }

+4 −4
Original line number Diff line number Diff line
@@ -2114,7 +2114,7 @@ public final class ViewRootImpl implements ViewParent,
        void surfaceCreated(Transaction t);
        void surfaceReplaced(Transaction t);
        void surfaceDestroyed();
        default void surfaceSyncStarted() {};
        default void vriDrawStarted(boolean isWmSync) {};
    }

    private final ArrayList<SurfaceChangedCallback> mSurfaceChangedCallbacks = new ArrayList<>();
@@ -2149,9 +2149,9 @@ public final class ViewRootImpl implements ViewParent,
        }
    }

    private void notifySurfaceSyncStarted() {
    private void notifyDrawStarted(boolean isWmSync) {
        for (int i = 0; i < mSurfaceChangedCallbacks.size(); i++) {
            mSurfaceChangedCallbacks.get(i).surfaceSyncStarted();
            mSurfaceChangedCallbacks.get(i).vriDrawStarted(isWmSync);
        }
    }

@@ -3663,6 +3663,7 @@ public final class ViewRootImpl implements ViewParent,
            }

            createSyncIfNeeded();
            notifyDrawStarted(isInWMSRequestedSync());
            mDrewOnceForSync = true;
        }

@@ -3736,7 +3737,6 @@ public final class ViewRootImpl implements ViewParent,

        mWmsRequestSyncGroup.addToSync(this);
        Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        notifySurfaceSyncStarted();
    }

    private void notifyContentCatpureEvents() {