Permalink
Browse files

add shadowPath to improve rendering performance

Apple says:
"Specifying the path explicitly using this property will usually improve rendering performance, as will sharing the same path reference across multiple layers."
  • Loading branch information...
1 parent d6da656 commit 0bc200c3502a01904c3747ce18f7ee07d6ea664f @yfme yfme committed Apr 8, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 REComposeViewController/REComposeViewController.m
View
1 REComposeViewController/REComposeViewController.m
@@ -76,6 +76,7 @@ - (void)viewDidLoad
_backView.layer.shadowOpacity = 0.7;
_backView.layer.shadowColor = [UIColor blackColor].CGColor;
_backView.layer.shadowOffset = CGSizeMake(3, 5);
+ _backView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:_backView.frame cornerRadius:_cornerRadius].CGPath;
_backView.layer.shouldRasterize = YES;
_backView.layer.rasterizationScale = [UIScreen mainScreen].scale;

0 comments on commit 0bc200c

Please sign in to comment.