add restore() to SkAutoCanvasRestore
git-svn-id: http://skia.googlecode.com/svn/trunk@6505 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
7ba591eb7a
commit
f6c9a5ba5c
@ -1085,7 +1085,20 @@ public:
|
||||
}
|
||||
}
|
||||
~SkAutoCanvasRestore() {
|
||||
fCanvas->restoreToCount(fSaveCount);
|
||||
if (fCanvas) {
|
||||
fCanvas->restoreToCount(fSaveCount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the restore now, instead of waiting for the destructor. Will
|
||||
* only do this once.
|
||||
*/
|
||||
void restore() {
|
||||
if (fCanvas) {
|
||||
fCanvas->restoreToCount(fSaveCount);
|
||||
fCanvas = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user