I am working on a drawing tool. There are two mark-up types: highlighter and pen. Currently I have to create 2 bitmaps for each because it's vector based and when they "erase" part I use PorterDuff.Mode.Clear to make that line transparent. The problem is that if I draw the highlighter then the pen the eraser for the pen will also erase highlights.
To save memory I'd like to just have one BMP. Is it possible to preserve a point in the draw so that the next set of drawing instructions can't effect what's been drawn? Essentially freezing the highlighter drawing so it's unaffected by the remaining draw commands?