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

Commit 3649c40c authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Automerger Merge Worker
Browse files

Merge "Don't attempt to tone map content that is already in range." into sc-dev am: 263d778a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15159600

Change-Id: I15cc29bd8381e6a55604ce78d1e76706def9ddf3
parents 1e159066 263d778a
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -167,13 +167,12 @@ static void generateToneMapInterpolation(ui::Dataspace inputDataspace,


                                float nits = xyz.y;
                                float nits = xyz.y;


                                // clamp to max input luminance
                                // if the max input luminance is less than what we can output then
                                nits = clamp(nits, 0.0, maxInLumi);
                                // no tone mapping is needed as all color values will be in range.

                                // scale [0.0, maxInLumi] to [0.0, maxOutLumi]
                                if (maxInLumi <= maxOutLumi) {
                                if (maxInLumi <= maxOutLumi) {
                                    return xyz * (maxOutLumi / maxInLumi);
                                    return xyz;
                                } else {
                                } else {

                                    // three control points
                                    // three control points
                                    const float x0 = 10.0;
                                    const float x0 = 10.0;
                                    const float y0 = 17.0;
                                    const float y0 = 17.0;