(svn r27675) -Fix [FS#6502]: [OSX] Building with 10.11 or 10.12 SDKs.
This commit is contained in:
@@ -110,15 +110,23 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace()
|
||||
static CGColorSpaceRef colorSpace = NULL;
|
||||
|
||||
if (colorSpace == NULL) {
|
||||
CMProfileRef sysProfile;
|
||||
|
||||
if (CMGetSystemProfile(&sysProfile) == noErr) {
|
||||
colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile);
|
||||
CMCloseProfile(sysProfile);
|
||||
} else {
|
||||
colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||
colorSpace = CGDisplayCopyColorSpace(CGMainDisplayID());
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(HAVE_OSX_1011_SDK)
|
||||
CMProfileRef sysProfile;
|
||||
if (CMGetSystemProfile(&sysProfile) == noErr) {
|
||||
colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile);
|
||||
CMCloseProfile(sysProfile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (colorSpace == NULL) colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
|
||||
if (colorSpace == NULL) error("Could not get system colour space. You might need to recalibrate your monitor.");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user