SkAutoCanvasRestore Reference === # Automatic Canvas Restore # Class SkAutoCanvasRestore Stack helper class calls SkCanvas::restoreToCount when SkAutoCanvasRestore goes out of scope. Use this to guarantee that the canvas is restored to a known state. ## Overview
Topic | Description |
---|---|
Constructors | functions that construct SkAutoCanvasRestore |
Functions | global and class member functions |
Topic | Description |
---|---|
SkAutoCanvasRestore(SkCanvas* canvas, bool doSave) | preserves Canvas save count |
~SkAutoCanvasRestore() | restores Canvas to saved state |
Topic | Description |
---|---|
restore | restores Canvas to saved state |
SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)Preserves Canvas save count. Optionally saves Canvas Clip and Canvas Matrix. ### Parameters
canvas |
Canvas to guard |
doSave |
call SkCanvas::save() |
~SkAutoCanvasRestore()Restores Canvas to saved state. Destructor is called when container goes out of scope. ### See Also SkCanvas::save SkCanvas::restore --- ## restore
void restore()Restores Canvas to saved state immediately. Subsequent calls and ~SkAutoCanvasRestore have no effect. ### Example