Is there any performance loss when calling UIGraphicsGetCurrentContext repeatedly

I create UIViewwith a custom function drawRect. This is a rather complicated representation in which several different elements need to be distinguished. I basically broke it down into one function per element to be drawn.

I am wondering if I should pass mine CGContextRef, obtained from UIGraphicsGetCurrentContext(), as a parameter for each function, or can I just call it at the beginning of each function? The last option looks more accurate for me, but I wonder if there is a significant penalty for performance?

+3
source share
3 answers

, / . , , .

, , , UIGraphicsGetCurrentContext(). , , , .

, ...

+4

Pier-Olivier , : , . . , CGContextRef, , . Instruments , . , ( ), .

+3

, .

, , , / ... .

0
source

All Articles