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

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

Merge "Expose SurfaceSyncGroup public APIs"

parents 4d63c1ff 95aba36f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -60276,6 +60276,14 @@ package android.window {
    method @UiThread public void remove();
  }
  public class SurfaceSyncGroup {
    ctor public SurfaceSyncGroup(@NonNull String);
    method @UiThread public boolean add(@Nullable android.view.AttachedSurfaceControl, @Nullable Runnable);
    method public boolean add(@NonNull android.view.SurfaceControlViewHost.SurfacePackage, @Nullable Runnable);
    method public void addTransaction(@NonNull android.view.SurfaceControl.Transaction);
    method public void markSyncReady();
  }
}
package javax.microedition.khronos.egl {
+2 −1
Original line number Diff line number Diff line
@@ -97,7 +97,8 @@ public class SurfaceControlViewHost {
        public ISurfaceSyncGroup getSurfaceSyncGroup() {
            CompletableFuture<ISurfaceSyncGroup> surfaceSyncGroup = new CompletableFuture<>();
            mViewRoot.mHandler.post(
                    () -> surfaceSyncGroup.complete(mViewRoot.getOrCreateSurfaceSyncGroup()));
                    () -> surfaceSyncGroup.complete(
                            mViewRoot.getOrCreateSurfaceSyncGroup().mISurfaceSyncGroup));
            try {
                return surfaceSyncGroup.get(1, TimeUnit.SECONDS);
            } catch (InterruptedException | ExecutionException | TimeoutException e) {
+1 −1
Original line number Diff line number Diff line
@@ -1091,7 +1091,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                t = syncBufferTransactionCallback.waitForTransaction();
            }

            surfaceSyncGroup.addTransactionToSync(t);
            surfaceSyncGroup.addTransaction(t);
            surfaceSyncGroup.markSyncReady();
            onDrawFinished();
        });
+5 −5
Original line number Diff line number Diff line
@@ -3768,7 +3768,7 @@ public final class ViewRootImpl implements ViewParent,
            Log.d(mTag, "Setup new sync=" + mWmsRequestSyncGroup.getName());
        }

        mWmsRequestSyncGroup.addToSync(this);
        mWmsRequestSyncGroup.add(this, null /* runnable */);
        Trace.traceEnd(Trace.TRACE_TAG_VIEW);
    }

@@ -11354,7 +11354,7 @@ public final class ViewRootImpl implements ViewParent,
                // pendingDrawFinished.
                if ((syncResult
                        & (SYNC_LOST_SURFACE_REWARD_IF_FOUND | SYNC_CONTEXT_IS_STOPPED)) != 0) {
                    surfaceSyncGroup.addTransactionToSync(
                    surfaceSyncGroup.addTransaction(
                            mBlastBufferQueue.gatherPendingTransactions(frame));
                    surfaceSyncGroup.markSyncReady();
                    return null;
@@ -11368,7 +11368,7 @@ public final class ViewRootImpl implements ViewParent,
                    mBlastBufferQueue.syncNextTransaction(new Consumer<Transaction>() {
                        @Override
                        public void accept(Transaction transaction) {
                            surfaceSyncGroup.addTransactionToSync(transaction);
                            surfaceSyncGroup.addTransaction(transaction);
                            surfaceSyncGroup.markSyncReady();
                        }
                    });
@@ -11391,7 +11391,7 @@ public final class ViewRootImpl implements ViewParent,
                        // since the frame didn't draw on this vsync. It's possible the frame will
                        // draw later, but it's better to not be sync than to block on a frame that
                        // may never come.
                        surfaceSyncGroup.addTransactionToSync(
                        surfaceSyncGroup.addTransaction(
                                mBlastBufferQueue.gatherPendingTransactions(frame));
                        surfaceSyncGroup.markSyncReady();
                        return;
@@ -11481,7 +11481,7 @@ public final class ViewRootImpl implements ViewParent,
        if (mActiveSurfaceSyncGroup == null) {
            return;
        }
        mActiveSurfaceSyncGroup.addToSync(syncable, false /* parentSyncGroupMerge */);
        mActiveSurfaceSyncGroup.add(syncable, null /* Runnable */);
    }

    @Override
+213 −117

File changed.

Preview size limit exceeded, changes collapsed.

Loading