Module: wine Branch: master Commit: b6f5bdb73fcdf4b1dee3145eac545199be0f4615 URL: https://gitlab.winehq.org/wine/wine/-/commit/b6f5bdb73fcdf4b1dee3145eac54519...
Author: Brendan Shanks bshanks@codeweavers.com Date: Fri May 12 10:26:44 2023 -0700
winemac: Work around poor-quality downscaling in high-res/retina mode on macOS 10.13 and earlier.
---
dlls/winemac.drv/cocoa_window.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 23ac8ca21e4..ac4cc214239 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -680,6 +680,22 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi [self layer].contentsScale = mode ? 2.0 : 1.0; [self layer].minificationFilter = mode ? kCAFilterLinear : kCAFilterNearest; [self layer].magnificationFilter = mode ? kCAFilterLinear : kCAFilterNearest; + + /* On macOS 10.13 and earlier, the desired minificationFilter seems to be + * ignored and "nearest" filtering is used, which looks terrible. + * Enabling rasterization seems to work around this, only enable + * it when there may be down-scaling (retina mode enabled). + */ + if (floor(NSAppKitVersionNumber) < 1671 /*NSAppKitVersionNumber10_14*/) + { + if (mode) + { + [self layer].shouldRasterize = YES; + [self layer].rasterizationScale = 2.0; + } + else + [self layer].shouldRasterize = NO; + } }
- (void) setRetinaMode:(int)mode