Move the unpolish/polish calls outside paint, because they call paint.