Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd06e577 authored by Kshitij's avatar Kshitij Committed by Nishith Khanna
Browse files

base: wm: Set screen rotation backdrop to black

- AOSP calculates luma of the screenshots to pick a greyscale
  colour for the backdrop.
- We would like this to be fixed to a black color
parent ff6c3287
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ class ScreenRotationAnimation {
                        .build();

                t.setLayer(mBackColorSurface, -1);
                t.setColor(mBackColorSurface, new float[]{mStartLuma, mStartLuma, mStartLuma});
                t.setColor(mBackColorSurface, new float[]{0.0f, 0.0f, 0.0f});
                t.show(mBackColorSurface);
            }

@@ -345,8 +345,8 @@ class ScreenRotationAnimation {
        int colorTransitionMs = mContext.getResources().getInteger(
                R.integer.config_screen_rotation_color_transition);
        final float[] rgbTmpFloat = new float[3];
        final int startColor = Color.rgb(mStartLuma, mStartLuma, mStartLuma);
        final int endColor = Color.rgb(mEndLuma, mEndLuma, mEndLuma);
        final int startColor = Color.rgb(0, 0, 0);
        final int endColor = Color.rgb(0, 0, 0);
        final long duration = colorTransitionMs * (long) animationScale;
        final Transaction t = mTransactionPool.acquire();

+3 −3
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ class ScreenRotationAnimation {
            // disable dimming effect to get avoid of hdr content being dimmed during animation.
            t.setDimmingEnabled(mScreenshotLayer, !screenshotBuffer.containsHdrLayers());
            t.setLayer(mBackColorSurface, -1);
            t.setColor(mBackColorSurface, new float[]{mStartLuma, mStartLuma, mStartLuma});
            t.setColor(mBackColorSurface, new float[]{0.0f, 0.0f, 0.0f});
            t.setAlpha(mBackColorSurface, 1);
            t.setBuffer(mScreenshotLayer, hardwareBuffer);
            t.setColorSpace(mScreenshotLayer, screenshotBuffer.getColorSpace());
@@ -714,8 +714,8 @@ class ScreenRotationAnimation {
                    R.integer.config_screen_rotation_color_transition);
            final SurfaceAnimationRunner runner = mService.mSurfaceAnimationRunner;
            final float[] rgbTmpFloat = new float[3];
            final int startColor = Color.rgb(mStartLuma, mStartLuma, mStartLuma);
            final int endColor = Color.rgb(mEndLuma, mEndLuma, mEndLuma);
            final int startColor = Color.rgb(0, 0, 0);
            final int endColor = Color.rgb(0, 0, 0);
            final long duration = colorTransitionMs * (long) mService.getCurrentAnimatorScale();
            final ArgbEvaluator va = ArgbEvaluator.getInstance();
            runner.startAnimation(