Did you know ... Search Documentation:
canvas->save_state