Re: Efficiency Question...

2012-03-06 Thread R
Thanks to all! Ron On Mar 6, 9:24 am, Kyle Sluder wrote: > On Mar 5, 2012, at 11:21 PM, Graham Cox wrote: > > > > > Is the goal to go from red to blue from left to right? > > > Why not add a single layer with red on the left, alpha = 1, and blue on the > > right, alpha = 1? I don't see why yo

Re: Efficiency Question...

2012-03-06 Thread Kyle Sluder
On Mar 5, 2012, at 11:21 PM, Graham Cox wrote: > > Is the goal to go from red to blue from left to right? > > Why not add a single layer with red on the left, alpha = 1, and blue on the > right, alpha = 1? I don't see why you need to composite two layers. > > Drawing a gradient dynamically is

Re: Efficiency Question...

2012-03-06 Thread Fritz Anderson
On 6 Mar 2012, at 1:21 AM, Graham Cox wrote: > Why not add a single layer with red on the left, alpha = 1, and blue on the > right, alpha = 1? I don't see why you need to composite two layers. > > Drawing a gradient dynamically is probably more efficient than blitting a > PNG, and will be resol

Re: Efficiency Question...

2012-03-06 Thread Graham Cox
On 06/03/2012, at 5:40 PM, R wrote: > I want to blend two colors as a background. I'm adding a layer using > CAGradient layer, starting on the left with blue alpha=1. and ending > on the right with blue alpha=0. > > I then add another layer using red on the left with alpha=0. and > ending on th

Efficiency Question...

2012-03-05 Thread R
I want to blend two colors as a background. I'm adding a layer using CAGradient layer, starting on the left with blue alpha=1. and ending on the right with blue alpha=0. I then add another layer using red on the left with alpha=0. and ending on the right with alpha=1. I wonder if it is best to d

Re: Creating strings in a loop - Efficiency Question

2009-05-28 Thread Roland King
well .. it's hard to say until you actually try it and profile your code however .. I try to stick to something like 2. whenever it doesn't cause me to bend the code around too much. I use alloc/init .. use variable .. release whenever I can. Absolutely nothing guarantees that anything in

Re: Creating strings in a loop - Efficiency Question

2009-05-28 Thread Dave Carrigan
On May 28, 2009, at 9:20 AM, Reza Farhad wrote: I have a situation where I need to create a new string as I go through a loop. What will be the most efficient way of doing this each time the call goes through the loop. 1. To create an auto releasing string. 2. To create a non auto-releasin

Creating strings in a loop - Efficiency Question

2009-05-28 Thread Reza Farhad
Hi I have a situation where I need to create a new string as I go through a loop. What will be the most efficient way of doing this each time the call goes through the loop. 1. To create an auto releasing string. 2. To create a non auto-releasing string at the start of the loop and releas