Fix HDR blownout issue in the Photos app with HDR display on.
- make sure that renderHdrSdrRatio is not larger than current mDesiredHdrSdrRatio when updating. - cleanup setTargetHdrSdrRatio function. Bug: 276744890 Test: play with Photos Change-Id: I7fcd5e33633483ff7577d11748874472ad3ca15e
This commit is contained in:
@@ -5459,7 +5459,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
}
|
||||
|
||||
private void updateRenderHdrSdrRatio() {
|
||||
mRenderHdrSdrRatio = mDisplay.getHdrSdrRatio();
|
||||
mRenderHdrSdrRatio = Math.min(mDesiredHdrSdrRatio, mDisplay.getHdrSdrRatio());
|
||||
mUpdateHdrSdrRatioInfo = true;
|
||||
}
|
||||
|
||||
@@ -5487,22 +5487,14 @@ public final class ViewRootImpl implements ViewParent,
|
||||
mHdrSdrRatioChangedListener = null;
|
||||
} else {
|
||||
mHdrSdrRatioChangedListener = display -> {
|
||||
setTargetHdrSdrRatio(display.getHdrSdrRatio());
|
||||
updateRenderHdrSdrRatio();
|
||||
invalidate();
|
||||
};
|
||||
mDisplay.registerHdrSdrRatioChangedListener(mExecutor, mHdrSdrRatioChangedListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** happylint */
|
||||
public void setTargetHdrSdrRatio(float ratio) {
|
||||
if (mRenderHdrSdrRatio != ratio) {
|
||||
mRenderHdrSdrRatio = ratio;
|
||||
mUpdateHdrSdrRatioInfo = true;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestChildFocus(View child, View focused) {
|
||||
if (DEBUG_INPUT_RESIZE) {
|
||||
|
||||
Reference in New Issue
Block a user