The library should strive to save then restore graphics context each time it manipulates the context.