iPhone:CGContextConcatCTM如何影响CGContextDrawImage的速度?
根据我是否转换我的上下文,我在绘图速度上看到了巨大的差异iPhone:CGContextConcatCTM如何影响CGContextDrawImage的速度?,iphone,Iphone,根据我是否转换我的上下文,我在绘图速度上看到了巨大的差异 - (void)drawLayer:(CALayer *)myLayer inContext:(CGContextRef)context { NSDate *startDate = [[NSDate date] retain]; //CGContextConcatCTM(context, finalTransform); CGContextDrawImage(context, imageRect, imageRef);
- (void)drawLayer:(CALayer *)myLayer inContext:(CGContextRef)context {
NSDate *startDate = [[NSDate date] retain];
//CGContextConcatCTM(context, finalTransform);
CGContextDrawImage(context, imageRect, imageRef);
NSLog(@"%f", [[NSDate date] timeIntervalSinceDate:startDate]);
}
平均产量:-带变换=0.0125
-不带变换=0.000175 这张图像大约是100x100,我正在将其转换为略低于iPad屏幕分辨率。此图像的像素数据通常需要更新,这就是性能问题的原因 绘制时间上的巨大差异(快50倍以上)是预期的吗?在屏幕上绘图时,是否有更好的方法应用缩放变换