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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 SaveFlags flags = kARGB_ClipLayer_SaveFlag); 295 SaveFlags flags = kARGB_ClipLayer_SaveFlag);
296 296
297 /** This call balances a previous call to save(), and is used to remove all 297 /** This call balances a previous call to save(), and is used to remove all
298 modifications to the matrix/clip/drawFilter state since the last save 298 modifications to the matrix/clip/drawFilter state since the last save
299 call. 299 call.
300 It is an error to call restore() more times than save() was called. 300 It is an error to call restore() more times than save() was called.
301 */ 301 */
302 virtual void restore(); 302 virtual void restore();
303 303
304 /** Returns the number of matrix/clip states on the SkCanvas' private stack. 304 /** Returns the number of matrix/clip states on the SkCanvas' private stack.
305 This will equal # save() calls - # restore() calls. 305 This will equal # save() calls - # restore() calls + 1. The save count o n
306 a new canvas is 1.
306 */ 307 */
307 int getSaveCount() const; 308 int getSaveCount() const;
308 309
309 /** Efficient way to pop any calls to save() that happened after the save 310 /** Efficient way to pop any calls to save() that happened after the save
310 count reached saveCount. It is an error for saveCount to be less than 311 count reached saveCount. It is an error for saveCount to be greater than
311 getSaveCount() 312 getSaveCount(). To pop all the way back to the initial matrix/clip conte xt
313 pass saveCount == 1.
312 @param saveCount The number of save() levels to restore from 314 @param saveCount The number of save() levels to restore from
313 */ 315 */
314 void restoreToCount(int saveCount); 316 void restoreToCount(int saveCount);
315 317
316 /** Returns true if drawing is currently going to a layer (from saveLayer) 318 /** Returns true if drawing is currently going to a layer (from saveLayer)
317 * rather than to the root device. 319 * rather than to the root device.
318 */ 320 */
319 virtual bool isDrawingToLayer() const; 321 virtual bool isDrawingToLayer() const;
320 322
321 /** Preconcat the current matrix with the specified translation 323 /** Preconcat the current matrix with the specified translation
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 fCanvas->endCommentGroup(); 1202 fCanvas->endCommentGroup();
1201 } 1203 }
1202 } 1204 }
1203 1205
1204 private: 1206 private:
1205 SkCanvas* fCanvas; 1207 SkCanvas* fCanvas;
1206 }; 1208 };
1207 #define SkAutoCommentBlock(...) SK_REQUIRE_LOCAL_VAR(SkAutoCommentBlock) 1209 #define SkAutoCommentBlock(...) SK_REQUIRE_LOCAL_VAR(SkAutoCommentBlock)
1208 1210
1209 #endif 1211 #endif
OLDNEW
« 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