When using the colorspace returned from CGColorSpaceCreateDeviceRGB(), a colorspace transformation will be applied on any CGContextDrawImage() call, leading to 5-6x worse performance than blitting without this transform.
To avoid this colorspace transformation, we have been using the colorspace created with the system monitor profile:
CMProfileRef smp = 0;
if (CMGetSystemProfile(&smp) == noErr)
{
colorSpace = CGColorSpaceCreateWithPlatformColorSpace(smp);
CMCloseProfile(smp);
}
else
colorSpace = CGColorSpaceCreateDeviceRGB();
The above works well and completely disables the colorspace transformations for CGContextDrawImage().
CMGetSystemProfile has been marked deprecated since 10.6, but since we haven't found any other possibility to avoid these colorspace transformations, we have kept it in our code for high-performance blitting.
In 10.11 SDK, the ColorSpace API CMGetSystemProfile() is removed. Is there a suitable replacement, or an alternative method on how to disable colorspace transformations?