Remove unnecessary repaints