ccontext:Save()
ccontext:Save()
and
ccontext:Restore() can be nested; each call to ccontext:Restore()
restores the state from the matching paired ccontext:Save()
.
It isn't necessary to clear all saved states before a Cairo context is freed. If the reference count of a Cairo context drops to zero in response to a call to ccontext:Free(), any saved states will be freed along with the Cairo context.