summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Hong <rurumihong@google.com>2022-03-07 20:47:31 +0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-10 07:29:05 +0000
commit26f62282acff2bce70b54404233fd0f2654ec3e2 (patch)
treea2e66f4304f8ab9db67b6ec4f949b838bdaecdff
parentb464ef4dc204d4de70211289b32cd5cf2db53ce9 (diff)
downloadbase-26f62282acff2bce70b54404233fd0f2654ec3e2.tar.gz
Revert "[RESTRICT AUTOMERGE]DisplayManager: Make sure RampAnimator sets property in linear space."
This reverts commit 46ddcce6644b5209e0c1fb5342554ca7e507f707. Revert reason: Check if this causes AOC regression Bug: 223124178 Change-Id: I11d62ad3ebecb1df40858d9fe06fb1340830549d (cherry picked from commit 557c9ddc97583e7fdbcf81da650ff5360c7b7f66) Merged-In: I11d62ad3ebecb1df40858d9fe06fb1340830549d
-rw-r--r--services/core/java/com/android/server/display/RampAnimator.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/display/RampAnimator.java b/services/core/java/com/android/server/display/RampAnimator.java
index d8672fc07619..1ebd1f5a535c 100644
--- a/services/core/java/com/android/server/display/RampAnimator.java
+++ b/services/core/java/com/android/server/display/RampAnimator.java
@@ -70,7 +70,7 @@ class RampAnimator<T> {
mRate = 0;
mTargetValue = target;
mCurrentValue = target;
- setPropertyValue(target);
+ mProperty.setValue(mObject, target);
if (mAnimating) {
mAnimating = false;
cancelAnimationCallback();
@@ -125,15 +125,6 @@ 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);
}
@@ -169,7 +160,9 @@ class RampAnimator<T> {
final float oldCurrentValue = mCurrentValue;
mCurrentValue = mAnimatedValue;
if (oldCurrentValue != mCurrentValue) {
- setPropertyValue(mCurrentValue);
+ // Convert value from HLG into linear space for the property.
+ final float linearCurrentVal = BrightnessUtils.convertGammaToLinear(mCurrentValue);
+ mProperty.setValue(mObject, linearCurrentVal);
}
if (mTargetValue != mCurrentValue) {
postAnimationCallback();