Re: Core Graphics optimisation

2012-08-13 Thread Graham Cox
On 10/08/2012, at 6:09 PM, Fulbert Boussaton <4...@flubb.net> wrote: > CGContextSetShadow(Ctx, CGSizeMake(3, 4), 3.0f); As well as the advice you've received, do you have to have shadows? They drag performance into the gutter. Try losing this line and watch your code speed up dramatically. -

Re: Core Graphics optimisation

2012-08-13 Thread Bill Dudney
A much faster and simpler approach to do exactly what you have here is CAShapeLayer. That will draw the path via OpenGL on your behalf without you having to study OpenGL. That said, copying and pasting from stack overflow or cocoa-dev list is never a good solution in the long run. You might not

Re: Core Graphics optimisation

2012-08-13 Thread Richard Altenburg (Brainchild)
You have no time to watch WWDC 2012 presentations and like to avoid OpenGL ES as an alternative, how on earth are you going to write a fast app with thousands of drawings on a device with (in worst case) 256 MB of internal memory? I am not sure OpenGL ES will help, and one session from WWDC will

Re: Core Graphics optimisation

2012-08-13 Thread Mike Abdullah
On 10 Aug 2012, at 09:09, Fulbert Boussaton <4...@flubb.net> wrote: > Hi everyone, > > on iOS, I was using the following "immediate CG code" to display hundreds > procedural sprites : > > CGContextSetShadow(Ctx, CGSizeMake(3, 4), 3.0f); > CGMutablePathRef ShapePath = CGPathCreateMutable()

Re: Core Graphics optimisation

2012-08-13 Thread Thomas Davie
On 10 Aug 2012, at 09:09, Fulbert Boussaton <4...@flubb.net> wrote: > Hi everyone, > > on iOS, I was using the following "immediate CG code" to display hundreds > procedural sprites : I'd suggest simply dropping CG, and drawing them using OpenGL ES instead. Thanks Tom Davie _

Core Graphics optimisation

2012-08-13 Thread Fulbert Boussaton
Hi everyone, on iOS, I was using the following "immediate CG code" to display hundreds procedural sprites : CGContextSetShadow(Ctx, CGSizeMake(3, 4), 3.0f); CGMutablePathRefShapePath = CGPathCreateMutable(); CGPathAddArc(ShapePath, &CGAffineTransformIdentity, radius+3, radius+3, radius,