¡@

Home 

2014/10/15 ¤U¤È 10:14:34

iphone Programming Glossary: strokecontext

Why is UIBezierPath faster than Core Graphics path?

http://stackoverflow.com/questions/6327817/why-is-uibezierpath-faster-than-core-graphics-path

CGPointMake x2 uiBaseline 50 UIColor blackColor setStroke CGContextAddPath ctx cgpath Stroke each path. self strokeContext ctx self strokeUIBezierPath uipath uipath release CGPathRelease cgpath void strokeContext CGContextRef context CGContextStrokePath.. Stroke each path. self strokeContext ctx self strokeUIBezierPath uipath uipath release CGPathRelease cgpath void strokeContext CGContextRef context CGContextStrokePath context void strokeUIBezierPath UIBezierPath path path stroke Both paths use CGContextStrokePath.. I can see the time used by each path in Instruments. Below are typical results call tree inverted you can see that strokeContext takes 9.5 sec. while strokeUIBezierPath takes only 5 sec. Running Self Symbol Name 14638.0ms 88.2 CGContextStrokePath 9587.0ms..