Loading services/core/java/com/android/server/wm/AccessibilityController.java +2 −2 Original line number Diff line number Diff line Loading @@ -814,7 +814,7 @@ final class AccessibilityController { private final Paint mPaint = new Paint(); private final SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private final Surface mSurface = mService.mSurfaceFactory.get(); private final AnimationController mAnimationController; Loading Loading @@ -967,7 +967,7 @@ final class AccessibilityController { } public void releaseSurface() { mService.mTransactionFactory.make().remove(mSurfaceControl).apply(); mService.mTransactionFactory.get().remove(mSurfaceControl).apply(); mSurface.release(); } Loading services/core/java/com/android/server/wm/AppWindowThumbnail.java +8 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import android.view.animation.Animation; import com.android.server.wm.SurfaceAnimator.Animatable; import java.util.function.Supplier; /** * Represents a surface that is displayed over an {@link AppWindowToken} */ Loading @@ -55,8 +57,9 @@ class AppWindowThumbnail implements Animatable { private final int mHeight; private final boolean mRelative; AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { this(t, appToken, thumbnailHeader, false /* relative */); AppWindowThumbnail(Supplier<Surface> surfaceFactory, Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { this(surfaceFactory, t, appToken, thumbnailHeader, false /* relative */); } /** Loading @@ -66,9 +69,9 @@ class AppWindowThumbnail implements Animatable { * @param relative Whether this thumbnail will be a child of appToken (and thus positioned * relative to it) or not. */ AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, boolean relative) { this(t, appToken, thumbnailHeader, relative, new Surface(), null); AppWindowThumbnail(Supplier<Surface> surfaceFactory, Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, boolean relative) { this(t, appToken, thumbnailHeader, relative, surfaceFactory.get(), null); } AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, Loading services/core/java/com/android/server/wm/AppWindowToken.java +8 −5 Original line number Diff line number Diff line Loading @@ -1793,8 +1793,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree mWmService.mTaskSnapshotController.createTaskSnapshot( task, 1 /* scaleFraction */); if (snapshot != null) { mThumbnail = new AppWindowThumbnail(t, this, snapshot.getGraphicBuffer(), true /* relative */); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, t, this, snapshot.getGraphicBuffer(), true /* relative */); } } } Loading Loading @@ -2033,7 +2033,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final boolean needsLetterbox = surfaceReady && w.isLetterboxedAppWindow() && fillsParent(); if (needsLetterbox) { if (mLetterbox == null) { mLetterbox = new Letterbox(() -> makeChildSurface(null)); mLetterbox = new Letterbox(() -> makeChildSurface(null), mWmService.mTransactionFactory); mLetterbox.attachInput(w); } getPosition(mTmpPoint); Loading Loading @@ -2981,7 +2982,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return; } clearThumbnail(); mThumbnail = new AppWindowThumbnail(getPendingTransaction(), this, thumbnailHeader); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, getPendingTransaction(), this, thumbnailHeader); mThumbnail.startAnimation(getPendingTransaction(), loadThumbnailAnimation(thumbnailHeader)); } Loading Loading @@ -3009,7 +3011,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (thumbnail == null) { return; } mThumbnail = new AppWindowThumbnail(getPendingTransaction(), this, thumbnail); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, getPendingTransaction(), this, thumbnail); final Animation animation = getDisplayContent().mAppTransition.createCrossProfileAppsThumbnailAnimationLocked( win.getFrameLw()); Loading services/core/java/com/android/server/wm/BlackFrame.java +5 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import java.io.PrintWriter; import java.util.function.Supplier; /** * Four black surfaces put together to make a black frame. Loading Loading @@ -97,7 +98,7 @@ public class BlackFrame { final BlackSurface[] mBlackSurfaces = new BlackSurface[4]; final boolean mForceDefaultOrientation; private final TransactionFactory mTransactionFactory; private final Supplier<SurfaceControl.Transaction> mTransactionFactory; public void printTo(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("Outer: "); mOuterRect.printShortString(pw); Loading @@ -112,8 +113,8 @@ public class BlackFrame { } } public BlackFrame(TransactionFactory factory, SurfaceControl.Transaction t, Rect outer, Rect inner, int layer, DisplayContent dc, boolean forceDefaultOrientation) public BlackFrame(Supplier<SurfaceControl.Transaction> factory, SurfaceControl.Transaction t, Rect outer, Rect inner, int layer, DisplayContent dc, boolean forceDefaultOrientation) throws OutOfResourcesException { boolean success = false; Loading Loading @@ -151,7 +152,7 @@ public class BlackFrame { public void kill() { if (mBlackSurfaces != null) { SurfaceControl.Transaction t = mTransactionFactory.make(); SurfaceControl.Transaction t = mTransactionFactory.get(); for (int i=0; i<mBlackSurfaces.length; i++) { if (mBlackSurfaces[i] != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM, Loading services/core/java/com/android/server/wm/CircularDisplayMask.java +5 −3 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import android.view.Surface; import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import java.util.function.Supplier; class CircularDisplayMask { private static final String TAG = TAG_WITH_CLASS_NAME ? "CircularDisplayMask" : TAG_WM; Loading @@ -43,7 +45,7 @@ class CircularDisplayMask { private Point mScreenSize; private final SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private final Surface mSurface; private int mLastDW; private int mLastDH; private boolean mDrawNeeded; Loading @@ -53,10 +55,10 @@ class CircularDisplayMask { private boolean mDimensionsUnequal = false; private int mMaskThickness; public CircularDisplayMask(DisplayContent dc, int zOrder, CircularDisplayMask(Supplier<Surface> surfaceFactory, DisplayContent dc, int zOrder, int screenOffset, int maskThickness) { final Display display = dc.getDisplay(); mSurface = surfaceFactory.get(); mScreenSize = new Point(); display.getSize(mScreenSize); if (mScreenSize.x != mScreenSize.y + screenOffset) { Loading Loading
services/core/java/com/android/server/wm/AccessibilityController.java +2 −2 Original line number Diff line number Diff line Loading @@ -814,7 +814,7 @@ final class AccessibilityController { private final Paint mPaint = new Paint(); private final SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private final Surface mSurface = mService.mSurfaceFactory.get(); private final AnimationController mAnimationController; Loading Loading @@ -967,7 +967,7 @@ final class AccessibilityController { } public void releaseSurface() { mService.mTransactionFactory.make().remove(mSurfaceControl).apply(); mService.mTransactionFactory.get().remove(mSurfaceControl).apply(); mSurface.release(); } Loading
services/core/java/com/android/server/wm/AppWindowThumbnail.java +8 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import android.view.animation.Animation; import com.android.server.wm.SurfaceAnimator.Animatable; import java.util.function.Supplier; /** * Represents a surface that is displayed over an {@link AppWindowToken} */ Loading @@ -55,8 +57,9 @@ class AppWindowThumbnail implements Animatable { private final int mHeight; private final boolean mRelative; AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { this(t, appToken, thumbnailHeader, false /* relative */); AppWindowThumbnail(Supplier<Surface> surfaceFactory, Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { this(surfaceFactory, t, appToken, thumbnailHeader, false /* relative */); } /** Loading @@ -66,9 +69,9 @@ class AppWindowThumbnail implements Animatable { * @param relative Whether this thumbnail will be a child of appToken (and thus positioned * relative to it) or not. */ AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, boolean relative) { this(t, appToken, thumbnailHeader, relative, new Surface(), null); AppWindowThumbnail(Supplier<Surface> surfaceFactory, Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, boolean relative) { this(t, appToken, thumbnailHeader, relative, surfaceFactory.get(), null); } AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader, Loading
services/core/java/com/android/server/wm/AppWindowToken.java +8 −5 Original line number Diff line number Diff line Loading @@ -1793,8 +1793,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree mWmService.mTaskSnapshotController.createTaskSnapshot( task, 1 /* scaleFraction */); if (snapshot != null) { mThumbnail = new AppWindowThumbnail(t, this, snapshot.getGraphicBuffer(), true /* relative */); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, t, this, snapshot.getGraphicBuffer(), true /* relative */); } } } Loading Loading @@ -2033,7 +2033,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final boolean needsLetterbox = surfaceReady && w.isLetterboxedAppWindow() && fillsParent(); if (needsLetterbox) { if (mLetterbox == null) { mLetterbox = new Letterbox(() -> makeChildSurface(null)); mLetterbox = new Letterbox(() -> makeChildSurface(null), mWmService.mTransactionFactory); mLetterbox.attachInput(w); } getPosition(mTmpPoint); Loading Loading @@ -2981,7 +2982,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return; } clearThumbnail(); mThumbnail = new AppWindowThumbnail(getPendingTransaction(), this, thumbnailHeader); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, getPendingTransaction(), this, thumbnailHeader); mThumbnail.startAnimation(getPendingTransaction(), loadThumbnailAnimation(thumbnailHeader)); } Loading Loading @@ -3009,7 +3011,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (thumbnail == null) { return; } mThumbnail = new AppWindowThumbnail(getPendingTransaction(), this, thumbnail); mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, getPendingTransaction(), this, thumbnail); final Animation animation = getDisplayContent().mAppTransition.createCrossProfileAppsThumbnailAnimationLocked( win.getFrameLw()); Loading
services/core/java/com/android/server/wm/BlackFrame.java +5 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import java.io.PrintWriter; import java.util.function.Supplier; /** * Four black surfaces put together to make a black frame. Loading Loading @@ -97,7 +98,7 @@ public class BlackFrame { final BlackSurface[] mBlackSurfaces = new BlackSurface[4]; final boolean mForceDefaultOrientation; private final TransactionFactory mTransactionFactory; private final Supplier<SurfaceControl.Transaction> mTransactionFactory; public void printTo(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("Outer: "); mOuterRect.printShortString(pw); Loading @@ -112,8 +113,8 @@ public class BlackFrame { } } public BlackFrame(TransactionFactory factory, SurfaceControl.Transaction t, Rect outer, Rect inner, int layer, DisplayContent dc, boolean forceDefaultOrientation) public BlackFrame(Supplier<SurfaceControl.Transaction> factory, SurfaceControl.Transaction t, Rect outer, Rect inner, int layer, DisplayContent dc, boolean forceDefaultOrientation) throws OutOfResourcesException { boolean success = false; Loading Loading @@ -151,7 +152,7 @@ public class BlackFrame { public void kill() { if (mBlackSurfaces != null) { SurfaceControl.Transaction t = mTransactionFactory.make(); SurfaceControl.Transaction t = mTransactionFactory.get(); for (int i=0; i<mBlackSurfaces.length; i++) { if (mBlackSurfaces[i] != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM, Loading
services/core/java/com/android/server/wm/CircularDisplayMask.java +5 −3 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import android.view.Surface; import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import java.util.function.Supplier; class CircularDisplayMask { private static final String TAG = TAG_WITH_CLASS_NAME ? "CircularDisplayMask" : TAG_WM; Loading @@ -43,7 +45,7 @@ class CircularDisplayMask { private Point mScreenSize; private final SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); private final Surface mSurface; private int mLastDW; private int mLastDH; private boolean mDrawNeeded; Loading @@ -53,10 +55,10 @@ class CircularDisplayMask { private boolean mDimensionsUnequal = false; private int mMaskThickness; public CircularDisplayMask(DisplayContent dc, int zOrder, CircularDisplayMask(Supplier<Surface> surfaceFactory, DisplayContent dc, int zOrder, int screenOffset, int maskThickness) { final Display display = dc.getDisplay(); mSurface = surfaceFactory.get(); mScreenSize = new Point(); display.getSize(mScreenSize); if (mScreenSize.x != mScreenSize.y + screenOffset) { Loading