On Dec 6, 2013, at 6:05 PM, Roland King wrote:
> On 7 Dec, 2013, at 12:46 am, Graham Cox <[email protected]> wrote:
>
>>
>>
>> @synchronized( self )
>> {
>> CGContextDrawImage( ctx,
>> tileRect, tileImage );
>> }
>> CGImageRelease( tileImage );
> You could also, instead of synchronizing the CGContextDrawImage(), which may
> make your threads wait for each other for some infinitessimal time, use
>
> dispatch_async( dispatch_get_main_queue(), {
> CGContextDrawImage( ctx, tileRect, tileImage );
> CGImageRelease( tileImage );
> free( bitsPtr );
> }
>
> which serializes them. And I doubt it would make a sod of difference.
It would make a difference in that it wouldn't work. The draw operations will
not be performed before the CGContextRestoreGState() call nor before the
NSGraphicsContext that the CGContext was obtained from has had a chance to, for
example, release the CGContext. Or, if not that, then change its state values.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]