Loading quickstep/src/com/android/quickstep/ViewUtils.java +7 −5 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ package com.android.quickstep; import android.graphics.HardwareRenderer; import android.os.Handler; import android.view.View; import android.view.ViewRootImpl; import com.android.launcher3.Utilities; import com.android.systemui.shared.system.ViewRootImplCompat; Loading Loading @@ -45,9 +47,9 @@ public class ViewUtils { return new FrameHandler(view, onFinishRunnable, canceled).schedule(); } private static class FrameHandler implements LongConsumer { private static class FrameHandler implements HardwareRenderer.FrameDrawingCallback { final ViewRootImplCompat mViewRoot; final ViewRootImpl mViewRoot; final Runnable mFinishCallback; final BooleanSupplier mCancelled; final Handler mHandler; Loading @@ -55,14 +57,14 @@ public class ViewUtils { int mDeferFrameCount = 1; FrameHandler(View view, Runnable finishCallback, BooleanSupplier cancelled) { mViewRoot = new ViewRootImplCompat(view); mViewRoot = view.getViewRootImpl(); mFinishCallback = finishCallback; mCancelled = cancelled; mHandler = new Handler(); } @Override public void accept(long l) { public void onFrameDraw(long frame) { Utilities.postAsyncCallback(mHandler, this::onFrame); } Loading @@ -83,7 +85,7 @@ public class ViewUtils { } private boolean schedule() { if (mViewRoot.isValid()) { if (mViewRoot.getView() != null) { mViewRoot.registerRtFrameCallback(this); mViewRoot.getView().invalidate(); return true; Loading quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java +5 −5 Original line number Diff line number Diff line Loading @@ -22,10 +22,10 @@ import android.os.Message; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.view.View; import android.view.ViewRootImpl; import com.android.quickstep.RemoteAnimationTargets.ReleaseCheck; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams; import com.android.systemui.shared.system.ViewRootImplCompat; import java.util.function.Consumer; Loading @@ -41,7 +41,7 @@ public class SurfaceTransactionApplier extends ReleaseCheck { private static final int MSG_UPDATE_SEQUENCE_NUMBER = 0; private final SurfaceControl mBarrierSurfaceControl; private final ViewRootImplCompat mTargetViewRootImpl; private final ViewRootImpl mTargetViewRootImpl; private final Handler mApplyHandler; private int mLastSequenceNumber = 0; Loading @@ -50,8 +50,8 @@ public class SurfaceTransactionApplier extends ReleaseCheck { * @param targetView The view in the surface that acts as synchronization anchor. */ public SurfaceTransactionApplier(View targetView) { mTargetViewRootImpl = new ViewRootImplCompat(targetView); mBarrierSurfaceControl = mTargetViewRootImpl.getRenderSurfaceControl(); mTargetViewRootImpl = targetView.getViewRootImpl(); mBarrierSurfaceControl = mTargetViewRootImpl.getSurfaceControl(); mApplyHandler = new Handler(this::onApplyMessage); } Loading Loading @@ -109,7 +109,7 @@ public class SurfaceTransactionApplier extends ReleaseCheck { if (targetView == null) { // No target view, no applier callback.accept(null); } else if (new ViewRootImplCompat(targetView).isValid()) { } else if (targetView.isAttachedToWindow()) { // Already attached, we're good to go callback.accept(new SurfaceTransactionApplier(targetView)); } else { Loading Loading
quickstep/src/com/android/quickstep/ViewUtils.java +7 −5 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ package com.android.quickstep; import android.graphics.HardwareRenderer; import android.os.Handler; import android.view.View; import android.view.ViewRootImpl; import com.android.launcher3.Utilities; import com.android.systemui.shared.system.ViewRootImplCompat; Loading Loading @@ -45,9 +47,9 @@ public class ViewUtils { return new FrameHandler(view, onFinishRunnable, canceled).schedule(); } private static class FrameHandler implements LongConsumer { private static class FrameHandler implements HardwareRenderer.FrameDrawingCallback { final ViewRootImplCompat mViewRoot; final ViewRootImpl mViewRoot; final Runnable mFinishCallback; final BooleanSupplier mCancelled; final Handler mHandler; Loading @@ -55,14 +57,14 @@ public class ViewUtils { int mDeferFrameCount = 1; FrameHandler(View view, Runnable finishCallback, BooleanSupplier cancelled) { mViewRoot = new ViewRootImplCompat(view); mViewRoot = view.getViewRootImpl(); mFinishCallback = finishCallback; mCancelled = cancelled; mHandler = new Handler(); } @Override public void accept(long l) { public void onFrameDraw(long frame) { Utilities.postAsyncCallback(mHandler, this::onFrame); } Loading @@ -83,7 +85,7 @@ public class ViewUtils { } private boolean schedule() { if (mViewRoot.isValid()) { if (mViewRoot.getView() != null) { mViewRoot.registerRtFrameCallback(this); mViewRoot.getView().invalidate(); return true; Loading
quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java +5 −5 Original line number Diff line number Diff line Loading @@ -22,10 +22,10 @@ import android.os.Message; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.view.View; import android.view.ViewRootImpl; import com.android.quickstep.RemoteAnimationTargets.ReleaseCheck; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams; import com.android.systemui.shared.system.ViewRootImplCompat; import java.util.function.Consumer; Loading @@ -41,7 +41,7 @@ public class SurfaceTransactionApplier extends ReleaseCheck { private static final int MSG_UPDATE_SEQUENCE_NUMBER = 0; private final SurfaceControl mBarrierSurfaceControl; private final ViewRootImplCompat mTargetViewRootImpl; private final ViewRootImpl mTargetViewRootImpl; private final Handler mApplyHandler; private int mLastSequenceNumber = 0; Loading @@ -50,8 +50,8 @@ public class SurfaceTransactionApplier extends ReleaseCheck { * @param targetView The view in the surface that acts as synchronization anchor. */ public SurfaceTransactionApplier(View targetView) { mTargetViewRootImpl = new ViewRootImplCompat(targetView); mBarrierSurfaceControl = mTargetViewRootImpl.getRenderSurfaceControl(); mTargetViewRootImpl = targetView.getViewRootImpl(); mBarrierSurfaceControl = mTargetViewRootImpl.getSurfaceControl(); mApplyHandler = new Handler(this::onApplyMessage); } Loading Loading @@ -109,7 +109,7 @@ public class SurfaceTransactionApplier extends ReleaseCheck { if (targetView == null) { // No target view, no applier callback.accept(null); } else if (new ViewRootImplCompat(targetView).isValid()) { } else if (targetView.isAttachedToWindow()) { // Already attached, we're good to go callback.accept(new SurfaceTransactionApplier(targetView)); } else { Loading