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

Unified Diff: src/core/SkCanvas.cpp

Issue 22947003: Make ClipStack honor save flags (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Store flags in MCRec rather then using odd check Created 7 years, 4 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 | « include/core/SkDeque.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
===================================================================
--- src/core/SkCanvas.cpp (revision 10709)
+++ src/core/SkCanvas.cpp (working copy)
@@ -214,6 +214,7 @@
class SkCanvas::MCRec {
public:
MCRec* fNext;
+ int fFlags;
SkMatrix* fMatrix; // points to either fMatrixStorage or prev MCRec
SkRasterClip* fRasterClip; // points to either fRegionStorage or prev MCRec
SkDrawFilter* fFilter; // the current filter (or null)
@@ -227,7 +228,7 @@
*/
DeviceCM* fTopLayer;
- MCRec(const MCRec* prev, int flags) {
+ MCRec(const MCRec* prev, int flags) : fFlags(flags) {
if (NULL != prev) {
if (flags & SkCanvas::kMatrix_SaveFlag) {
fMatrixStorage = *prev->fMatrix;
@@ -720,8 +721,9 @@
newTop->fNext = fMCRec;
fMCRec = newTop;
- fClipStack.save();
- SkASSERT(fClipStack.getSaveCount() == this->getSaveCount() - 1);
+ if (SkCanvas::kClip_SaveFlag & flags) {
+ fClipStack.save();
+ }
return saveCount;
}
@@ -896,7 +898,10 @@
fDeviceCMDirty = true;
fLocalBoundsCompareTypeDirty = true;
- fClipStack.restore();
+ if (SkCanvas::kClip_SaveFlag & fMCRec->fFlags) {
+ fClipStack.restore();
+ }
+
// reserve our layer (if any)
DeviceCM* layer = fMCRec->fLayer; // may be null
// now detach it from fMCRec so we can pop(). Gets freed after its drawn
« no previous file with comments | « include/core/SkDeque.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698