Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGGradient VS CGShading



On Mar 12, 2008, at 6:19 AM, Scott Thompson wrote:

I am in a situation where it is basically indifferent to draw a gradient using CGGradient or drawing it with CGShading.
I need to draw a radial gradient between 2 colors concentric to each other.


Compatibility issues with systems before Mac OS 10.5 are not an issue.
Ease of setting my code up is not an issue either.


However performance might be an issue, so I'd like to use the faster approach between the two.
Does anybody know any benchmarks between CGShading and CGGradient ?

As I recall from the last WWDC, the CGGradient API is simply built on top of the CGShading API. The CGShading API can be a bit difficult to figure out (with much of the confusion centering around CGFunction) CGGradient removes some of that complexity by implementing common scenarios.


If that is the case, I would expect that the performance of the two would be roughly similar.

This is true in Leopard. A specific advantage of CGGradient is that we'll be able to improve its performance significantly in the future since it's limited to a narrower class of shadings.


Derek

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >CGGradient VS CGShading (From: Luigi Castelli <email@hidden>)
 >Re: CGGradient VS CGShading (From: Scott Thompson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.