On Sat, Dec 20, 2008 at 1:51 PM, Kyle Sluder <kyle.slu...@gmail.com> wrote:
> On Sat, Dec 20, 2008 at 12:18 PM, Michael Ash <michael....@gmail.com> wrote:
>> A simple way to do this is to avoid calling setNeedsDisplay: (or its
>> friends) directly from your event handler. Instead start a timer with
>> some suitably small interval, and set a flag. If the flag is already
>> set, don't start the timer, it's already been started. When the timer
>> fires, invalidate the view and clear the flag.
>
> Alright, perhaps I don't completely understand how the drawing model
> works at a low enough level, but why would this be helpful?  Doesn't
> AppKit just coalesce updates received by -setNeedsDisplayInRect: until
> Quartz has finished pushing pixels?  So if you are accumulating dirty
> rects in your event handler, your drawing should still be limited to
> min(as fast as possible, 60hz).
>
> Or am I thinking of the Quartz GL pipeline?

My understanding is that everything is sychronous. So if you call
setNeedsDisplay: in your event handler, then the sequence will always
look like this:

event handler
   mark view invalid
check for invalidated views
   redraw invalidated view
   flush results to screen
event handler
   mark view invalid
check for invalidated views
   redraw invalidated view
   flush results to screen

And so forth. I could be wrong about this, and if anyone knows better
please pipe up!

Mike
_______________________________________________

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

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

Reply via email to