In my OpenGL-ES 1.1 based app, I'm using CALayer
s as a source for OpenGL textures. Those CALayer
s comprise of CGImage
s and text rendered through CoreGraphics. Another OpenGL texture source is a screenshot of a UIView
taken using -[CALAyer renderInContext:]
and UIGraphicsGetImageFromCurrentImageContext
. Currently, I'm running completely on the main thread.
The latter case in particular is pretty bad because it halts the OpenGL rendering for the whole time it takes to create the UIView
and its screenshot.
Now I'm considering to move the OpenGL code into a separate thread hoping to get around this blocking. Ideally, the screenshot would be taken on a different thread (main thread if needed) than the OpenGL rendering.
I wasn't able to find a complete coverage in the documentation about what requires running on the main thread and what not. I found some comments in the iOS 4 release notes, and some comments in specific UIKit methods but I'm missing the complete picture.
The code runs on iOS 4.x or higher.