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

Commit 9994945d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clarify cutoff priorities" into main

parents 3ba5d39b 4ef70c21
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -245,11 +245,18 @@ private:
            // This can happen if a BitmapShader is used on multiple canvas', such as a
            // software + hardware canvas, which is otherwise valid as SkShader is "immutable"
            std::lock_guard _lock(mUniformGuard);
            const float Wunclamped = (sk_float_log(targetHdrSdrRatio) -
            // Compute the weight parameter that will be used to blend between the images.
            float W = 0.f;
            if (targetHdrSdrRatio > mGainmapInfo.fDisplayRatioSdr) {
                if (targetHdrSdrRatio < mGainmapInfo.fDisplayRatioHdr) {
                    W = (sk_float_log(targetHdrSdrRatio) -
                         sk_float_log(mGainmapInfo.fDisplayRatioSdr)) /
                        (sk_float_log(mGainmapInfo.fDisplayRatioHdr) -
                         sk_float_log(mGainmapInfo.fDisplayRatioSdr));
            const float W = std::max(std::min(Wunclamped, 1.f), 0.f);
                } else {
                    W = 1.f;
                }
            }
            mBuilder.uniform("W") = W;
            uniforms = mBuilder.uniforms();
        }