winemac: Work around poor-quality downscaling in high-res/retina mode on macOS 10.13 and earlier.

This commit is contained in:
Brendan Shanks 2023-05-12 10:26:44 -07:00 committed by Alexandre Julliard
parent fcd2a5f592
commit b6f5bdb73f

View file

@ -680,6 +680,22 @@ - (void) setLayerRetinaProperties:(int)mode
[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