Converts a drawPaint through a rrect clip to a drawRRect in GrDrawContext.

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

Review-Url: https://codereview.chromium.org/2271053004
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 7138f4b..8233786 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -41,6 +41,27 @@
                                                   SkIntToScalar(fOrigin.fY)));
 }
 
+bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, bool* aa) const {
+    if (!fStack) {
+        return false;
+    }
+    const SkRect* rtBounds = &origRTBounds;
+    SkRect tempRTBounds;
+    bool origin = fOrigin.fX || fOrigin.fY;
+    if (origin) {
+        tempRTBounds = origRTBounds;
+        tempRTBounds.offset(SkIntToScalar(fOrigin.fX), SkIntToScalar(fOrigin.fY));
+        rtBounds = &tempRTBounds;
+    }
+    if (fStack->isRRect(*rtBounds, rr, aa)) {
+        if (origin) {
+            rr->offset(-SkIntToScalar(fOrigin.fX), -SkIntToScalar(fOrigin.fY));
+        }
+        return true;
+    }
+    return false;
+}
+
 void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devResult,
                                             bool* isIntersectionOfRects) const {
     if (!fStack) {