Loading core/java/android/view/SurfaceView.java +1 −1 Original line number Diff line number Diff line Loading @@ -1340,7 +1340,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall mSurfaceControl = new SurfaceControl.Builder(mSurfaceSession) .setName(name) .setLocalOwnerView(this) .setParent(viewRoot.getBoundsLayer()) .setParent(viewRoot.updateAndGetBoundsLayer(surfaceUpdateTransaction)) .setCallsite("SurfaceView.updateSurface") .setContainerLayer() .build(); Loading core/java/android/view/ViewRootImpl.java +8 −7 Original line number Diff line number Diff line Loading @@ -716,9 +716,9 @@ public final class ViewRootImpl implements ViewParent, /** * Child container layer of {@code mSurface} with the same bounds as its parent, and cropped to * the surface insets. This surface is created only if a client requests it via {@link * #getBoundsLayer()}. By parenting to this bounds surface, child surfaces can ensure they do * not draw into the surface inset region set by the parent window. * the surface insets. This surface is created only if a client requests it via * {@link #updateAndGetBoundsLayer(Transaction)}. By parenting to this bounds surface, child * surfaces can ensure they do not draw into the surface inset region set by the parent window. */ private SurfaceControl mBoundsLayer; private final SurfaceSession mSurfaceSession = new SurfaceSession(); Loading Loading @@ -2262,7 +2262,7 @@ public final class ViewRootImpl implements ViewParent, * <p>Parenting to this layer will ensure that its children are cropped by the view's surface * insets. */ public SurfaceControl getBoundsLayer() { public SurfaceControl updateAndGetBoundsLayer(Transaction t) { if (mBoundsLayer == null) { mBoundsLayer = new SurfaceControl.Builder(mSurfaceSession) .setContainerLayer() Loading @@ -2270,8 +2270,8 @@ public final class ViewRootImpl implements ViewParent, .setParent(getSurfaceControl()) .setCallsite("ViewRootImpl.getBoundsLayer") .build(); setBoundsLayerCrop(mTransaction); mTransaction.show(mBoundsLayer).apply(); setBoundsLayerCrop(t); t.show(mBoundsLayer); } return mBoundsLayer; } Loading Loading @@ -11188,7 +11188,8 @@ public final class ViewRootImpl implements ViewParent, @Nullable public SurfaceControl.Transaction buildReparentTransaction( @NonNull SurfaceControl child) { if (mSurfaceControl.isValid()) { return new SurfaceControl.Transaction().reparent(child, getBoundsLayer()); Transaction t = new Transaction(); return t.reparent(child, updateAndGetBoundsLayer(t)); } return null; } Loading Loading
core/java/android/view/SurfaceView.java +1 −1 Original line number Diff line number Diff line Loading @@ -1340,7 +1340,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall mSurfaceControl = new SurfaceControl.Builder(mSurfaceSession) .setName(name) .setLocalOwnerView(this) .setParent(viewRoot.getBoundsLayer()) .setParent(viewRoot.updateAndGetBoundsLayer(surfaceUpdateTransaction)) .setCallsite("SurfaceView.updateSurface") .setContainerLayer() .build(); Loading
core/java/android/view/ViewRootImpl.java +8 −7 Original line number Diff line number Diff line Loading @@ -716,9 +716,9 @@ public final class ViewRootImpl implements ViewParent, /** * Child container layer of {@code mSurface} with the same bounds as its parent, and cropped to * the surface insets. This surface is created only if a client requests it via {@link * #getBoundsLayer()}. By parenting to this bounds surface, child surfaces can ensure they do * not draw into the surface inset region set by the parent window. * the surface insets. This surface is created only if a client requests it via * {@link #updateAndGetBoundsLayer(Transaction)}. By parenting to this bounds surface, child * surfaces can ensure they do not draw into the surface inset region set by the parent window. */ private SurfaceControl mBoundsLayer; private final SurfaceSession mSurfaceSession = new SurfaceSession(); Loading Loading @@ -2262,7 +2262,7 @@ public final class ViewRootImpl implements ViewParent, * <p>Parenting to this layer will ensure that its children are cropped by the view's surface * insets. */ public SurfaceControl getBoundsLayer() { public SurfaceControl updateAndGetBoundsLayer(Transaction t) { if (mBoundsLayer == null) { mBoundsLayer = new SurfaceControl.Builder(mSurfaceSession) .setContainerLayer() Loading @@ -2270,8 +2270,8 @@ public final class ViewRootImpl implements ViewParent, .setParent(getSurfaceControl()) .setCallsite("ViewRootImpl.getBoundsLayer") .build(); setBoundsLayerCrop(mTransaction); mTransaction.show(mBoundsLayer).apply(); setBoundsLayerCrop(t); t.show(mBoundsLayer); } return mBoundsLayer; } Loading Loading @@ -11188,7 +11188,8 @@ public final class ViewRootImpl implements ViewParent, @Nullable public SurfaceControl.Transaction buildReparentTransaction( @NonNull SurfaceControl child) { if (mSurfaceControl.isValid()) { return new SurfaceControl.Transaction().reparent(child, getBoundsLayer()); Transaction t = new Transaction(); return t.reparent(child, updateAndGetBoundsLayer(t)); } return null; } Loading