私は iPad 用の描画アプリを作成しており、プロファイリングを行っていたので、どこで描画を高速化できるかを確認できました。
私の描画方法には、次の 4 行のコードがあります。
CGContextDrawImage([DrawingState sharedState].context, CGRectMake(0.0f, 0.0f, [DrawingState sharedState].screenWidth, [DrawingState sharedState].screenHeight), unzoomedBufferImage);
CGImageRef image = CGBitmapContextCreateImage([DrawingState sharedState].context);
CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, 768, 1024), image);
CGImageRelease(image);
最初の行は時間の 18.8% を占め、2 番目、3 番目、および 4 番目の行は時間の 4.5% しか占めておらず、CGContextDrawImage 行は 3.5% を占めています。
これら 2 つの CGContextDrawImage 関数のパフォーマンスが大きく異なるのはなぜですか (18.8% 対 3.5%)。
注: [DrawingState sharedState].screenWidth と [DrawingState sharedState].screenHeight はそれぞれ 768 と 1024 であるため、理論的には同じ量の描画を行っています。