mirror of https://github.com/OpenTTD/OpenTTD
Fix: change Quartz driver colorSpace handling to address certain macOS performance issues (#7644)
parent
0549a81c30
commit
9014633866
|
@ -113,7 +113,7 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace()
|
||||||
if (colorSpace == NULL) {
|
if (colorSpace == NULL) {
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||||
colorSpace = CGDisplayCopyColorSpace(CGMainDisplayID());
|
colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -289,7 +289,9 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
|
||||||
styleMask:style
|
styleMask:style
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:NO ];
|
defer:NO ];
|
||||||
|
if ([ this->window respondsToSelector:@selector(setColorSpace:) ]) {
|
||||||
|
[ this->window setColorSpace:[ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ];
|
||||||
|
}
|
||||||
if (this->window == nil) {
|
if (this->window == nil) {
|
||||||
DEBUG(driver, 0, "Could not create the Cocoa window.");
|
DEBUG(driver, 0, "Could not create the Cocoa window.");
|
||||||
this->setup = false;
|
this->setup = false;
|
||||||
|
|
Loading…
Reference in New Issue