Don't attempt to tone map content that is already in range.

For content where the luminance values are able to be represented by
the destination we do not need to further reduce the luminance of
those values.

This CL also removes the clamp that enforces the actual luminance
values of the content don't exceed those defined in the metadata.
This fixes issues where the content and metadata don't match by favoring
the content value over the metadata.

Test: test app provided with the bug
Bug: 188531000
Change-Id: I12a65187d60c75167e1b1244e42b50ef3bb51bcd
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;