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

Commit 89c9ff26 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Invoke setColorSpaceAgnostic only when needed" into main

parents c51efddf 3e2a2326
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1000,6 +1000,7 @@ public final class ViewRootImpl implements ViewParent,
    private final ImeFocusController mImeFocusController;
    private boolean mIsSurfaceOpaque;
    private boolean mIsSurfaceColorSpaceAgnostic;
    private final BackgroundBlurDrawable.Aggregator mBlurRegionAggregator =
            new BackgroundBlurDrawable.Aggregator(this);
@@ -3906,12 +3907,19 @@ public final class ViewRootImpl implements ViewParent,
                    }
                    if (setScPropertiesInClient()) {
                        if (surfaceControlChanged) {
                            // Reset to default for a new SurfaceControl.
                            mIsSurfaceColorSpaceAgnostic = false;
                        }
                        if (surfaceControlChanged || windowAttributesChanged) {
                            boolean colorSpaceAgnostic = (lp.privateFlags
                                    & WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC)
                                    != 0;
                            mTransaction.setColorSpaceAgnostic(mSurfaceControl, colorSpaceAgnostic)
                                    .apply();
                            if (colorSpaceAgnostic != mIsSurfaceColorSpaceAgnostic) {
                                mIsSurfaceColorSpaceAgnostic = colorSpaceAgnostic;
                                mTransaction.setColorSpaceAgnostic(
                                        mSurfaceControl, colorSpaceAgnostic).applyAsyncUnsafe();
                            }
                        }
                    }
                }