Loading libs/renderengine/include/renderengine/DisplaySettings.h +3 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,9 @@ struct DisplaySettings { // Maximum luminance pulled from the display's HDR capabilities. float maxLuminance = 1.0f; // Current luminance of the display float currentLuminanceNits = -1.f; // Output dataspace that will be populated if wide color gamut is used, or // DataSpace::UNKNOWN otherwise. ui::Dataspace outputDataspace = ui::Dataspace::UNKNOWN; Loading libs/renderengine/skia/SkiaGLRenderEngine.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -656,6 +656,7 @@ sk_sp<SkShader> SkiaGLRenderEngine::createRuntimeEffectShader( parameters.layerDimmingRatio, 1.f)); return createLinearEffectShader(parameters.shader, effect, runtimeEffect, colorTransform, parameters.display.maxLuminance, parameters.display.currentLuminanceNits, parameters.layer.source.buffer.maxLuminanceNits); } return parameters.shader; Loading libs/renderengine/skia/filters/LinearEffect.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -44,14 +44,15 @@ sk_sp<SkShader> createLinearEffectShader(sk_sp<SkShader> shader, const shaders::LinearEffect& linearEffect, sk_sp<SkRuntimeEffect> runtimeEffect, const mat4& colorTransform, float maxDisplayLuminance, float maxLuminance) { float currentDisplayLuminanceNits, float maxLuminance) { ATRACE_CALL(); SkRuntimeShaderBuilder effectBuilder(runtimeEffect); effectBuilder.child("child") = shader; const auto uniforms = shaders::buildLinearEffectUniforms(linearEffect, colorTransform, maxDisplayLuminance, maxLuminance); const auto uniforms = shaders::buildLinearEffectUniforms(linearEffect, colorTransform, maxDisplayLuminance, currentDisplayLuminanceNits, maxLuminance); for (const auto& uniform : uniforms) { effectBuilder.uniform(uniform.name.c_str()).set(uniform.value.data(), uniform.value.size()); Loading libs/renderengine/skia/filters/LinearEffect.h +2 −1 Original line number Diff line number Diff line Loading @@ -37,13 +37,14 @@ sk_sp<SkRuntimeEffect> buildRuntimeEffect(const shaders::LinearEffect& linearEff // matrix transforming from linear XYZ to linear RGB immediately before OETF. // We also provide additional HDR metadata upon creating the shader: // * The max display luminance is the max luminance of the physical display in nits // * The current luminance of the physical display in nits // * The max luminance is provided as the max luminance for the buffer, either from the SMPTE 2086 // or as the max light level from the CTA 861.3 standard. sk_sp<SkShader> createLinearEffectShader(sk_sp<SkShader> inputShader, const shaders::LinearEffect& linearEffect, sk_sp<SkRuntimeEffect> runtimeEffect, const mat4& colorTransform, float maxDisplayLuminance, float maxLuminance); float currentDisplayLuminanceNits, float maxLuminance); } // namespace skia } // namespace renderengine } // namespace android libs/shaders/include/shaders/shaders.h +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ std::string buildLinearEffectSkSL(const LinearEffect& linearEffect); std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect& linearEffect, const mat4& colorTransform, float maxDisplayLuminance, float currentDisplayLuminanceNits, float maxLuminance); } // namespace android::shaders Loading
libs/renderengine/include/renderengine/DisplaySettings.h +3 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,9 @@ struct DisplaySettings { // Maximum luminance pulled from the display's HDR capabilities. float maxLuminance = 1.0f; // Current luminance of the display float currentLuminanceNits = -1.f; // Output dataspace that will be populated if wide color gamut is used, or // DataSpace::UNKNOWN otherwise. ui::Dataspace outputDataspace = ui::Dataspace::UNKNOWN; Loading
libs/renderengine/skia/SkiaGLRenderEngine.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -656,6 +656,7 @@ sk_sp<SkShader> SkiaGLRenderEngine::createRuntimeEffectShader( parameters.layerDimmingRatio, 1.f)); return createLinearEffectShader(parameters.shader, effect, runtimeEffect, colorTransform, parameters.display.maxLuminance, parameters.display.currentLuminanceNits, parameters.layer.source.buffer.maxLuminanceNits); } return parameters.shader; Loading
libs/renderengine/skia/filters/LinearEffect.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -44,14 +44,15 @@ sk_sp<SkShader> createLinearEffectShader(sk_sp<SkShader> shader, const shaders::LinearEffect& linearEffect, sk_sp<SkRuntimeEffect> runtimeEffect, const mat4& colorTransform, float maxDisplayLuminance, float maxLuminance) { float currentDisplayLuminanceNits, float maxLuminance) { ATRACE_CALL(); SkRuntimeShaderBuilder effectBuilder(runtimeEffect); effectBuilder.child("child") = shader; const auto uniforms = shaders::buildLinearEffectUniforms(linearEffect, colorTransform, maxDisplayLuminance, maxLuminance); const auto uniforms = shaders::buildLinearEffectUniforms(linearEffect, colorTransform, maxDisplayLuminance, currentDisplayLuminanceNits, maxLuminance); for (const auto& uniform : uniforms) { effectBuilder.uniform(uniform.name.c_str()).set(uniform.value.data(), uniform.value.size()); Loading
libs/renderengine/skia/filters/LinearEffect.h +2 −1 Original line number Diff line number Diff line Loading @@ -37,13 +37,14 @@ sk_sp<SkRuntimeEffect> buildRuntimeEffect(const shaders::LinearEffect& linearEff // matrix transforming from linear XYZ to linear RGB immediately before OETF. // We also provide additional HDR metadata upon creating the shader: // * The max display luminance is the max luminance of the physical display in nits // * The current luminance of the physical display in nits // * The max luminance is provided as the max luminance for the buffer, either from the SMPTE 2086 // or as the max light level from the CTA 861.3 standard. sk_sp<SkShader> createLinearEffectShader(sk_sp<SkShader> inputShader, const shaders::LinearEffect& linearEffect, sk_sp<SkRuntimeEffect> runtimeEffect, const mat4& colorTransform, float maxDisplayLuminance, float maxLuminance); float currentDisplayLuminanceNits, float maxLuminance); } // namespace skia } // namespace renderengine } // namespace android
libs/shaders/include/shaders/shaders.h +1 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ std::string buildLinearEffectSkSL(const LinearEffect& linearEffect); std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect& linearEffect, const mat4& colorTransform, float maxDisplayLuminance, float currentDisplayLuminanceNits, float maxLuminance); } // namespace android::shaders