drawRegion() cleanups

(1) Move implementation to the cpp.
(2) Check for the isRect() case.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2286693002

Review-Url: https://codereview.chromium.org/2286693002
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index d9b3282..acf0ad2 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -707,13 +707,7 @@
         @param region   The region to be drawn
         @param paint    The paint used to draw the region
     */
-    void drawRegion(const SkRegion& region, const SkPaint& paint) {
-        if (region.isEmpty()) {
-            return;
-        }
-
-        this->onDrawRegion(region, paint);
-    }
+    void drawRegion(const SkRegion& region, const SkPaint& paint);
 
     /** Draw the specified oval using the specified paint. The oval will be
         filled or framed based on the Style in the paint.
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 4cf40e9..fc18975 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1975,6 +1975,18 @@
     this->onDrawRect(r, paint);
 }
 
+void SkCanvas::drawRegion(const SkRegion& region, const SkPaint& paint) {
+    if (region.isEmpty()) {
+        return;
+    }
+
+    if (region.isRect()) {
+        return this->drawIRect(region.getBounds(), paint);
+    }
+
+    this->onDrawRegion(region, paint);
+}
+
 void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) {
     this->onDrawOval(r, paint);
 }