remove SkClipVisitor

With new device clipping, this is unsupported on SkCanvas

BUG=skia:

Change-Id: I39443f213be1005b8b9208d604e4bfb31cbda424
Reviewed-on: https://skia-review.googlesource.com/9349
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 3ce4bae..840a647 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -21,7 +21,6 @@
 class GrRenderTargetContext;
 class SkBaseDevice;
 class SkBitmap;
-class SkCanvasClipVisitor;
 class SkClipStack;
 class SkData;
 class SkDraw;
@@ -1326,14 +1325,6 @@
     */
     const SkMatrix& getTotalMatrix() const;
 
-    typedef SkCanvasClipVisitor ClipVisitor;
-    /**
-     *  Replays the clip operations, back to front, that have been applied to
-     *  the canvas, calling the appropriate method on the visitor for each
-     *  clip. All clips have already been transformed into device space.
-     */
-    void replayClips(ClipVisitor*) const;
-
     ///////////////////////////////////////////////////////////////////////////
 
     // don't call
@@ -1741,12 +1732,4 @@
 };
 #define SkAutoCanvasRestore(...) SK_REQUIRE_LOCAL_VAR(SkAutoCanvasRestore)
 
-class SkCanvasClipVisitor {
-public:
-    virtual ~SkCanvasClipVisitor();
-    virtual void clipRect(const SkRect&, SkClipOp, bool antialias) = 0;
-    virtual void clipRRect(const SkRRect&, SkClipOp, bool antialias) = 0;
-    virtual void clipPath(const SkPath&, SkClipOp, bool antialias) = 0;
-};
-
 #endif
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index c3e6aa6..68a11bf 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1563,17 +1563,6 @@
 }
 #endif
 
-void SkCanvas::replayClips(ClipVisitor* visitor) const {
-#if 0
-    SkClipStack::B2TIter                iter(*fClipStack);
-    const SkClipStack::Element*         element;
-
-    while ((element = iter.next()) != nullptr) {
-        element->replay(visitor);
-    }
-#endif
-}
-
 bool SkCanvas::androidFramework_isClipAA() const {
     bool containsAA = false;
 
@@ -3163,10 +3152,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkCanvasClipVisitor::~SkCanvasClipVisitor() { }
-
-///////////////////////////////////////////////////////////////////////////////
-
 static bool supported_for_raster_canvas(const SkImageInfo& info) {
     switch (info.alphaType()) {
         case kPremul_SkAlphaType:
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index f41945e..33d42ac 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -70,25 +70,6 @@
     }
 }
 
-void SkClipStack::Element::replay(SkCanvasClipVisitor* visitor) const {
-    static const SkRect kEmptyRect = { 0, 0, 0, 0 };
-
-    switch (fType) {
-        case kPath_Type:
-            visitor->clipPath(this->getPath(), this->getOp(), this->isAA());
-            break;
-        case kRRect_Type:
-            visitor->clipRRect(this->getRRect(), this->getOp(), this->isAA());
-            break;
-        case kRect_Type:
-            visitor->clipRect(this->getRect(), this->getOp(), this->isAA());
-            break;
-        case kEmpty_Type:
-            visitor->clipRect(kEmptyRect, kIntersect_SkClipOp, false);
-            break;
-    }
-}
-
 void SkClipStack::Element::invertShapeFillType() {
     switch (fType) {
         case kRect_Type:
diff --git a/src/core/SkClipStack.h b/src/core/SkClipStack.h
index 080712d..c6786e6 100644
--- a/src/core/SkClipStack.h
+++ b/src/core/SkClipStack.h
@@ -21,8 +21,6 @@
 #include "GrResourceKey.h"
 #endif
 
-class SkCanvasClipVisitor;
-
 // Because a single save/restore state can have multiple clips, this class
 // stores the stack depth (fSaveCount) and clips (fDeque) separately.
 // Each clip in fDeque stores the stack state to which it belongs
@@ -196,11 +194,6 @@
             return kPath_Type == fType && fPath.get()->isInverseFillType();
         }
 
-        /**
-        * Replay this clip into the visitor.
-        */
-        void replay(SkCanvasClipVisitor*) const;
-
 #ifdef SK_DEBUG
         /**
          * Dumps the element to SkDebugf. This is intended for Skia development debugging
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index e84b7ba..2d9a319 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -198,24 +198,6 @@
     }
 };
 
-class Canvas2CanvasClipVisitor : public SkCanvas::ClipVisitor {
-public:
-    Canvas2CanvasClipVisitor(SkCanvas* target) : fTarget(target) {}
-
-    void clipRect(const SkRect& r, SkClipOp op, bool aa) override {
-        fTarget->clipRect(r, op, aa);
-    }
-    void clipRRect(const SkRRect& r, SkClipOp op, bool aa) override {
-        fTarget->clipRRect(r, op, aa);
-    }
-    void clipPath(const SkPath& p, SkClipOp op, bool aa) override {
-        fTarget->clipPath(p, op, aa);
-    }
-
-private:
-    SkCanvas* fTarget;
-};
-
 // Format strings that describe the test context.  The %s token is where
 // the name of the test step is inserted.  The context is required for
 // disambiguating the error in the case of failures that are reported in
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index 522f4ed..ace39a4 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -149,39 +149,6 @@
     return layer;
 }
 
-class SkDebugClipVisitor : public SkCanvas::ClipVisitor {
-public:
-    SkDebugClipVisitor(SkCanvas* canvas) : fCanvas(canvas) {}
-
-    void clipRect(const SkRect& r, SkClipOp, bool doAA) override {
-        SkPaint p;
-        p.setColor(SK_ColorRED);
-        p.setStyle(SkPaint::kStroke_Style);
-        p.setAntiAlias(doAA);
-        fCanvas->drawRect(r, p);
-    }
-    void clipRRect(const SkRRect& rr, SkClipOp, bool doAA) override {
-        SkPaint p;
-        p.setColor(SK_ColorGREEN);
-        p.setStyle(SkPaint::kStroke_Style);
-        p.setAntiAlias(doAA);
-        fCanvas->drawRRect(rr, p);
-    }
-    void clipPath(const SkPath& path, SkClipOp, bool doAA) override {
-        SkPaint p;
-        p.setColor(SK_ColorBLUE);
-        p.setStyle(SkPaint::kStroke_Style);
-        p.setAntiAlias(doAA);
-        fCanvas->drawPath(path, p);
-    }
-
-protected:
-    SkCanvas* fCanvas;
-
-private:
-    typedef SkCanvas::ClipVisitor INHERITED;
-};
-
 // set up the saveLayer commands so that the active ones
 // return true in their 'active' method
 void SkDebugCanvas::markActiveCommands(int index) {
@@ -298,11 +265,6 @@
             r.outset(SK_Scalar1, SK_Scalar1);
             filterCanvas.clipRect(r, kReplace_SkClipOp);
         }
-        // visualize existing clips
-        SkDebugClipVisitor visitor(&filterCanvas);
-
-        filterCanvas.replayClips(&visitor);
-
         filterCanvas.restore();
     }
     if (pathOpsMode) {