> On Aug 8, 2016, at 12:46 PM, Aaron Tuller <mandelb...@mac.com> wrote:
> 
> Search for NSImage here:
> 
> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-126728
>  
> <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-126728>
> 

All it says about NSImage is: "One thread can create an NSImage object, draw to 
the image buffer, and pass it off to the main thread for drawing. The 
underlying image cache is shared among all threads.”

So it sounds like the problem isn’t the new NSImage but the existing one being 
drawn into it. It might help to get the NSImage’s imageRep on the main thread 
and then pass that to the background thread.

(I’ve got some similar code in one of my apps that creates NSImages on a 
parallel dispatch queue and draws into them, but it only draws text, not any 
pre-existing images. This code works fine even with dozens of tasks at a time.)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to