aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCanvas.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-26 13:40:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 13:40:09 -0700
commita644116c3375b12c642d1b51ee1e5cf4a22c1f5b (patch)
tree0e400cbdbd0b5dd8eee77d37c6e5373f5f2e1d3e /src/core/SkCanvas.cpp
parentfd3a91e1fc4de69611b5297f624a1cd65db4ced1 (diff)
Revert of Make the canvas draw looper setup update the canvas save count (patchset #1 id:1 of https://codereview.chromium.org/1034033004/)
Reason for revert: makes internalSave and internalSaveLayer inconsistent. Need to find a different solution. Original issue's description: > Make the canvas draw looper setup update the canvas save count > > Image filter in a paint would leave save count in wrong state > for normal draws. This could be observed through the canvas > references during the draw call. An example of this is > inspecting the canvas during a draw looper. > > patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001) > > BUG=skia: > TBR=kkinnunen@nvidia.com > > Committed: https://skia.googlesource.com/skia/+/fd3a91e1fc4de69611b5297f624a1cd65db4ced1 TBR=kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1037653004
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r--src/core/SkCanvas.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index ac909def6a..8426f090ec 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -795,6 +795,7 @@ void SkCanvas::restore() {
if (fMCStack.count() > 1) {
this->willRestore();
SkASSERT(fSaveCount > 1);
+ fSaveCount -= 1;
this->internalRestore();
this->didRestore();
}
@@ -878,6 +879,7 @@ 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;
}
@@ -887,6 +889,7 @@ 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;
}
@@ -897,8 +900,6 @@ 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();
@@ -977,8 +978,6 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
void SkCanvas::internalRestore() {
SkASSERT(fMCStack.count() != 0);
- fSaveCount -= 1;
-
fDeviceCMDirty = true;
fCachedLocalClipBoundsDirty = true;