plugins/screencast, screenshot: switch color transforms to relative colorimetric

This is to disable tone mapping, which makes screenshots of SDR things while HDR is enabled on a
display look a lot worse.
As the tradeoff, this will make HDR content look worse, but that can be fixed later by taking the
actual HDR metadata into account.

BUG: 496185


(cherry picked from commit d62eb36757)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
wilder/Plasma/6.2
Xaver Hugl 1 year ago
parent 53f2dec2d5
commit 34cf899ded
  1. 2
      src/plugins/screencast/outputscreencastsource.cpp
  2. 2
      src/plugins/screencast/regionscreencastsource.cpp
  3. 2
      src/plugins/screenshot/screenshot.cpp

@ -72,7 +72,7 @@ void OutputScreenCastSource::render(GLFramebuffer *target)
projectionMatrix.scale(1, -1);
projectionMatrix.ortho(QRect(QPoint(), textureSize()));
shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::Perceptual);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
GLFramebuffer::pushFramebuffer(target);
outputTexture->render(textureSize());

@ -107,7 +107,7 @@ void RegionScreenCastSource::blit(Output *output)
projectionMatrix.translate(outputGeometry.left(), outputGeometry.top());
shaderBinder.shader()->setUniform(GLShader::Mat4Uniform::ModelViewProjectionMatrix, projectionMatrix);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::Perceptual);
shaderBinder.shader()->setColorspaceUniforms(colorDescription, ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
outputTexture->render(outputGeometry.size());
GLFramebuffer::popFramebuffer();

@ -385,7 +385,7 @@ QImage ScreenShotEffect::blitScreenshot(const RenderTarget &renderTarget, const
if (renderTarget.texture()) {
GLFramebuffer::pushFramebuffer(&target);
ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::TransformColorspace);
binder.shader()->setColorspaceUniforms(renderTarget.colorDescription(), ColorDescription::sRGB, RenderingIntent::Perceptual);
binder.shader()->setColorspaceUniforms(renderTarget.colorDescription(), ColorDescription::sRGB, RenderingIntent::RelativeColorimetricWithBPC);
QMatrix4x4 projectionMatrix;
projectionMatrix.scale(1, -1);
projectionMatrix *= renderTarget.transform().toMatrix();

Loading…
Cancel
Save