Re: Threaded drawing - JPEG
Re: Threaded drawing - JPEG
- Subject: Re: Threaded drawing - JPEG
- From: Greg Parker <email@hidden>
- Date: Wed, 11 Dec 2013 14:43:07 -0800
On Dec 11, 2013, at 9:53 AM, Steve Sisak <email@hidden> wrote:
> Not to hijack the thread, but I'm just getting head into optimizing some code which displays live preview for a number of JPEG streams simultaneously.
>
> Most implementations I've tried result in being CPU bound in JPEG code on the main thread with the 7 other cores idle.
>
> I've tried variants of NSImageView, CGImage and CIImage and all that's needed to render them on alternate threads but Cocoa appears to so good at delaying evaluation as long as possible that it seems to end up calling the JPEG decoder synchronously from -drawRect of whatever view subclass I've chosen on the main thread.
Simple attempt: when you get the JPEG, create a CGBitmapContext on a background thread and draw the JPEG into it. Then use the CGBitmapContext to draw on the main thread.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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