In my app I'm using a "CIMotionBlur" CIFilter during CALayer animation. The problem is that the filter does not work properly when hardware acceleration is not available:
Animation works fine without the filter. I'd like to apply filter only when hardware acceleration is available.
What's the highest level API that would let me know when to disable the filter? I'm going to look for clues in IOKit.
I found the answer in Technical Q&A QA1218
"How do I tell if a particular display is being hardware accelerated by Quartz Extreme?"
It's as simple as this:
NSNumber* curScreenNum = [self.window.screen.deviceDescription objectForKey:@"NSScreenNumber"];
if (CGDisplayUsesOpenGLAcceleration(curScreenNum.integerValue))
{
// Do accelerated stuff
}
Works as expected in my cases.