Optimize paintview.