• 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
Core Animation Flickering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Animation Flickering


  • Subject: Core Animation Flickering
  • From: Colin Cornaby <email@hidden>
  • Date: Fri, 25 Apr 2008 01:20:40 -0700

I have a CALayer subclass, set to redraw on bounds change, with the following draw code (I don't expect it to be meaningful, but I'm pasting it here for the sake of completeness.)

- (void)drawInContext:(CGContextRef)ctx
{
CGRect bounds = CGContextGetClipBoundingBox(ctx);
CGContextDrawImage(ctx, CGRectMake(0,0,18, bounds.size.height-18),sideImage);
CGContextDrawImage(ctx, CGRectMake(0,bounds.size.height-18,18, 18),cornerImage);
CGContextDrawImage(ctx, CGRectMake(18,bounds.size.height-18,bounds.size.width-36,18),topImage);
CGContextScaleCTM (ctx, -1.0, 1.0);
CGContextTranslateCTM ( ctx, -bounds.size.width, 0.0);
CGContextDrawImage(ctx, CGRectMake(0.0,bounds.size.height-18,18,18),cornerImage);
CGContextDrawImage(ctx, CGRectMake(0.0,0.0,18,bounds.size.height-18),sideImage);
}


It's parent view is set up to change the layers frame to always fill the contents of the entire view on resizeWithOldSuperviewSize:. This works great, except for a really annoying flicker that occurs once every few seconds while the view is resizing. Every layer in the view flickers in and out (stuff like background colors doesn't flicker).

Did I miss some drawing cleanup or something else obvious here?

(I've tried doing this automatically with constraint managers, same problem...)
_______________________________________________


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: Core Animation Flickering
      • From: John Harper <email@hidden>
  • Prev by Date: Re: Failure on unarchiving a NSBezierPath
  • Next by Date: Using a real view in a Table cell
  • Previous by thread: Re: One pixel width. One.
  • Next by thread: Re: Core Animation Flickering
  • Index(es):
    • Date
    • Thread