• 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: NSDrawNinePartImage draws slowly in CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDrawNinePartImage draws slowly in CALayer


  • Subject: Re: NSDrawNinePartImage draws slowly in CALayer
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 6 Mar 2009 20:59:17 +0100


Le 6 mars 09 à 20:42, Jean-Daniel Dupas a écrit :


Le 6 mars 09 à 20:33, Sebastian Morsch a écrit :

Hello,

I wrote a delegate that draws a bezel inside a CALayer using NSDrawNinePartImage. The drawing happens inside the drawLayer:inContext: method and it works well. The only problem is that it redraws really slow when the layers frame is resized by the user.

The layer is simply attached to a custom view for testing the whole thing. This view is the only view of a window, and when I resize that window, my layer is resized too. But it feels very clunky.

I was wondering if I'm doing something really stupid here... Does anybody know if there's a better way to tackle this?

Thank you!
Sebastian




If you want to know why your code is slow, use the Xcode Debug Menu > Launch Using Performance Tool > Shark.


To be exact, this is the Menu

Run > Start With Performance Tool > Shark

Shark will give you better and more accurate answer.

My guess is that you are creating the images at each call, which require to read them from disk, and decode them and is very slow.

Just an other details, instead of creating the color at each call, you can use CGContextSetRGBFillColor(ctx, 0, 0, 1, .2).

_______________________________________________

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: NSDrawNinePartImage draws slowly in CALayer
      • From: Sebastian Morsch <email@hidden>
References: 
 >NSDrawNinePartImage draws slowly in CALayer (From: Sebastian Morsch <email@hidden>)
 >Re: NSDrawNinePartImage draws slowly in CALayer (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
  • Next by Date: Re: Newbie query re notifications
  • Previous by thread: Re: NSDrawNinePartImage draws slowly in CALayer
  • Next by thread: Re: NSDrawNinePartImage draws slowly in CALayer
  • Index(es):
    • Date
    • Thread