• 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
Re: Optimizing NSRectFill
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing NSRectFill


  • Subject: Re: Optimizing NSRectFill
  • From: Stéphane Sudre <email@hidden>
  • Date: Fri, 19 Dec 2008 17:24:51 +0100


On Dec 19, 2008, at 4:37 PM, Oleg Krupnov wrote:

I'm developing a custom view and noticed that drawRect is becoming
increasingly slow. The Shark has pointed out that the bottleneck is
the NSRectFill function (that calls CGContextFillRect under the hood)
that I use to draw the background of the view. I am disappointed that
such a basic operation could ever impair performance, but it does. It
looks like the bigger is the rectangle, the slower is performance.

I have read the list regarding this issue, but I haven't found any
solution. NSRectFillList, CGContextFillRect do not give any
performance gain.

My question is - is there a way to bypass the advanced path-related
stuff that causes the slow-down, and just get down to some kind of
fast drawing?

There are different ways to optimize drawRect: drawings.

Most of them involves only refreshing the parts of the view that are really needed to be refreshed. You have different APIs and pieces of information that can help you with this task.

The first one being the NSRect used as the parameter for drawRect:. It describes the bounding box of the refresh area. If your issue is with the background of the view and your background pattern is just a color, use this NSRect for NSRectFill.


_______________________________________________

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


References: 
 >Optimizing NSRectFill (From: "Oleg Krupnov" <email@hidden>)

  • Prev by Date: Re: Accepting iCal events dropped on my application's icon
  • Next by Date: Re: NSData downloaded over socket is bigger than it should be...
  • Previous by thread: Optimizing NSRectFill
  • Next by thread: Re: Optimizing NSRectFill
  • Index(es):
    • Date
    • Thread