Re: Optimizing NSRectFill
Re: Optimizing NSRectFill
- Subject: Re: Optimizing NSRectFill
- From: "Michael Ash" <email@hidden>
- Date: Sat, 20 Dec 2008 15:14:41 -0500
On Sat, Dec 20, 2008 at 1:51 PM, Kyle Sluder <email@hidden> wrote:
> On Sat, Dec 20, 2008 at 12:18 PM, Michael Ash <email@hidden> 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 (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