diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2024-09-25 19:32:55 -0400 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2024-10-17 05:53:52 +0200 |
commit | 4056b31465e72e0a9e262639444fc5a3249f548d (patch) | |
tree | d9d3df71f9c3b34f6bc9a88028fe2c729f6d86be /vcl | |
parent | 1ebee6c662413d4d0c0218cd12435f4a39fc9582 (diff) |
tdf#163152 don't convert image's sRGB colorspace
With Skia/Raster or Skia disabled, converting the image's
colorspace to match the window's colorspace causes more than
an expected amount of color saturation so let the window's
underlying CGContext handle any necessary colorspace conversion
in CGContextDrawImage().
With Skia/Metal, this bug is caused by the CAMetalLayer being
set to the same colorspace as its matching window. So set the
CAMetalLayer's colorspace to sRGB so that, like with Skia/Raster
and Skia disabled, any colorspace conversion is handled when the
CAMetalLayer is drawn to the window.
Change-Id: Ifa2abe46d34bfcf5acd478fffd346603f869157b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173962
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
(cherry picked from commit e4ab68142c7bc4e04ffe429567dda974b86985a7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173923
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salgdiutils.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx index d7f8ec48eaf0..7e2cf029b71f 100644 --- a/vcl/osx/salgdiutils.cxx +++ b/vcl/osx/salgdiutils.cxx @@ -381,17 +381,12 @@ void AquaSalGraphics::UpdateWindow( NSRect& rRect ) CGContextSetBlendMode(rCGContextHolder.get(), kCGBlendModeCopy); - NSWindow *pWindow = maShared.mpFrame->getNSWindow(); - if (pWindow) - { - CGImageRef displayColorSpaceImage = CGImageCreateCopyWithColorSpace(img, [[maShared.mpFrame->getNSWindow() colorSpace] CGColorSpace]); - CGContextDrawImage(rCGContextHolder.get(), aRect, displayColorSpaceImage); - CGImageRelease(displayColorSpaceImage); - } - else - { - CGContextDrawImage(rCGContextHolder.get(), aRect, img); - } + // tdf#163152 don't convert image's sRGB colorspace + // Converting the image's colorspace to match the window's + // colorspace causes more than an expected amount of color + // saturation so let the window's underlying CGContext handle + // any necessary colorspace conversion in CGContextDrawImage(). + CGContextDrawImage(rCGContextHolder.get(), aRect, img); rCGContextHolder.restoreState(); |