I have a UIView
subclass with a custom drawRect:
method which does some expensive calculations to build a path and draws it using CGContextStrokePath()
on the current context.
If my view has a size (x, y)
, I want to do my custom drawing on (0, 0), (x/2, y)
and then fill the (x/2, 0), (x, y)
area with a mirrored image of the first half.
What is the simplest/fastest way of doing this, other than manually duplicating the points to be drawn? Maybe rendering the half view to a bitmap image context and using that one to render on both halves of the current image context? The content is animated, so drawRect:
is roughly executed 60 times per second.