remove drawShape from canvas api



git-svn-id: http://skia.googlecode.com/svn/trunk@1723 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/CocoaDebugger/SkDumpCanvasM.cpp b/experimental/CocoaDebugger/SkDumpCanvasM.cpp
index dae5fdb..841837d 100644
--- a/experimental/CocoaDebugger/SkDumpCanvasM.cpp
+++ b/experimental/CocoaDebugger/SkDumpCanvasM.cpp
@@ -351,14 +351,6 @@
                str.c_str(), byteLength);
 }
 
-void SkDumpCanvasM::drawShape(SkShape* shape) {
-    this->dump(kDrawShape_Verb, NULL, "drawShape(%p)", shape);
-    fNestLevel += 1;
-    this->INHERITED::drawShape(shape);
-    fNestLevel -= 1;
-    this->dump(kDrawShape_Verb, NULL, "endShape(%p)", shape);
-}
-
 void SkDumpCanvasM::drawPicture(SkPicture& picture) {
     this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", &picture,
                picture.width(), picture.height());
diff --git a/experimental/CocoaDebugger/SkDumpCanvasM.h b/experimental/CocoaDebugger/SkDumpCanvasM.h
index 23b62ec..24f0ca7 100644
--- a/experimental/CocoaDebugger/SkDumpCanvasM.h
+++ b/experimental/CocoaDebugger/SkDumpCanvasM.h
@@ -33,7 +33,6 @@
         kDrawBitmap_Verb,
         kDrawText_Verb,
         kDrawPicture_Verb,
-        kDrawShape_Verb,
         kDrawVertices_Verb,
         kDrawData_Verb
     };
@@ -97,7 +96,6 @@
                                 const SkPath& path, const SkMatrix* matrix,
                                 const SkPaint& paint);
     virtual void drawPicture(SkPicture&);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode vmode, int vertexCount,
                               const SkPoint vertices[], const SkPoint texs[],
                               const SkColor colors[], SkXfermode* xmode,
diff --git a/gm/shapes.cpp b/gm/shapes.cpp
index 5daea0a..c4ba9ad 100644
--- a/gm/shapes.cpp
+++ b/gm/shapes.cpp
@@ -95,16 +95,14 @@
         matrix.preScale(SK_Scalar1*2, SK_Scalar1*2);
         gs->appendShape(&fGroup, matrix);
 
-#if 0
-        canvas->drawShape(gs);
-#else
+#if 1
         SkPicture* pict = new SkPicture;
         SkCanvas* cv = pict->beginRecording(1000, 1000);
         cv->scale(SK_ScalarHalf, SK_ScalarHalf);
-        cv->drawShape(gs);
+        gs->draw(cv);
         cv->translate(SkIntToScalar(680), SkIntToScalar(480));
         cv->scale(-SK_Scalar1, SK_Scalar1);
-        cv->drawShape(gs);
+        gs->draw(cv);
         pict->endRecording();
         canvas->drawPicture(*pict);
         pict->unref();
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 9b96790..a7f01c4 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -34,7 +34,6 @@
 class SkDraw;
 class SkDrawFilter;
 class SkPicture;
-class SkShape;
 
 /** \class SkCanvas
 
@@ -63,7 +62,7 @@
     */
     explicit SkCanvas(SkDeviceFactory* factory = NULL);
 
-    /** Construct a canvas with the specified device to draw into.  The device

+    /** Construct a canvas with the specified device to draw into.  The device
         factory will be retrieved from the passed device.
 
         @param device   Specifies a device for the canvas to draw into.
@@ -677,10 +676,6 @@
     */
     virtual void drawPicture(SkPicture& picture);
 
-    /** Draws the specified shape
-     */
-    virtual void drawShape(SkShape*);
-
     enum VertexMode {
         kTriangles_VertexMode,
         kTriangleStrip_VertexMode,
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index 2205f6c..afe0fff 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -137,9 +137,15 @@
 
     /** Returns a SkStream with the page contents.  The caller is responsible
         for a reference to the returned value.
+        DEPRECATED: use copyContentToData()
      */
     SK_API SkStream* content() const;
 
+    /** Returns a SkStream with the page contents.  The caller is responsible
+     *  for calling data->unref() when it is finished.
+     */
+    SK_API SkData* copyContentToData() const;
+    
     SK_API const SkMatrix& initialTransform() const {
         return fInitialTransform;
     }
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index 3731bef..3d2805c 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -33,7 +33,6 @@
         kDrawBitmap_Verb,
         kDrawText_Verb,
         kDrawPicture_Verb,
-        kDrawShape_Verb,
         kDrawVertices_Verb,
         kDrawData_Verb
     };
@@ -97,7 +96,6 @@
                                 const SkPath& path, const SkMatrix* matrix,
                                 const SkPaint& paint);
     virtual void drawPicture(SkPicture&);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode vmode, int vertexCount,
                               const SkPoint vertices[], const SkPoint texs[],
                               const SkColor colors[], SkXfermode* xmode,
diff --git a/include/utils/SkNWayCanvas.h b/include/utils/SkNWayCanvas.h
index 03bd6d1..21d1ba6 100644
--- a/include/utils/SkNWayCanvas.h
+++ b/include/utils/SkNWayCanvas.h
@@ -57,7 +57,6 @@
                                 const SkPath& path, const SkMatrix* matrix,
                                 const SkPaint& paint);
     virtual void drawPicture(SkPicture&);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode vmode, int vertexCount,
                               const SkPoint vertices[], const SkPoint texs[],
                               const SkColor colors[], SkXfermode* xmode,
diff --git a/include/utils/SkProxyCanvas.h b/include/utils/SkProxyCanvas.h
index 8d8daec..195b74d 100644
--- a/include/utils/SkProxyCanvas.h
+++ b/include/utils/SkProxyCanvas.h
@@ -64,7 +64,6 @@
                                 const SkPath& path, const SkMatrix* matrix,
                                 const SkPaint& paint);
     virtual void drawPicture(SkPicture&);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode vmode, int vertexCount,
                               const SkPoint vertices[], const SkPoint texs[],
                               const SkColor colors[], SkXfermode* xmode,
diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp
index d7b6b22..585b2f2 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -14,7 +14,6 @@
 #include "SkUtils.h"
 #include "SkColorPriv.h"
 #include "SkColorFilter.h"
-#include "SkShape.h"
 #include "SkTime.h"
 #include "SkTypeface.h"
 #include "SkXfermode.h"
@@ -22,67 +21,6 @@
 #include "SkStream.h"
 #include "SkXMLParser.h"
 
-class SignalShape : public SkShape {
-public:
-    SignalShape() : fSignal(0) {}
-
-    SkShape* setSignal(int n) {
-        fSignal = n;
-        return this;
-    }
-
-protected:
-    virtual void onDraw(SkCanvas* canvas) {
-    //    SkDebugf("---- sc %d\n", canvas->getSaveCount() - 1);
-    }
-
-private:
-    int fSignal;
-};
-
-static SkPMColor SignalProc(SkPMColor src, SkPMColor dst) {
-    return dst;
-}
-
-/*  Picture playback will skip blocks of draw calls that follow a clip() call
-    that returns empty, and jump down to the corresponding restore() call.
-
-    This is a great preformance win for drawing very large/tall pictures with
-    a small visible window (think scrolling a long document). These tests make
-    sure that (a) we are performing the culling, and (b) we don't get confused
-    by nested save() calls, nor by calls to restoreToCount().
- */
-static void test_saveRestoreCulling() {
-    SkPaint signalPaint;
-    SignalShape signalShape;
-
-    SkPicture pic;
-    SkRect r = SkRect::MakeWH(0, 0);
-    int n;
-    SkCanvas* canvas = pic.beginRecording(100, 100);
-    int startN = canvas->getSaveCount();
-    SkDebugf("---- start sc %d\n", startN);
-    canvas->drawShape(signalShape.setSignal(1));
-    canvas->save();
-    canvas->drawShape(signalShape.setSignal(2));
-    n = canvas->save();
-    canvas->drawShape(signalShape.setSignal(3));
-    canvas->save();
-    canvas->clipRect(r);
-    canvas->drawShape(signalShape.setSignal(4));
-    canvas->restoreToCount(n);
-    canvas->drawShape(signalShape.setSignal(5));
-    canvas->restore();
-    canvas->drawShape(signalShape.setSignal(6));
-    SkASSERT(canvas->getSaveCount() == startN);
-
-    SkBitmap bm;
-    bm.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
-    bm.allocPixels();
-    SkCanvas c(bm);
-    c.drawPicture(pic);
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "SkImageRef_GlobalPool.h"
@@ -137,8 +75,6 @@
         // unref fPicture in our destructor, and it will in turn take care of
         // the other references to fSubPicture
         fSubPicture->unref();
-
-        test_saveRestoreCulling();
     }
     
     virtual ~PictureView() {
diff --git a/samplecode/SampleShapes.cpp b/samplecode/SampleShapes.cpp
index dc10f1a..6742017 100644
--- a/samplecode/SampleShapes.cpp
+++ b/samplecode/SampleShapes.cpp
@@ -127,16 +127,14 @@
         matrix.preScale(SK_Scalar1*2, SK_Scalar1*2);
         gs->appendShape(&fGroup, matrix);
         
-#if 0
-        canvas->drawShape(gs);
-#else
+#if 1
         SkPicture* pict = new SkPicture;
         SkCanvas* cv = pict->beginRecording(1000, 1000);
         cv->scale(SK_ScalarHalf, SK_ScalarHalf);
-        cv->drawShape(gs);
+        gs->draw(cv);
         cv->translate(SkIntToScalar(680), SkIntToScalar(480));
         cv->scale(-SK_Scalar1, SK_Scalar1);
-        cv->drawShape(gs);
+        gs->draw(cv);
         pict->endRecording();
         
         drawpicture(canvas, *pict);
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index f8dd028..7325c02 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -22,7 +22,6 @@
 #include "SkDrawLooper.h"
 #include "SkPicture.h"
 #include "SkScalarCompare.h"
-#include "SkShape.h"
 #include "SkTemplates.h"
 #include "SkTLazy.h"
 #include "SkUtils.h"
@@ -1646,11 +1645,6 @@
     restoreToCount(saveCount);
 }
 
-void SkCanvas::drawShape(SkShape* shape) {
-    // shape baseclass takes care of save/restore
-    shape->draw(this);
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index 697b399..a11f556 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -28,7 +28,6 @@
     DRAW_POS_TEXT_H,
     DRAW_POS_TEXT_H_TOP_BOTTOM, // fast variant of DRAW_POS_TEXT_H
     DRAW_RECT,
-    DRAW_SHAPE,
     DRAW_SPRITE,
     DRAW_TEXT,
     DRAW_TEXT_ON_PATH,
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 67b6865..05663e5 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -120,17 +120,6 @@
         }
     }
 
-    const SkTDArray<SkShape* >& shapes = record.getShapes();
-    fShapeCount = shapes.count();
-    if (fShapeCount > 0) {
-        fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
-        for (int i = 0; i < fShapeCount; i++) {
-            SkShape* s = shapes[i];
-            SkSafeRef(s);
-            fShapes[i] = s;
-        }
-    }
-
     const SkTDArray<const SkFlatRegion* >& regions = record.getRegions();
     fRegionCount = regions.count();
     if (fRegionCount > 0) {
@@ -203,14 +192,6 @@
         fPictureRefs[i]->ref();
     }
 
-    fShapeCount = src.fShapeCount;
-    fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
-    for (int i = 0; i < fShapeCount; i++) {
-        SkShape* s = src.fShapes[i];
-        SkSafeRef(s);
-        fShapes[i] = s;
-    }
-
     fRegionCount = src.fRegionCount;
     fRegions = SkNEW_ARRAY(SkRegion, fRegionCount);
     for (i = 0; i < fRegionCount; i++) {
@@ -224,10 +205,9 @@
     fPaints = NULL;
     fPathHeap = NULL;
     fPictureRefs = NULL;
-    fShapes = NULL;
     fRegions = NULL;
     fBitmapCount = fMatrixCount = fPaintCount = fPictureCount =
-    fRegionCount = fShapeCount = 0;
+    fRegionCount = 0;
 
     fFactoryPlayback = NULL;
 }
@@ -247,11 +227,6 @@
     }
     SkDELETE_ARRAY(fPictureRefs);
 
-    for (int i = 0; i < fShapeCount; i++) {
-        SkSafeUnref(fShapes[i]);
-    }
-    SkDELETE_ARRAY(fShapes);
-
     SkDELETE(fFactoryPlayback);
 }
 
@@ -281,7 +256,6 @@
 #define PICT_PAINT_TAG      SkSetFourByteTag('p', 'n', 't', ' ')
 #define PICT_PATH_TAG       SkSetFourByteTag('p', 't', 'h', ' ')
 #define PICT_REGION_TAG     SkSetFourByteTag('r', 'g', 'n', ' ')
-#define PICT_SHAPE_TAG      SkSetFourByteTag('s', 'h', 'p', ' ')
 
 #include "SkStream.h"
 
@@ -378,11 +352,6 @@
         buffer.writePad(storage.get(), size);
     }
 
-    writeTagSize(buffer, PICT_SHAPE_TAG, fShapeCount);
-    for (i = 0; i < fShapeCount; i++) {
-        buffer.writeFlattenable(fShapes[i]);
-    }
-
     // now we can write to the stream again
 
     writeFactories(stream, factSet);
@@ -491,12 +460,6 @@
         SkDEBUGCODE(uint32_t bytes =) fRegions[i].unflatten(buffer.skip(size));
         SkASSERT(size == bytes);
     }
-
-    fShapeCount = readTagSize(buffer, PICT_SHAPE_TAG);
-    fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
-    for (i = 0; i < fShapeCount; i++) {
-        fShapes[i] = reinterpret_cast<SkShape*>(buffer.readFlattenable());
-    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -651,12 +614,6 @@
                 const SkPaint& paint = *getPaint();
                 canvas.drawRect(*fReader.skipRect(), paint);
             } break;
-            case DRAW_SHAPE: {
-                SkShape* shape = getShape();
-                if (shape) {
-                    canvas.drawShape(shape);
-                }
-            } break;
             case DRAW_SPRITE: {
                 const SkPaint* paint = getPaint();
                 const SkBitmap& bitmap = getBitmap();
diff --git a/src/core/SkPicturePlayback.h b/src/core/SkPicturePlayback.h
index 350df78..7eda167 100644
--- a/src/core/SkPicturePlayback.h
+++ b/src/core/SkPicturePlayback.h
@@ -11,7 +11,6 @@
 #include "SkPathHeap.h"
 #include "SkRegion.h"
 #include "SkPictureFlat.h"
-#include "SkShape.h"
 
 #ifdef ANDROID
 #include "SkThread.h"
@@ -78,12 +77,6 @@
         return *fPictureRefs[index - 1];
     }
     
-    SkShape* getShape() {
-        int index = getInt();
-        SkASSERT(index > 0 && index <= fShapeCount);
-        return fShapes[index - 1];
-    }
-    
     const SkPaint* getPaint() {
         int index = getInt();
         if (index == 0) {
@@ -170,8 +163,6 @@
 
     SkPicture** fPictureRefs;
     int fPictureCount;
-    SkShape** fShapes;
-    int fShapeCount;
 
     SkRefCntPlayback fRCPlayback;
     SkTypefacePlayback fTFPlayback;
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 6b2b330..9339efc 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -1,5 +1,4 @@
 #include "SkPictureRecord.h"
-#include "SkShape.h"
 #include "SkTSearch.h"
 
 #define MIN_WRITER_SIZE 16384
@@ -368,20 +367,6 @@
     validate();
 }
 
-void SkPictureRecord::drawShape(SkShape* shape) {
-    addDraw(DRAW_SHAPE);
-
-    int index = fShapes.find(shape);
-    if (index < 0) {    // not found
-        index = fShapes.count();
-        *fShapes.append() = shape;
-        shape->ref();
-    }
-    // follow the convention of recording a 1-based index
-    addInt(index + 1);
-    validate();
-}
-
 void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount,
                           const SkPoint vertices[], const SkPoint texs[],
                           const SkColor colors[], SkXfermode*,
@@ -433,7 +418,6 @@
     fPaints.reset();
     fPictureRefs.unrefAll();
     fRegions.reset();
-    fShapes.safeUnrefAll();
     fWriter.reset();
     fHeap.reset();
 
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index e0d6a50..9c86cf9 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -51,7 +51,6 @@
                             const SkPath& path, const SkMatrix* matrix, 
                                 const SkPaint&);
     virtual void drawPicture(SkPicture& picture);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode, int vertexCount,
                           const SkPoint vertices[], const SkPoint texs[],
                           const SkColor colors[], SkXfermode*,
@@ -73,9 +72,6 @@
     const SkTDArray<SkPicture* >& getPictureRefs() const {
         return fPictureRefs;
     }
-    const SkTDArray<SkShape* >& getShapes() const {
-        return fShapes;
-    }
     const SkTDArray<const SkFlatRegion* >& getRegions() const {
         return fRegions;
     }
@@ -173,7 +169,6 @@
 
     // we ref each item in these arrays
     SkTDArray<SkPicture*> fPictureRefs;
-    SkTDArray<SkShape*> fShapes;
 
     SkRefCntSet fRCSet;
     SkRefCntSet fTFSet;
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index bd94471..d48ce7d 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1081,10 +1081,13 @@
     return mediaBox;
 }
 
-/**
- *  Can this return SkData instead of SkStream?
- */
 SkStream* SkPDFDevice::content() const {
+    SkMemoryStream* result = new SkMemoryStream;
+    result->setData(this->copyContentToData())->unref();
+    return result;
+}
+
+SkData* SkPDFDevice::copyContentToData() const {
     SkDynamicMemoryWStream data;
     if (fInitialTransform.getType() != SkMatrix::kIdentity_Mask) {
         SkPDFUtils::AppendTransform(fInitialTransform, &data);
@@ -1097,11 +1100,11 @@
         SkRect r = SkRect::MakeWH(this->width(), this->height());
         emit_clip(NULL, &r, &data);
     }
-
+    
     GraphicStackState gsState(fExistingClipStack, fExistingClipRegion, &data);
     for (ContentEntry* entry = fContentEntries.get();
-            entry != NULL;
-            entry = entry->fNext.get()) {
+         entry != NULL;
+         entry = entry->fNext.get()) {
         SkIPoint translation = this->getOrigin();
         translation.negate();
         gsState.updateClip(entry->fState.fClipStack, entry->fState.fClipRegion,
@@ -1114,9 +1117,9 @@
     }
     gsState.drainStack();
 
-    SkMemoryStream* result = new SkMemoryStream;
-    result->setData(data.copyToData())->unref();
-    return result;
+    // potentially we could cache this SkData, and only rebuild it if we
+    // see that our state has changed.
+    return data.copyToData();
 }
 
 void SkPDFDevice::createFormXObjectFromDevice(
diff --git a/src/pipe/SkGPipePriv.h b/src/pipe/SkGPipePriv.h
index 06ba7b6..7122992 100644
--- a/src/pipe/SkGPipePriv.h
+++ b/src/pipe/SkGPipePriv.h
@@ -56,7 +56,6 @@
     kDrawPosText_DrawOp,
     kDrawPosTextH_DrawOp,
     kDrawRect_DrawOp,
-    kDrawShape_DrawOp,
     kDrawSprite_DrawOp,
     kDrawText_DrawOp,
     kDrawTextOnPath_DrawOp,
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index fb0fbc4..07d4ee2 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -364,11 +364,6 @@
     canvas->drawData(data, size);
 }
 
-static void drawShape_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
-                         SkGPipeState* state) {
-    UNIMPLEMENTED
-}
-
 static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
                            SkGPipeState* state) {
     UNIMPLEMENTED
@@ -463,7 +458,6 @@
     drawPosText_rp,
     drawPosTextH_rp,
     drawRect_rp,
-    drawShape_rp,
     drawSprite_rp,
     drawText_rp,
     drawTextOnPath_rp,
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 1ff7d45..b1eebc8 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -127,7 +127,6 @@
                             const SkPath& path, const SkMatrix* matrix, 
                                 const SkPaint&);
     virtual void drawPicture(SkPicture& picture);
-    virtual void drawShape(SkShape*);
     virtual void drawVertices(VertexMode, int vertexCount,
                           const SkPoint vertices[], const SkPoint texs[],
                           const SkColor colors[], SkXfermode*,
@@ -591,10 +590,6 @@
     this->INHERITED::drawPicture(picture);
 }
 
-void SkGPipeCanvas::drawShape(SkShape* shape) {
-    UNIMPLEMENTED
-}
-
 void SkGPipeCanvas::drawVertices(VertexMode mode, int vertexCount,
                                  const SkPoint vertices[], const SkPoint texs[],
                                  const SkColor colors[], SkXfermode*,
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 223a4f7..af67c06 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -351,14 +351,6 @@
                str.c_str(), byteLength);
 }
 
-void SkDumpCanvas::drawShape(SkShape* shape) {
-    this->dump(kDrawShape_Verb, NULL, "drawShape(%p)", shape);
-    fNestLevel += 1;
-    this->INHERITED::drawShape(shape);
-    fNestLevel -= 1;
-    this->dump(kDrawShape_Verb, NULL, "endShape(%p)", shape);
-}
-
 void SkDumpCanvas::drawPicture(SkPicture& picture) {
     this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", &picture,
                picture.width(), picture.height());
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index d3c84a1..d60f259 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -248,13 +248,6 @@
     }
 }
 
-void SkNWayCanvas::drawShape(SkShape* shape) {
-    Iter iter(fList);
-    while (iter.next()) {
-        iter->drawShape(shape);
-    }
-}
-
 void SkNWayCanvas::drawVertices(VertexMode vmode, int vertexCount,
                           const SkPoint vertices[], const SkPoint texs[],
                           const SkColor colors[], SkXfermode* xmode,
diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp
index 33f77e4..9c94d59 100644
--- a/src/utils/SkProxyCanvas.cpp
+++ b/src/utils/SkProxyCanvas.cpp
@@ -126,10 +126,6 @@
     fProxy->drawPicture(picture);
 }
 
-void SkProxyCanvas::drawShape(SkShape* shape) {
-    fProxy->drawShape(shape);
-}
-
 void SkProxyCanvas::drawVertices(VertexMode vmode, int vertexCount,
                                  const SkPoint vertices[], const SkPoint texs[],
                                  const SkColor colors[], SkXfermode* xmode,