commit | c681aad9410a375096798049d1b50c5295690e3f | [log] [tgz] |
---|---|---|
author | Derek Sollenberger <djsollen@google.com> | Thu Jul 01 19:12:20 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jul 01 19:12:20 2021 +0000 |
tree | 935d0f4edf62524710161657026faee6a014503c | |
parent | 1e7186ae152e724e58c94444266bd93eb9e3fd32 [diff] | |
parent | 263d778ae3c307620aa61f5aeebd748502e56187 [diff] |
Merge "Don't attempt to tone map content that is already in range." into sc-dev am: 263d778ae3 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15159600 Change-Id: I04a1fad72d4b1ecc09b146028fe55d2f12d88c1d
diff --git a/libs/renderengine/skia/filters/LinearEffect.cpp b/libs/renderengine/skia/filters/LinearEffect.cpp index 9b044e1..fc45af9 100644 --- a/libs/renderengine/skia/filters/LinearEffect.cpp +++ b/libs/renderengine/skia/filters/LinearEffect.cpp
@@ -167,13 +167,12 @@ float nits = xyz.y; - // clamp to max input luminance - nits = clamp(nits, 0.0, maxInLumi); - - // scale [0.0, maxInLumi] to [0.0, maxOutLumi] + // if the max input luminance is less than what we can output then + // no tone mapping is needed as all color values will be in range. if (maxInLumi <= maxOutLumi) { - return xyz * (maxOutLumi / maxInLumi); + return xyz; } else { + // three control points const float x0 = 10.0; const float y0 = 17.0;