Protected the draw methods from changes in the processing modes
(rectMode, ellipseMode, textMode, shapeMode). 

Several improvements in the memory efficiency of some of the classes

Signed-off-by: jagracar <jagracar@gmail.com>