aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-26 13:29:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 13:29:56 -0700
commitfd3a91e1fc4de69611b5297f624a1cd65db4ced1 (patch)
treedfba413e72dabf2d29e9391422de87aadca9df30 /src/core
parent3d4c4a5a9feff961c6ba70443fa40ea1ca0a503e (diff)
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 Review URL: https://codereview.chromium.org/1034033004
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkCanvas.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 8426f090ec..ac909def6a 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;