Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 3bf1ad9e8041393c53c8d1ffa225e630f0795e56..afb89b038e59a3bbcb5788abd179712203eb7626 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -811,6 +811,36 @@ void SkCanvas::updateDeviceCMCache() { |
/////////////////////////////////////////////////////////////////////////////// |
+int SkCanvas::getSaveCount() const { |
+ return fMCStack.count(); |
+} |
+ |
+int SkCanvas::save() { |
+ this->willSave(); |
+ return this->internalSave(); |
+} |
+ |
+void SkCanvas::restore() { |
+ // check for underflow |
+ if (fMCStack.count() > 1) { |
+ this->willRestore(); |
+ this->internalRestore(); |
+ this->didRestore(); |
+ } |
+} |
+ |
+void SkCanvas::restoreToCount(int count) { |
+ // sanity check |
+ if (count < 1) { |
+ count = 1; |
+ } |
+ |
+ int n = this->getSaveCount() - count; |
+ for (int i = 0; i < n; ++i) { |
+ this->restore(); |
+ } |
+} |
+ |
int SkCanvas::internalSave() { |
int saveCount = this->getSaveCount(); // record this before the actual save |
@@ -823,11 +853,6 @@ int SkCanvas::internalSave() { |
return saveCount; |
} |
-int SkCanvas::save() { |
- this->willSave(); |
- return this->internalSave(); |
-} |
- |
static bool bounds_affects_clip(SkCanvas::SaveFlags flags) { |
#ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG |
return (flags & SkCanvas::kClipToLayer_SaveFlag) != 0; |
@@ -977,15 +1002,6 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha, |
} |
} |
-void SkCanvas::restore() { |
- // check for underflow |
- if (fMCStack.count() > 1) { |
- this->willRestore(); |
- this->internalRestore(); |
- this->didRestore(); |
- } |
-} |
- |
void SkCanvas::internalRestore() { |
SkASSERT(fMCStack.count() != 0); |
@@ -1023,22 +1039,6 @@ void SkCanvas::internalRestore() { |
} |
} |
-int SkCanvas::getSaveCount() const { |
- return fMCStack.count(); |
-} |
- |
-void SkCanvas::restoreToCount(int count) { |
- // sanity check |
- if (count < 1) { |
- count = 1; |
- } |
- |
- int n = this->getSaveCount() - count; |
- for (int i = 0; i < n; ++i) { |
- this->restore(); |
- } |
-} |
- |
bool SkCanvas::isDrawingToLayer() const { |
return fSaveLayerCount > 0; |
} |