From cfab883374cfab09682e5a34f977bdd4adf40b69 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:15:09 -0800 Subject: [PATCH] use config for viewer reassoc Fixes #1661 --- app/config/config.cpp | 1 + app/render/renderprocessor.cpp | 4 +++- app/widget/viewer/viewerdisplay.cpp | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/config/config.cpp b/app/config/config.cpp index 797cb6d9f..2f88ea1b9 100644 --- a/app/config/config.cpp +++ b/app/config/config.cpp @@ -100,6 +100,7 @@ void Config::SetDefaults() SetEntryInternal(QStringLiteral("ShowClipWhileDragging"), NodeValue::kBoolean, true); SetEntryInternal(QStringLiteral("StopPlaybackOnLastFrame"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("UseLegacyColorInInputTab"), NodeValue::kBoolean, false); + SetEntryInternal(QStringLiteral("ReassocLinToNonLin"), NodeValue::kBoolean, false); SetEntryInternal(QStringLiteral("AutoCacheDelay"), NodeValue::kInt, 1000); diff --git a/app/render/renderprocessor.cpp b/app/render/renderprocessor.cpp index 267ee723b..01bd95518 100644 --- a/app/render/renderprocessor.cpp +++ b/app/render/renderprocessor.cpp @@ -96,7 +96,9 @@ FramePtr RenderProcessor::GenerateFrame(TexturePtr texture, const rational& time if (output_color_transform) { // Yes color transform, blit color managed - render_ctx_->BlitColorManaged(output_color_transform, texture, Renderer::kAlphaNone, blit_tex.get(), true, matrix); + render_ctx_->BlitColorManaged(output_color_transform, texture, + Config::Current()[QStringLiteral("ReassocLinToNonLin")].toBool() ? Renderer::kAlphaAssociated : Renderer::kAlphaNone, + blit_tex.get(), true, matrix); } else { // No color transform, just blit ShaderJob job; diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp index 3e21bf120..4ab607154 100644 --- a/app/widget/viewer/viewerdisplay.cpp +++ b/app/widget/viewer/viewerdisplay.cpp @@ -391,7 +391,9 @@ void ViewerDisplayWidget::OnPaint() texture_to_draw = deinterlace_texture_; } - renderer()->BlitColorManaged(color_service(), texture_to_draw, Renderer::kAlphaNone, device_params, false, + renderer()->BlitColorManaged(color_service(), texture_to_draw, + Config::Current()[QStringLiteral("ReassocLinToNonLin")].toBool() ? Renderer::kAlphaAssociated : Renderer::kAlphaNone, + device_params, false, combined_matrix_flipped_, crop_matrix_); } }