Quote:
Originally Posted by paluter
I am using core graphics in the drawrect method and it gets updated every 0.05 seconds. Basically, the app is a finger paint app where it is constantly drawing. The app constantly lags while drawing which I know is due to the core graphics (by using Instruments.app). I made sure that I completely released everything properly and have no obvious (alloc, release) memory issues. How do you get rid of core graphics lag? PLEASE HELP!!!!
|
You're not going to like the answer.
Don't use drawRect.
When you use DrawRect, the device has to render the entire view for each frame, then copy the results to the display hardware.
The answer is to rewrite your code to use facilities like CAShapeLayers, where you can change the shape and let the graphics subsystem render it for you.
You might also try doing your drawing in a "regular" CALayer and overriding drawInContext. I believe that is a little "closer to the the metal" than drawRect for a view.