• 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
Drawing performance in CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing performance in CALayer


  • Subject: Drawing performance in CALayer
  • From: Graham Cox <email@hidden>
  • Date: Fri, 29 Jul 2011 16:23:03 +1000

In my iTunes visualizer, I'm using layers to draw many, many small rectangles (to represent segments of a spectrum analyser display). There can be up to 32 bands x 40 segments x 2 channels = 2,560 segments, all redrawn 30 times per second or more.

One layer is used for one bar, which is 40 rectangles. In my override of -drawInContext: I draw these using NSRectFill() in a loop.

Am I right in thinking that using calls such as NSRectFill within a CALayer like this is really making OpenGL calls behind the scenes? If so it's probably going as fast as it can. On my middling iMac it's acceptably fast, but laptops start to show a bit of a slow-down.

I can think of ways to optimise this, but first I want to know whether this is truly the fastest way to draw a simple solid rectangle in this situation. If not, what's better?

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Drawing performance in CALayer
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: UIImageView subclasses
  • Next by Date: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • Previous by thread: Re: UIImageView subclasses
  • Next by thread: Re: Drawing performance in CALayer
  • Index(es):
    • Date
    • Thread