We repeat the creation of CGLayer, do the processing, and then release it. This is happening in real time. Of course, every time you create a new CGLayer there is a lot of overhead. So that...
Of course, it would be better to just save the layer around and erase all the data from it every time , and not create a new one from scratch.
Note. If you drew an empty or transparent rectangle covering everything , which will add even more data on top of existing paths.
So how to actually “erase” or “start again” CGLayer?
There is a CGContextBeginPath (cc) function, but it is confusing: it seems that only clearing "this" path does not seem to wipe all CGLayer back to a state of missing data .
How to return CGLayer to a state of lack of data? Somebody knows?
Updating ...
Turns out there really are NO WAYS to do this.
After significant experimentation, we determined that there was apparently no way to clear all data from CGLayer (which is really disappointing).
Note that adding a new white or crisp rectangle, only this one actually adds more data.
, , . hz (, ), . ( , ) , CGContextBeginPath().
, - .