Loading core/java/com/android/internal/policy/TransitionAnimation.java +15 −0 Original line number Diff line number Diff line Loading @@ -1299,6 +1299,21 @@ public class TransitionAnimation { == HardwareBuffer.USAGE_PROTECTED_CONTENT; } /** * Returns the luminance in 0~1. The surface control is the source of the hardware buffer, * which will be used if the buffer is protected from reading. */ public static float getBorderLuma(@NonNull HardwareBuffer hwBuffer, @NonNull ColorSpace colorSpace, @NonNull SurfaceControl sourceSurfaceControl) { if (hasProtectedContent(hwBuffer)) { // The buffer cannot be read. Capture another buffer which excludes protected content // from the source surface. return getBorderLuma(sourceSurfaceControl, hwBuffer.getWidth(), hwBuffer.getHeight()); } // Use the existing buffer directly. return getBorderLuma(hwBuffer, colorSpace); } /** Returns the luminance in 0~1. */ public static float getBorderLuma(SurfaceControl surfaceControl, int w, int h) { final ScreenCapture.ScreenshotHardwareBuffer buffer = Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ class ScreenRotationAnimation { t.show(mScreenshotLayer); if (!isCustomRotate()) { mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, screenshotBuffer.getColorSpace()); screenshotBuffer.getColorSpace(), mSurfaceControl); } hardwareBuffer.close(); } Loading services/core/java/com/android/server/wm/Transition.java +1 −1 Original line number Diff line number Diff line Loading @@ -3787,7 +3787,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { if (changeInfo.mRotation != wc.mDisplayContent.getRotation()) { // This isn't cheap, so only do it for rotation change. changeInfo.mSnapshotLuma = TransitionAnimation.getBorderLuma( buffer, screenshotBuffer.getColorSpace()); buffer, screenshotBuffer.getColorSpace(), wc.mSurfaceControl); } SurfaceControl.Transaction t = wc.mWmService.mTransactionFactory.get(); TransitionAnimation.configureScreenshotLayer(t, snapshotSurface, screenshotBuffer); Loading Loading
core/java/com/android/internal/policy/TransitionAnimation.java +15 −0 Original line number Diff line number Diff line Loading @@ -1299,6 +1299,21 @@ public class TransitionAnimation { == HardwareBuffer.USAGE_PROTECTED_CONTENT; } /** * Returns the luminance in 0~1. The surface control is the source of the hardware buffer, * which will be used if the buffer is protected from reading. */ public static float getBorderLuma(@NonNull HardwareBuffer hwBuffer, @NonNull ColorSpace colorSpace, @NonNull SurfaceControl sourceSurfaceControl) { if (hasProtectedContent(hwBuffer)) { // The buffer cannot be read. Capture another buffer which excludes protected content // from the source surface. return getBorderLuma(sourceSurfaceControl, hwBuffer.getWidth(), hwBuffer.getHeight()); } // Use the existing buffer directly. return getBorderLuma(hwBuffer, colorSpace); } /** Returns the luminance in 0~1. */ public static float getBorderLuma(SurfaceControl surfaceControl, int w, int h) { final ScreenCapture.ScreenshotHardwareBuffer buffer = Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ class ScreenRotationAnimation { t.show(mScreenshotLayer); if (!isCustomRotate()) { mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, screenshotBuffer.getColorSpace()); screenshotBuffer.getColorSpace(), mSurfaceControl); } hardwareBuffer.close(); } Loading
services/core/java/com/android/server/wm/Transition.java +1 −1 Original line number Diff line number Diff line Loading @@ -3787,7 +3787,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { if (changeInfo.mRotation != wc.mDisplayContent.getRotation()) { // This isn't cheap, so only do it for rotation change. changeInfo.mSnapshotLuma = TransitionAnimation.getBorderLuma( buffer, screenshotBuffer.getColorSpace()); buffer, screenshotBuffer.getColorSpace(), wc.mSurfaceControl); } SurfaceControl.Transaction t = wc.mWmService.mTransactionFactory.get(); TransitionAnimation.configureScreenshotLayer(t, snapshotSurface, screenshotBuffer); Loading