Implement some core functionalities of Painter.