• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Threaded drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threaded drawing


  • Subject: Re: Threaded drawing
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 06 Dec 2013 21:59:46 -0600

On Dec 6, 2013, at 6:05 PM, Roland King wrote:

> On 7 Dec, 2013, at 12:46 am, Graham Cox <email@hidden> 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@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


References: 
 >Threaded drawing (From: Graham Cox <email@hidden>)
 >Re: Threaded drawing (From: Graham Cox <email@hidden>)
 >Re: Threaded drawing (From: Roland King <email@hidden>)
 >Re: Threaded drawing (From: Graham Cox <email@hidden>)
 >Re: Threaded drawing (From: Roland King <email@hidden>)
 >Re: Threaded drawing (From: Graham Cox <email@hidden>)
 >Re: Threaded drawing (From: Roland King <email@hidden>)

  • Prev by Date: Re: Threaded drawing
  • Next by Date: Re: Threaded drawing
  • Previous by thread: Re: Threaded drawing
  • Next by thread: Re: Threaded drawing
  • Index(es):
    • Date
    • Thread