scene/itemrenderer_opengl: use the color pipeline to check if color transformations are needed

Comparing the color descriptions can yield in false negatives, when the luminance
levels between two gamma 2.2 encoded images don't match.

BUG: 493295


(cherry picked from commit 260cf817b8)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
wilder/Plasma/6.2
Xaver Hugl 1 year ago
parent 331a800a13
commit 9370f7d19e
  1. 4
      src/scene/itemrenderer_opengl.cpp

@ -5,6 +5,7 @@
*/
#include "scene/itemrenderer_opengl.h"
#include "core/colorpipeline.h"
#include "core/pixelgrid.h"
#include "core/rendertarget.h"
#include "core/renderviewport.h"
@ -344,7 +345,8 @@ void ItemRendererOpenGL::renderItem(const RenderTarget &renderTarget, const Rend
if (renderNode.opacity != 1.0) {
traits |= ShaderTrait::Modulate;
}
if (renderNode.colorDescription != renderTarget.colorDescription()) {
const auto colorTransformation = ColorPipeline::create(renderNode.colorDescription, renderTarget.colorDescription(), item->renderingIntent());
if (!colorTransformation.isIdentity()) {
traits |= ShaderTrait::TransformColorspace;
}
if (!shader || traits != lastTraits) {

Loading…
Cancel
Save