Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: include/core/SkCanvas.h

Issue 150653010: Add unit test for unbalanced save and restores in pictures. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix typo Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 7235efb2f0a9cd3b23132541d9c695b0c81e1704..b1d415f72441d73fc7d13d42707806cedb043cf9 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -302,13 +302,15 @@ public:
virtual void restore();
/** Returns the number of matrix/clip states on the SkCanvas' private stack.
- This will equal # save() calls - # restore() calls.
+ This will equal # save() calls - # restore() calls + 1. The save count on
+ a new canvas is 1.
*/
int getSaveCount() const;
/** Efficient way to pop any calls to save() that happened after the save
- count reached saveCount. It is an error for saveCount to be less than
- getSaveCount()
+ count reached saveCount. It is an error for saveCount to be greater than
+ getSaveCount(). To pop all the way back to the initial matrix/clip context
+ pass saveCount == 1.
@param saveCount The number of save() levels to restore from
*/
void restoreToCount(int saveCount);
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698