I thought CGContext had API to tell you the rects being drawn, but can’t see 
that now, so I think I imagined it!

I’d say your next port of call is to ascertain whether the system is smart 
enough to be only drawing the required area or not. There are debugging tools 
to show you the portions of the screen being updated — does that suggest the 
entire view is being redrawn, or just the ends?

Mike.

> On 5 Dec 2015, at 03:02, Roland King <r...@rols.org> wrote:
> 
> NSView has a method getRectsBeingDrawn:count: which gives you the actual 
> rects being drawn in a drawRect: call. Is there something equivalent for a 
> UIView? Does UIView even do as I believe NSView does and only invalidate just 
> the areas passed to setNeedsDisplayInRect:, meaning those are the only areas 
> you actually need to redraw, or does it blow away the entire containing 
> rectangle so you must repaint the entire area?  
> 
> I have a time-series view which only invalidates a tiny sliver of view which 
> changed and only draws that in drawRect:. However when the series gets long 
> enough it trims the left hand end, so two tiny slivers of view are 
> invalidated, one at each end, drawRect: coalesces them into one rect the 
> entire size of the window and the whole series redraws on every iteration. I 
> spotted this when I left the simulator running for an hour and the fans 
> suddenly started spinning up. 
> 
> I can work around it by overriding setNeedsDisplayInRect: and queuing up 
> non-contiguous updates, releasing them only when drawRect has been called, 
> but it would be nice not to have to. I suspect I’m SOL on this one. 
> _______________________________________________
> 
> 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/mabdullah%40karelia.com
> 
> This email sent to mabdul...@karelia.com


_______________________________________________

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