Loading services/core/java/com/android/server/display/RampAnimator.java +11 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ class RampAnimator<T> { mRate = 0; mTargetValue = target; mCurrentValue = target; mProperty.setValue(mObject, target); setPropertyValue(target); if (mAnimating) { mAnimating = false; cancelAnimationCallback(); Loading Loading @@ -125,6 +125,15 @@ class RampAnimator<T> { mListener = listener; } /** * Sets the brightness property by converting the given value from HLG space * into linear space. */ private void setPropertyValue(float val) { final float linearVal = BrightnessUtils.convertGammaToLinear(val); mProperty.setValue(mObject, linearVal); } private void postAnimationCallback() { mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION, mAnimationCallback, null); } Loading Loading @@ -160,9 +169,7 @@ class RampAnimator<T> { final float oldCurrentValue = mCurrentValue; mCurrentValue = mAnimatedValue; if (oldCurrentValue != mCurrentValue) { // Convert value from HLG into linear space for the property. final float linearCurrentVal = BrightnessUtils.convertGammaToLinear(mCurrentValue); mProperty.setValue(mObject, linearCurrentVal); setPropertyValue(mCurrentValue); } if (mTargetValue != mCurrentValue) { postAnimationCallback(); Loading Loading
services/core/java/com/android/server/display/RampAnimator.java +11 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ class RampAnimator<T> { mRate = 0; mTargetValue = target; mCurrentValue = target; mProperty.setValue(mObject, target); setPropertyValue(target); if (mAnimating) { mAnimating = false; cancelAnimationCallback(); Loading Loading @@ -125,6 +125,15 @@ class RampAnimator<T> { mListener = listener; } /** * Sets the brightness property by converting the given value from HLG space * into linear space. */ private void setPropertyValue(float val) { final float linearVal = BrightnessUtils.convertGammaToLinear(val); mProperty.setValue(mObject, linearVal); } private void postAnimationCallback() { mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION, mAnimationCallback, null); } Loading Loading @@ -160,9 +169,7 @@ class RampAnimator<T> { final float oldCurrentValue = mCurrentValue; mCurrentValue = mAnimatedValue; if (oldCurrentValue != mCurrentValue) { // Convert value from HLG into linear space for the property. final float linearCurrentVal = BrightnessUtils.convertGammaToLinear(mCurrentValue); mProperty.setValue(mObject, linearCurrentVal); setPropertyValue(mCurrentValue); } if (mTargetValue != mCurrentValue) { postAnimationCallback(); Loading