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

Unified Diff: src/core/SkCanvas.cpp

Issue 1034033004: Make the canvas draw looper setup update the canvas save count (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « gyp/tests.gypi ('k') | tests/DrawLooperTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 8426f090ec5949653ab516ffca3f7d33a317c338..ac909def6a662f8445c456a2bf4527395567c1d2 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -795,7 +795,6 @@ void SkCanvas::restore() {
if (fMCStack.count() > 1) {
this->willRestore();
SkASSERT(fSaveCount > 1);
- fSaveCount -= 1;
this->internalRestore();
this->didRestore();
}
@@ -879,7 +878,6 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) {
bounds = NULL;
}
SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag);
- fSaveCount += 1;
this->internalSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag, strategy);
return this->getSaveCount() - 1;
}
@@ -889,7 +887,6 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl
bounds = NULL;
}
SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, flags);
- fSaveCount += 1;
this->internalSaveLayer(bounds, paint, flags, strategy);
return this->getSaveCount() - 1;
}
@@ -900,6 +897,8 @@ void SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Sav
flags |= kClipToLayer_SaveFlag;
#endif
+ fSaveCount += 1;
+
// do this before we create the layer. We don't call the public save() since
// that would invoke a possibly overridden virtual
this->internalSave();
@@ -978,6 +977,8 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
void SkCanvas::internalRestore() {
SkASSERT(fMCStack.count() != 0);
+ fSaveCount -= 1;
+
fDeviceCMDirty = true;
fCachedLocalClipBoundsDirty = true;
« no previous file with comments | « gyp/tests.gypi ('k') | tests/DrawLooperTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698