Re: NSImage from bitmap - then delete bitmap
Re: NSImage from bitmap - then delete bitmap
- Subject: Re: NSImage from bitmap - then delete bitmap
- From: Graham Cox <email@hidden>
- Date: Fri, 22 Jul 2016 17:08:53 +1000
> On 22 Jul 2016, at 5:00 PM, Roland King <email@hidden> wrote:
>
> Since you need the data to persist for display whilst you write a new image that means there’s two separate buffers, there has to be
Not sure there HAS to be. Whether it’s the easiest approach is another matter.
If the thread building images never goes faster than once per second, the time to draw the image is a fraction of that - I’m sure 60fps is achievable, so making the thread wait for the drawing to be done isn’t going to hold it up significantly. You’re going to waste exactly the same amount of time doing a copy. Your suggestion of making a new buffer is a good one, as there’s no wasted time, provided that the worker thread does set every pixel. Otherwise it’s going to have to clear it and you’re back to a pass over the pixels which takes the same time as the copy/draw, etc.
But is it worth it to save the 4MB per bitmap? Once upon a time the answer would definitely be yes, but 4MB isn’t much these days.
—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