Re: Efficiency Question...
Re: Efficiency Question...
- Subject: Re: Efficiency Question...
- From: Fritz Anderson <email@hidden>
- Date: Tue, 06 Mar 2012 10:04:03 -0600
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 resolution independent.
My experience on iOS is that compositing of any kind, at least offscreen, is very expensive, even with no scaling. That includes gradients and shadows. I profile, and fall back on PNG if necessary.
Also, you'd have better control over how the gradient looks. Trusting Core Graphics may not get you what you want.
If we're talking about a background for an iPhone, or even of the right-hand portion of a UISplitView, the size and load time aren't an issue. (I've had to use a 1600 x 1600, though, for which the preheat time is half a second; doing -[UIImage imageWithContentsOfFile:] at startup didn't help.)
If the compositing is being done on a Mac, then never mind — most Macs have CPU and GPU to spare.
— F
_______________________________________________
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