On Jul 25, 2013, at 20:26, Andreas Mayer <andr...@harmless.de> wrote:
> Am 25.07.2013 um 19:36 schrieb Uli Kusterer <witness.of.teacht...@gmx.net>:
> 
>> Have you considered using a display link callback instead of a timer?
> 
> Yes. Moving to the display link callback was when I noticed the issue in the 
> first place.

 Usually, when drawing from the display link callback is out of sync, it simply 
means you’re taking too long to draw. Optimize your drawing code.

> Calling -setNeedsDisplay: in the display link callback is too fast. It gives 
> smooth animation but leads to timers piling up in the system.

 No no no! Don’t do both at the same time! The display link callback is called 
exactly when you’re supposed to draw! If you call setNeedsDisplay: there, 
you’ll be waiting until the next time *by definition*.

> Since I can use Core Animation, that is obviously the better solution. It 
> also makes my application look less power hungry - because now it is the 
> WindowServer doing the drawing and eating cpu. ;)

 Not sure I follow your reasoning here. The Window server only manages layers 
and triggers redraws. The actual drawing is still done by Quartz in your 
process.
_______________________________________________

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