Gradient Optim


#1

Hi Jules,

I was wondering if it would be possible to cache the CGShadingRef used in drawGradient when calling setFillType (eventually lazy evaluation if you don’t want to compute it there)

Currently if call multiple DrawLine with a gradient, it ends up being recomputed way to much times.

Thanks,


#2

Thanks, good idea, I’ll take a look…


#3

Hi Jules,

Did you had a chance to take a look at this ?

Thanks,


#4

I did have a quick look, but it’s far more complicated that it seems, because there are callback functions and a stack of saved context states to worry about, so I chickened out. Have a go yourself if you want to, but I realised I was probably going to end up spending several hours getting it to work, and didn’t have time to do that.


#5

Please check your email.

I’ve found an easy way to implement it.

Thanks,


#6

Works fine.

Thanks,