summaryrefslogtreecommitdiff
path: root/libs/shaders/shaders.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2022-04-18 22:19:54 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-04-18 22:19:54 +0000
commite1d797219097be512bb4a9d844eb7beb2fff7926 (patch)
tree8eb4446e7e91512093114b4b7e94676fafa2c25d /libs/shaders/shaders.cpp
parent87d026acfc992c36b0f64a0061ba55add45f87df (diff)
parentfcedb9ca3fa14607451ca24f32539a36f2261912 (diff)
Merge "Support RenderIntents in libtonemap." into tm-dev
Diffstat (limited to 'libs/shaders/shaders.cpp')
-rw-r--r--libs/shaders/shaders.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/shaders/shaders.cpp b/libs/shaders/shaders.cpp
index 5935589fdf..f0d45c2123 100644
--- a/libs/shaders/shaders.cpp
+++ b/libs/shaders/shaders.cpp
@@ -464,12 +464,10 @@ std::string buildLinearEffectSkSL(const LinearEffect& linearEffect) {
}
// Generates a list of uniforms to set on the LinearEffect shader above.
-std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect& linearEffect,
- const mat4& colorTransform,
- float maxDisplayLuminance,
- float currentDisplayLuminanceNits,
- float maxLuminance,
- AHardwareBuffer* buffer) {
+std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(
+ const LinearEffect& linearEffect, const mat4& colorTransform, float maxDisplayLuminance,
+ float currentDisplayLuminanceNits, float maxLuminance, AHardwareBuffer* buffer,
+ aidl::android::hardware::graphics::composer3::RenderIntent renderIntent) {
std::vector<tonemap::ShaderUniform> uniforms;
if (linearEffect.inputDataspace == linearEffect.outputDataspace) {
uniforms.push_back({.name = "in_rgbToXyz", .value = buildUniformValue<mat4>(mat4())});
@@ -495,7 +493,8 @@ std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect
.currentDisplayLuminance = currentDisplayLuminanceNits > 0
? currentDisplayLuminanceNits
: maxDisplayLuminance,
- .buffer = buffer};
+ .buffer = buffer,
+ .renderIntent = renderIntent};
for (const auto uniform : tonemap::getToneMapper()->generateShaderSkSLUniforms(metadata)) {
uniforms.push_back(uniform);