Cocoa already coalesces updates in this way, so when drawRect: is called, the list of rects is the merged list.

I does raise a question though - is there a way to get, at any point in time, the list of merged rects needing update from a view *at that point* - in other words, outside of a drawRect: call, can I found out what has been marked for update so far? That would be useful.

G.




On 3 May 2008, at 11:22 pm, Jean-Daniel Dupas wrote:

Why not merging your drawing invocation instead of queuing them.
Each time a drawRect is called on your view, get the rects that need to be refreshed, and add them to a single array of rect. One each loop, the drawing thread will picks all rects in the list and draw the view one time. Like this, if there is overlapping rects in the queue it will refresh them only once.

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to