Loading core/java/com/android/internal/policy/TransitionAnimation.java +11 −0 Original line number Diff line number Diff line Loading @@ -1297,6 +1297,17 @@ public class TransitionAnimation { return set; } /** Sets the default attributes of the screenshot layer used for animation. */ public static void configureScreenshotLayer(SurfaceControl.Transaction t, SurfaceControl layer, ScreenCapture.ScreenshotHardwareBuffer buffer) { t.setBuffer(layer, buffer.getHardwareBuffer()); t.setDataSpace(layer, buffer.getColorSpace().getDataSpace()); // Avoid showing dimming effect for HDR content when running animation. if (buffer.containsHdrLayers()) { t.setDimmingEnabled(layer, false); } } /** Returns whether the hardware buffer passed in is marked as protected. */ public static boolean hasProtectedContent(HardwareBuffer hardwareBuffer) { return (hardwareBuffer.getUsage() & HardwareBuffer.USAGE_PROTECTED_CONTENT) Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +3 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.animation.ValueAnimator; import android.annotation.NonNull; import android.content.Context; import android.graphics.Color; import android.graphics.ColorSpace; import android.graphics.Matrix; import android.graphics.Rect; import android.hardware.HardwareBuffer; Loading Loading @@ -162,13 +161,12 @@ class ScreenRotationAnimation { .setName("RotationLayer") .build(); final ColorSpace colorSpace = screenshotBuffer.getColorSpace(); TransitionAnimation.configureScreenshotLayer(t, mScreenshotLayer, screenshotBuffer); final HardwareBuffer hardwareBuffer = screenshotBuffer.getHardwareBuffer(); t.setDataSpace(mScreenshotLayer, colorSpace.getDataSpace()); t.setBuffer(mScreenshotLayer, hardwareBuffer); t.show(mScreenshotLayer); if (!isCustomRotate()) { mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, colorSpace); mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, screenshotBuffer.getColorSpace()); } hardwareBuffer.close(); } Loading services/core/java/com/android/server/wm/Transition.java +1 −3 Original line number Diff line number Diff line Loading @@ -2732,9 +2732,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { buffer, screenshotBuffer.getColorSpace()); } SurfaceControl.Transaction t = wc.mWmService.mTransactionFactory.get(); t.setBuffer(snapshotSurface, buffer); t.setDataSpace(snapshotSurface, screenshotBuffer.getColorSpace().getDataSpace()); TransitionAnimation.configureScreenshotLayer(t, snapshotSurface, screenshotBuffer); t.show(snapshotSurface); // Place it on top of anything else in the container. Loading Loading
core/java/com/android/internal/policy/TransitionAnimation.java +11 −0 Original line number Diff line number Diff line Loading @@ -1297,6 +1297,17 @@ public class TransitionAnimation { return set; } /** Sets the default attributes of the screenshot layer used for animation. */ public static void configureScreenshotLayer(SurfaceControl.Transaction t, SurfaceControl layer, ScreenCapture.ScreenshotHardwareBuffer buffer) { t.setBuffer(layer, buffer.getHardwareBuffer()); t.setDataSpace(layer, buffer.getColorSpace().getDataSpace()); // Avoid showing dimming effect for HDR content when running animation. if (buffer.containsHdrLayers()) { t.setDimmingEnabled(layer, false); } } /** Returns whether the hardware buffer passed in is marked as protected. */ public static boolean hasProtectedContent(HardwareBuffer hardwareBuffer) { return (hardwareBuffer.getUsage() & HardwareBuffer.USAGE_PROTECTED_CONTENT) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/ScreenRotationAnimation.java +3 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.animation.ValueAnimator; import android.annotation.NonNull; import android.content.Context; import android.graphics.Color; import android.graphics.ColorSpace; import android.graphics.Matrix; import android.graphics.Rect; import android.hardware.HardwareBuffer; Loading Loading @@ -162,13 +161,12 @@ class ScreenRotationAnimation { .setName("RotationLayer") .build(); final ColorSpace colorSpace = screenshotBuffer.getColorSpace(); TransitionAnimation.configureScreenshotLayer(t, mScreenshotLayer, screenshotBuffer); final HardwareBuffer hardwareBuffer = screenshotBuffer.getHardwareBuffer(); t.setDataSpace(mScreenshotLayer, colorSpace.getDataSpace()); t.setBuffer(mScreenshotLayer, hardwareBuffer); t.show(mScreenshotLayer); if (!isCustomRotate()) { mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, colorSpace); mStartLuma = TransitionAnimation.getBorderLuma(hardwareBuffer, screenshotBuffer.getColorSpace()); } hardwareBuffer.close(); } Loading
services/core/java/com/android/server/wm/Transition.java +1 −3 Original line number Diff line number Diff line Loading @@ -2732,9 +2732,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { buffer, screenshotBuffer.getColorSpace()); } SurfaceControl.Transaction t = wc.mWmService.mTransactionFactory.get(); t.setBuffer(snapshotSurface, buffer); t.setDataSpace(snapshotSurface, screenshotBuffer.getColorSpace().getDataSpace()); TransitionAnimation.configureScreenshotLayer(t, snapshotSurface, screenshotBuffer); t.show(snapshotSurface); // Place it on top of anything else in the container. Loading