add a end() method to flush the cairo_surface