abstract access to device-clip-bounds

apply this to GpuDevice. Should allow us to switch to per-device-clipping
with minimal change (since we've abstracted how the device sees its
clip-bounds.)

BUG=skia:

Change-Id: I5245d90f308c21abdb58d441c326670b65e9179d
Reviewed-on: https://skia-review.googlesource.com/8884
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index aedfc0b..0b5f14c 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -184,7 +184,7 @@
 
     SkMatrix matrix = *draw.fMatrix;
     matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
-    const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-left, -top);
+    const SkIRect clipBounds = this->devClipBounds(draw).makeOffset(-left, -top);
     sk_sp<SkImageFilterCache> cache(this->getImageFilterCache());
     SkImageFilter::OutputProperties outputProperties(fRenderTargetContext->getColorSpace());
     SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProperties);
@@ -421,7 +421,7 @@
         GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
                                             fClip, path, paint,
                                             *draw.fMatrix, nullptr,
-                                            draw.fRC->getBounds(), true);
+                                            this->devClipBounds(draw), true);
         return;
     }
 
@@ -462,7 +462,7 @@
         if (rrect.transform(*draw.fMatrix, &devRRect)) {
             if (devRRect.allCornersCircular()) {
                 SkRect maskRect;
-                if (mf->canFilterMaskGPU(devRRect, draw.fRC->getBounds(),
+                if (mf->canFilterMaskGPU(devRRect, this->devClipBounds(draw),
                                          *draw.fMatrix, &maskRect)) {
                     SkIRect finalIRect;
                     maskRect.roundOut(&finalIRect);
@@ -491,7 +491,7 @@
         GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
                                             fClip, path, paint,
                                             *draw.fMatrix, nullptr,
-                                            draw.fRC->getBounds(), true);
+                                            this->devClipBounds(draw), true);
         return;
     }
 
@@ -539,7 +539,7 @@
     GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
                                         fClip, path, paint,
                                         *draw.fMatrix, nullptr,
-                                        draw.fRC->getBounds(), true);
+                                        this->devClipBounds(draw), true);
 }
 
 
@@ -711,7 +711,7 @@
     GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
                                         fClip, origSrcPath, paint,
                                         *draw.fMatrix, prePathMatrix,
-                                        draw.fRC->getBounds(), pathIsMutable);
+                                        this->devClipBounds(draw), pathIsMutable);
 }
 
 static const int kBmpSmallTileSize = 1 << 10;
@@ -1743,7 +1743,7 @@
     SkDEBUGCODE(this->validate();)
 
     fRenderTargetContext->drawText(fClip, paint, *draw.fMatrix,
-                                   (const char*)text, byteLength, x, y, draw.fRC->getBounds());
+                                   (const char*)text, byteLength, x, y, this->devClipBounds(draw));
 }
 
 void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text, size_t byteLength,
@@ -1756,7 +1756,7 @@
 
     fRenderTargetContext->drawPosText(fClip, paint, *draw.fMatrix,
                                       (const char*)text, byteLength, pos, scalarsPerPos, offset,
-                                      draw.fRC->getBounds());
+                                      this->devClipBounds(draw));
 }
 
 void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkScalar x, SkScalar y,
@@ -1768,7 +1768,7 @@
     SkDEBUGCODE(this->validate();)
 
     fRenderTargetContext->drawTextBlob(fClip, paint, *draw.fMatrix,
-                                       blob, x, y, drawFilter, draw.fRC->getBounds());
+                                       blob, x, y, drawFilter, this->devClipBounds(draw));
 }
 
 ///////////////////////////////////////////////////////////////////////////////