Problem with CGContextDrawShading
Problem with CGContextDrawShading
- Subject: Problem with CGContextDrawShading
- From: Graham Cox <email@hidden>
- Date: Wed, 5 Nov 2008 15:41:17 +1100
I have code that draws gradients using the older method
(CGContextDrawShading, not NSGradient) and this worked fine on Tiger.
On Leopard, it mostly works, but in one case it doesn't, and I'm
really having trouble trying to find out why.
In this one case, I have a tracking loop within a control that
continuously modifies the parameters of a gradient, and sends an
action to a client object which is itself a custom control having a
custom cell. The custom cell redraws the gradient based on the updated
parameters. On Leopard, I can trace the fact that the code enters my
gradient drawing code as far as CGContextDrawShading, but nothing is
actually drawn. I have tried doing some additional drawing 'on top' at
this point to make sure I'm not clipped out or anything silly like
that and that draws fine.
Logging from my shader callback is not very useful because a) it slows
it to a crawl and b) it's called many times from other places so the
log gets swamped.
It seems as if something changed in the implementation of
CGContextDrawShading on Leopard that is causing this problem, but I
can't get any further. Did this function change? Is it now caching
more aggressively? How do I stop it?
Note that I recreate the CGShadingRef every time I draw, but I am
caching the CGFunctionRef that it uses, because this never changes.
tia,
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden