Loading core/java/android/view/SurfaceControl.java +31 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,10 @@ public class SurfaceControl implements Parcelable { * Good practice is to first create the surface with the {@link #HIDDEN} flag * specified, open a transaction, set the surface layer, layer stack, alpha, * and position, call {@link #show} if appropriate, and close the transaction. * <p> * Bounds of the surface is determined by its crop and its buffer size. If the * surface has no buffer or crop, the surface is boundless and only constrained * by the size of its parent bounds. * * @param session The surface session, must not be null. * @param name The surface name, must not be null. Loading Loading @@ -959,6 +963,14 @@ public class SurfaceControl implements Parcelable { } } /** * Bounds the surface and its children to the bounds specified. Size of the surface will be * ignored and only the crop and buffer size will be used to determine the bounds of the * surface. If no crop is specified and the surface has no buffer, the surface bounds is only * constrained by the size of its parent bounds. * * @param crop Bounds of the crop to apply. */ public void setWindowCrop(Rect crop) { checkNotReleased(); synchronized (SurfaceControl.class) { Loading @@ -966,6 +978,19 @@ public class SurfaceControl implements Parcelable { } } /** * Same as {@link SurfaceControl#setWindowCrop(Rect)} but sets the crop rect top left at 0, 0. * * @param width width of crop rect * @param height height of crop rect */ public void setWindowCrop(int width, int height) { checkNotReleased(); synchronized (SurfaceControl.class) { sGlobalTransaction.setWindowCrop(this, width, height); } } public void setLayerStack(int layerStack) { checkNotReleased(); synchronized(SurfaceControl.class) { Loading Loading @@ -1477,6 +1502,12 @@ public class SurfaceControl implements Parcelable { return this; } public Transaction setWindowCrop(SurfaceControl sc, int width, int height) { sc.checkNotReleased(); nativeSetWindowCrop(mNativeObject, sc.mNativeObject, 0, 0, width, height); return this; } @UnsupportedAppUsage public Transaction setLayerStack(SurfaceControl sc, int layerStack) { sc.checkNotReleased(); Loading core/java/android/view/SurfaceView.java +7 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb } if (sizeChanged && !creating) { mSurfaceControl.setSize(mSurfaceWidth, mSurfaceHeight); mSurfaceControl.setWindowCrop(mSurfaceWidth, mSurfaceHeight); } } finally { SurfaceControl.closeTransaction(); Loading Loading @@ -1168,6 +1169,12 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb mBackgroundControl.setWindowCrop(crop); } @Override public void setWindowCrop(int width, int height) { super.setWindowCrop(width, height); mBackgroundControl.setWindowCrop(width, height); } @Override public void setLayerStack(int layerStack) { super.setLayerStack(layerStack); Loading services/core/java/com/android/server/wm/AppWindowToken.java +1 −0 Original line number Diff line number Diff line Loading @@ -1749,6 +1749,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree .setName(getSurfaceControl() + " - animation-bounds") .setSize(getSurfaceWidth(), getSurfaceHeight()); final SurfaceControl boundsLayer = builder.build(); t.setWindowCrop(boundsLayer, getSurfaceWidth(), getSurfaceHeight()); t.show(boundsLayer); return boundsLayer; } Loading services/core/java/com/android/server/wm/BlackFrame.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class BlackFrame { .setColorLayer(true) .setParent(null) // TODO: Work-around for b/69259549 .build(); transaction.setWindowCrop(surface, w, h); transaction.setLayerStack(surface, dc.getDisplayId()); transaction.setAlpha(surface, 1); transaction.setLayer(surface, layer); Loading services/core/java/com/android/server/wm/Dimmer.java +1 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ class Dimmer { // TODO: Once we use geometry from hierarchy this falls away. t.setSize(mDimState.mDimLayer, bounds.width(), bounds.height()); t.setPosition(mDimState.mDimLayer, bounds.left, bounds.top); t.setWindowCrop(mDimState.mDimLayer, bounds.width(), bounds.height()); if (!mDimState.isVisible) { mDimState.isVisible = true; t.show(mDimState.mDimLayer); Loading Loading
core/java/android/view/SurfaceControl.java +31 −0 Original line number Diff line number Diff line Loading @@ -572,6 +572,10 @@ public class SurfaceControl implements Parcelable { * Good practice is to first create the surface with the {@link #HIDDEN} flag * specified, open a transaction, set the surface layer, layer stack, alpha, * and position, call {@link #show} if appropriate, and close the transaction. * <p> * Bounds of the surface is determined by its crop and its buffer size. If the * surface has no buffer or crop, the surface is boundless and only constrained * by the size of its parent bounds. * * @param session The surface session, must not be null. * @param name The surface name, must not be null. Loading Loading @@ -959,6 +963,14 @@ public class SurfaceControl implements Parcelable { } } /** * Bounds the surface and its children to the bounds specified. Size of the surface will be * ignored and only the crop and buffer size will be used to determine the bounds of the * surface. If no crop is specified and the surface has no buffer, the surface bounds is only * constrained by the size of its parent bounds. * * @param crop Bounds of the crop to apply. */ public void setWindowCrop(Rect crop) { checkNotReleased(); synchronized (SurfaceControl.class) { Loading @@ -966,6 +978,19 @@ public class SurfaceControl implements Parcelable { } } /** * Same as {@link SurfaceControl#setWindowCrop(Rect)} but sets the crop rect top left at 0, 0. * * @param width width of crop rect * @param height height of crop rect */ public void setWindowCrop(int width, int height) { checkNotReleased(); synchronized (SurfaceControl.class) { sGlobalTransaction.setWindowCrop(this, width, height); } } public void setLayerStack(int layerStack) { checkNotReleased(); synchronized(SurfaceControl.class) { Loading Loading @@ -1477,6 +1502,12 @@ public class SurfaceControl implements Parcelable { return this; } public Transaction setWindowCrop(SurfaceControl sc, int width, int height) { sc.checkNotReleased(); nativeSetWindowCrop(mNativeObject, sc.mNativeObject, 0, 0, width, height); return this; } @UnsupportedAppUsage public Transaction setLayerStack(SurfaceControl sc, int layerStack) { sc.checkNotReleased(); Loading
core/java/android/view/SurfaceView.java +7 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb } if (sizeChanged && !creating) { mSurfaceControl.setSize(mSurfaceWidth, mSurfaceHeight); mSurfaceControl.setWindowCrop(mSurfaceWidth, mSurfaceHeight); } } finally { SurfaceControl.closeTransaction(); Loading Loading @@ -1168,6 +1169,12 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb mBackgroundControl.setWindowCrop(crop); } @Override public void setWindowCrop(int width, int height) { super.setWindowCrop(width, height); mBackgroundControl.setWindowCrop(width, height); } @Override public void setLayerStack(int layerStack) { super.setLayerStack(layerStack); Loading
services/core/java/com/android/server/wm/AppWindowToken.java +1 −0 Original line number Diff line number Diff line Loading @@ -1749,6 +1749,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree .setName(getSurfaceControl() + " - animation-bounds") .setSize(getSurfaceWidth(), getSurfaceHeight()); final SurfaceControl boundsLayer = builder.build(); t.setWindowCrop(boundsLayer, getSurfaceWidth(), getSurfaceHeight()); t.show(boundsLayer); return boundsLayer; } Loading
services/core/java/com/android/server/wm/BlackFrame.java +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class BlackFrame { .setColorLayer(true) .setParent(null) // TODO: Work-around for b/69259549 .build(); transaction.setWindowCrop(surface, w, h); transaction.setLayerStack(surface, dc.getDisplayId()); transaction.setAlpha(surface, 1); transaction.setLayer(surface, layer); Loading
services/core/java/com/android/server/wm/Dimmer.java +1 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ class Dimmer { // TODO: Once we use geometry from hierarchy this falls away. t.setSize(mDimState.mDimLayer, bounds.width(), bounds.height()); t.setPosition(mDimState.mDimLayer, bounds.left, bounds.top); t.setWindowCrop(mDimState.mDimLayer, bounds.width(), bounds.height()); if (!mDimState.isVisible) { mDimState.isVisible = true; t.show(mDimState.mDimLayer); Loading