• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is setNeedsDisplayInRect: smarter than I thought?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is setNeedsDisplayInRect: smarter than I thought?


  • Subject: Is setNeedsDisplayInRect: smarter than I thought?
  • From: Eric <email@hidden>
  • Date: Tue, 9 May 2006 15:32:56 -0700

I thought all that setNeedsDispalyInRect: does is it passes the dirty
rectangle to drawRect:, and if drawRect: ignores the rect passed in, then
the whole view will be redrawn and updated on screen.  In other words, I
thought no "clipping" would be done.

However, this is not the case after some experiement (using Quartz Debug).
It appears invoking setNeedsDisplayInRect: actually causes the screen update
region to be clipped to the dirty rect.  So, even if my drawRect redraws the
whole view, only drawing within the dirty region will updated on screen.
Is this expected?

But if I ignore the dirty rect passed into drawRect, this "clipping" doesn't
actually makes things any faster right?  Since Quartz is still rendering the
whole view within drawRect (which is what's the real time-consuming part).

Could someone help me clear up the concept?

Thanks
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Is setNeedsDisplayInRect: smarter than I thought?
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Translucent Window and standard title buttons : is it possible ?
  • Next by Date: Does a NSView's bounds.size always equal to frame.size?
  • Previous by thread: Translucent Window and standard title buttons : is it possible ?
  • Next by thread: Re: Is setNeedsDisplayInRect: smarter than I thought?
  • Index(es):
    • Date
    • Thread