De-virtualize SkCanvas save/restore.

This moves the state management logic into non-virtual SkCanvas methods,
and turns the virtuals into protected notifiers.

R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/194713008

git-svn-id: http://skia.googlecode.com/svn/trunk@13776 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index 0bbb640..bf3758d 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -206,14 +206,8 @@
                               const uint16_t indices[], int indexCount,
                               const SkPaint&) SK_OVERRIDE;
 
-    virtual void restore() SK_OVERRIDE;
-
     virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
 
-    virtual int save(SaveFlags) SK_OVERRIDE;
-
-    virtual int saveLayer(const SkRect* bounds, const SkPaint*, SaveFlags) SK_OVERRIDE;
-
     virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
 
     virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
@@ -248,6 +242,10 @@
     }
 
 protected:
+    virtual void willSave(SaveFlags) SK_OVERRIDE;
+    virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
+    virtual void willRestore() SK_OVERRIDE;
+
     virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
     virtual void onPushCull(const SkRect& cullRect) SK_OVERRIDE;
     virtual void onPopCull() SK_OVERRIDE;