If the path is a rect, call drawRect to raster the geometry in SkCanvas::drawPath to get better performance.

Committed: http://code.google.com/p/skia/source/detail?r=11842

R=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11904 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 57d4a0f..f14cdac 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -224,9 +224,7 @@
     virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
                             const SkPaint&) SK_OVERRIDE;
     virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
-    virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
     virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
-    virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
     virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
                             const SkPaint*) SK_OVERRIDE;
     virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
@@ -264,6 +262,11 @@
      * according to slot.
      */
     bool shuttleBitmap(const SkBitmap&, int32_t slot);
+
+protected:
+    virtual void onDrawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
+    virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
+
 private:
     enum {
         kNoSaveLayer = -1,
@@ -715,7 +718,7 @@
     }
 }
 
-void SkGPipeCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
+void SkGPipeCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
     NOTIFY_SETUP(this);
     this->writePaint(paint);
     if (this->needOpBytes(sizeof(SkRect))) {
@@ -733,7 +736,7 @@
     }
 }
 
-void SkGPipeCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
+void SkGPipeCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
     NOTIFY_SETUP(this);
     this->writePaint(paint);
     if (this->needOpBytes(path.writeToMemory(NULL))) {