Retract GrRenderTarget a bit

These sites don't necessarily need the full power of a GrRenderTarget object. This is a clean up for switching over to GrRenderTargetProxys.

Review URL: https://codereview.chromium.org/1486923004
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index c158ec1..163601e 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1210,7 +1210,7 @@
     subRun->fVertexEndIndex += vertexStride * GrAtlasTextBatch::kVerticesPerGlyph;
 }
 
-void GrAtlasTextContext::flushRunAsPaths(GrDrawContext* dc, GrRenderTarget* rt,
+void GrAtlasTextContext::flushRunAsPaths(GrDrawContext* dc,
                                          const SkTextBlobRunIterator& it,
                                          const GrClip& clip, const SkPaint& skPaint,
                                          SkDrawFilter* drawFilter, const SkMatrix& viewMatrix,
@@ -1230,18 +1230,18 @@
 
     switch (it.positioning()) {
         case SkTextBlob::kDefault_Positioning:
-            this->drawTextAsPath(dc, rt, clip, runPaint, viewMatrix,
+            this->drawTextAsPath(dc, clip, runPaint, viewMatrix,
                                  (const char *)it.glyphs(),
                                  textLen, x + offset.x(), y + offset.y(), clipBounds);
             break;
         case SkTextBlob::kHorizontal_Positioning:
-            this->drawPosTextAsPath(dc, rt, clip, runPaint, viewMatrix,
+            this->drawPosTextAsPath(dc, clip, runPaint, viewMatrix,
                                     (const char*)it.glyphs(),
                                     textLen, it.pos(), 1, SkPoint::Make(x, y + offset.y()),
                                     clipBounds);
             break;
         case SkTextBlob::kFull_Positioning:
-            this->drawPosTextAsPath(dc, rt, clip, runPaint, viewMatrix,
+            this->drawPosTextAsPath(dc, clip, runPaint, viewMatrix,
                                     (const char*)it.glyphs(),
                                     textLen, it.pos(), 2, SkPoint::Make(x, y), clipBounds);
             break;
@@ -1309,7 +1309,7 @@
 }
 
 inline void GrAtlasTextContext::flushBigGlyphs(GrAtlasTextBlob* cacheBlob,
-                                               GrDrawContext* dc, GrRenderTarget* rt,
+                                               GrDrawContext* dc,
                                                const GrClip& clip, const SkPaint& skPaint,
                                                SkScalar transX, SkScalar transY,
                                                const SkIRect& clipBounds) {
@@ -1328,7 +1328,7 @@
             ctm.postConcat(cacheBlob->fViewMatrix);
         }
 
-        GrBlurUtils::drawPathWithMaskFilter(fContext, dc, rt, clip, bigGlyph.fPath,
+        GrBlurUtils::drawPathWithMaskFilter(fContext, dc, clip, bigGlyph.fPath,
                                             skPaint, ctm, nullptr, clipBounds, false);
     }
 }
@@ -1354,7 +1354,7 @@
     SkTextBlobRunIterator it(blob);
     for (int run = 0; !it.done(); it.next(), run++) {
         if (cacheBlob->fRuns[run].fDrawAsPaths) {
-            this->flushRunAsPaths(dc, rt, it, clip, skPaint,
+            this->flushRunAsPaths(dc, it, clip, skPaint,
                                   drawFilter, viewMatrix, clipBounds, x, y);
             continue;
         }
@@ -1364,7 +1364,7 @@
     }
 
     // Now flush big glyphs
-    this->flushBigGlyphs(cacheBlob, dc, rt, clip, skPaint, transX, transY, clipBounds);
+    this->flushBigGlyphs(cacheBlob, dc, clip, skPaint, transX, transY, clipBounds);
 }
 
 void GrAtlasTextContext::flush(GrAtlasTextBlob* cacheBlob,
@@ -1382,7 +1382,7 @@
     }
 
     // Now flush big glyphs
-    this->flushBigGlyphs(cacheBlob, dc, rt, clip, skPaint, 0, 0, clipBounds);
+    this->flushBigGlyphs(cacheBlob, dc, clip, skPaint, 0, 0, clipBounds);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrAtlasTextContext.h b/src/gpu/GrAtlasTextContext.h
index 81f1ddd..90e4010 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -71,7 +71,7 @@
                                   size_t vertexStride, bool useVertexColor,
                                   GrGlyph*);
 
-    inline void flushRunAsPaths(GrDrawContext*, GrRenderTarget*,
+    inline void flushRunAsPaths(GrDrawContext*,
                                 const SkTextBlobRunIterator&, const GrClip& clip,
                                 const SkPaint&, SkDrawFilter*,
                                 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x,
@@ -82,7 +82,7 @@
                                     const SkPaint&);
     inline void flushRun(GrDrawContext*, GrPipelineBuilder*, GrAtlasTextBlob*, int run, GrColor,
                          SkScalar transX, SkScalar transY, const SkPaint&);
-    inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrDrawContext*, GrRenderTarget*,
+    inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrDrawContext*,
                                const GrClip& clip, const SkPaint& skPaint,
                                SkScalar transX, SkScalar transY, const SkIRect& clipBounds);
 
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index 8cd569b..9ca445b 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -148,7 +148,6 @@
 
 static void draw_path_with_mask_filter(GrContext* context,
                                        GrDrawContext* drawContext,
-                                       GrRenderTarget* renderTarget,
                                        const GrClip& clip,
                                        GrPaint* paint,
                                        const SkMatrix& viewMatrix,
@@ -160,7 +159,7 @@
     SkASSERT(maskFilter);
 
     SkIRect clipBounds;
-    clip.getConservativeBounds(renderTarget, &clipBounds);
+    clip.getConservativeBounds(drawContext->width(), drawContext->height(), &clipBounds);
     SkTLazy<SkPath> tmpPath;
     GrStrokeInfo strokeInfo(origStrokeInfo);
 
@@ -225,7 +224,7 @@
                                                      *devPathPtr,
                                                      strokeInfo,
                                                      paint->isAntiAlias(),
-                                                     renderTarget->numColorSamples()));
+                                                     drawContext->numColorSamples()));
         if (mask) {
             GrTexture* filtered;
 
@@ -251,7 +250,6 @@
 
 void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
                                          GrDrawContext* drawContext,
-                                         GrRenderTarget* rt,
                                          const GrClip& clip,
                                          const SkPath& origPath,
                                          GrPaint* paint,
@@ -273,13 +271,12 @@
         pathEffect = nullptr;
     }
 
-    draw_path_with_mask_filter(context, drawContext, rt, clip, paint, viewMatrix, mf, pathEffect,
+    draw_path_with_mask_filter(context, drawContext, clip, paint, viewMatrix, mf, pathEffect,
                                strokeInfo, pathPtr, pathIsMutable);
 }
 
 void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, 
                                          GrDrawContext* drawContext,
-                                         GrRenderTarget* renderTarget,
                                          const GrClip& clip,
                                          const SkPath& origSrcPath,
                                          const SkPaint& paint,
@@ -340,7 +337,7 @@
     }
 
     if (paint.getMaskFilter()) {
-        draw_path_with_mask_filter(context, drawContext, renderTarget, clip, &grPaint, viewMatrix,
+        draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMatrix,
                                    paint.getMaskFilter(), pathEffect, strokeInfo,
                                    pathPtr, pathIsMutable);
     } else {
diff --git a/src/gpu/GrBlurUtils.h b/src/gpu/GrBlurUtils.h
index 1de669c..a22239a 100644
--- a/src/gpu/GrBlurUtils.h
+++ b/src/gpu/GrBlurUtils.h
@@ -31,7 +31,6 @@
      */
     void drawPathWithMaskFilter(GrContext* context,
                                 GrDrawContext* drawContext,
-                                GrRenderTarget* rt,
                                 const GrClip& clip,
                                 const SkPath& origSrcPath,
                                 const SkPaint& paint,
@@ -46,7 +45,6 @@
      */
     void drawPathWithMaskFilter(GrContext*,
                                 GrDrawContext*,
-                                GrRenderTarget*,
                                 const GrClip&,
                                 const SkPath& path,
                                 GrPaint*,
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index e41a1b7..9b7fa31 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -137,7 +137,7 @@
     }
 
     SkIRect copyRect;
-    pipelineBuilder.clip().getConservativeBounds(rt, &copyRect);
+    pipelineBuilder.clip().getConservativeBounds(rt->width(), rt->height(), &copyRect);
 
     SkIRect drawIBounds;
     bounds.roundOut(&drawIBounds);
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index de833a6..a136886 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -39,7 +39,7 @@
         return false;
     }
 
-    pipelineBuilder->clip().getConservativeBounds(rt, devClipBounds);
+    pipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), devClipBounds);
 
     if (devClipBounds->isEmpty()) {
         *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height());
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 0ef18aa..5cfcf64 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -51,7 +51,7 @@
     } while (textContext);
 
     // fall back to drawing as a path
-    this->drawTextAsPath(dc, rt, clip, skPaint, viewMatrix,
+    this->drawTextAsPath(dc, clip, skPaint, viewMatrix,
                          text, byteLength, x, y, clipBounds);
 }
 
@@ -77,7 +77,7 @@
     } while (textContext);
 
     // fall back to drawing as a path
-    this->drawPosTextAsPath(dc, rt, clip, skPaint, viewMatrix, text, byteLength, pos,
+    this->drawPosTextAsPath(dc, clip, skPaint, viewMatrix, text, byteLength, pos,
                             scalarsPerPosition, offset, clipBounds);
 }
 
@@ -161,7 +161,7 @@
     }
 }
 
-void GrTextContext::drawTextAsPath(GrDrawContext* dc, GrRenderTarget* rt,
+void GrTextContext::drawTextAsPath(GrDrawContext* dc,
                                    const GrClip& clip,
                                    const SkPaint& skPaint, const SkMatrix& viewMatrix,
                                    const char text[], size_t byteLength, SkScalar x, SkScalar y,
@@ -179,14 +179,14 @@
         matrix.postTranslate(xpos - prevXPos, 0);
         if (iterPath) {
             const SkPaint& pnt = iter.getPaint();
-            GrBlurUtils::drawPathWithMaskFilter(fContext, dc, rt, clip, *iterPath,
+            GrBlurUtils::drawPathWithMaskFilter(fContext, dc, clip, *iterPath,
                                                 pnt, viewMatrix, &matrix, clipBounds, false);
         }
         prevXPos = xpos;
     }
 }
 
-void GrTextContext::drawPosTextAsPath(GrDrawContext* dc, GrRenderTarget* rt,
+void GrTextContext::drawPosTextAsPath(GrDrawContext* dc,
                                       const GrClip& clip,
                                       const SkPaint& origPaint, const SkMatrix& viewMatrix,
                                       const char text[], size_t byteLength,
@@ -227,7 +227,7 @@
 
                 matrix[SkMatrix::kMTransX] = loc.fX;
                 matrix[SkMatrix::kMTransY] = loc.fY;
-                GrBlurUtils::drawPathWithMaskFilter(fContext, dc, rt, clip, *path, paint,
+                GrBlurUtils::drawPathWithMaskFilter(fContext, dc, clip, *path, paint,
                                                     viewMatrix, &matrix, clipBounds, false);
             }
         }
diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h
index 05e179a..2521047 100644
--- a/src/gpu/GrTextContext.h
+++ b/src/gpu/GrTextContext.h
@@ -66,11 +66,11 @@
                                const SkScalar pos[], int scalarsPerPosition,
                                const SkPoint& offset, const SkIRect& clipBounds) = 0;
 
-    void drawTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip,
+    void drawTextAsPath(GrDrawContext*, const GrClip& clip,
                         const SkPaint& origPaint, const SkMatrix& viewMatrix,
                         const char text[], size_t byteLength, SkScalar x, SkScalar y,
                         const SkIRect& clipBounds);
-    void drawPosTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip,
+    void drawPosTextAsPath(GrDrawContext*, const GrClip& clip,
                            const SkPaint& origPaint, const SkMatrix& viewMatrix,
                            const char text[], size_t byteLength,
                            const SkScalar pos[], int scalarsPerPosition,
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 46e8df4..17e4468 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -484,7 +484,7 @@
         SkPath path;
         path.setIsVolatile(true);
         path.addRect(rect);
-        GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, fRenderTarget,
+        GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
                                             fClip, path, paint,
                                             *draw.fMatrix, nullptr,
                                             draw.fClip->getBounds(), true);
@@ -554,7 +554,7 @@
         SkPath path;
         path.setIsVolatile(true);
         path.addRRect(rect);
-        GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, fRenderTarget,
+        GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
                                             fClip, path, paint,
                                             *draw.fMatrix, nullptr,
                                             draw.fClip->getBounds(), true);
@@ -590,7 +590,7 @@
     path.addRRect(inner);
     path.setFillType(SkPath::kEvenOdd_FillType);
 
-    GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, fRenderTarget,
+    GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
                                         fClip, path, paint,
                                         *draw.fMatrix, nullptr,
                                         draw.fClip->getBounds(), true);
@@ -666,7 +666,7 @@
     CHECK_SHOULD_DRAW(draw);
     GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPath", fContext);
 
-    GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, fRenderTarget,
+    GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
                                         fClip, origSrcPath, paint,
                                         *draw.fMatrix, prePathMatrix,
                                         draw.fClip->getBounds(), pathIsMutable);
@@ -706,7 +706,7 @@
                                        const SkISize& imageSize,
                                        const SkRect* srcRectPtr,
                                        SkIRect* clippedSrcIRect) {
-    clip.getConservativeBounds(rt, clippedSrcIRect, nullptr);
+    clip.getConservativeBounds(rt->width(), rt->height(), clippedSrcIRect, nullptr);
     SkMatrix inv;
     if (!viewMatrix.invert(&inv)) {
         clippedSrcIRect->setEmpty();
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index 443bcf1..0b1d3f1 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -234,7 +234,7 @@
     SkPath rectPath;
     rectPath.addRect(clippedDstRect);
     rectPath.setIsVolatile(true);
-    GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fRenderTarget, fClip,
+    GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip,
                                         rectPath, &grPaint, viewMatrix, mf, paint.getPathEffect(),
                                         GrStrokeInfo::FillInfo(), true);
 }
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 94abe1c..d6ad9d3 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -975,8 +975,8 @@
 
 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
     SkIRect devClipBounds;
-    args.fPipelineBuilder->clip().getConservativeBounds(args.fPipelineBuilder->getRenderTarget(),
-                                                        &devClipBounds);
+    GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
+    args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &devClipBounds);
 
     SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
                                                           *args.fStroke, devClipBounds));
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index 082a8db..27e287e 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -1634,7 +1634,7 @@
     }
 
     SkIRect clipBoundsI;
-    args.fPipelineBuilder->clip().getConservativeBounds(rt, &clipBoundsI);
+    args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), &clipBoundsI);
     SkRect clipBounds = SkRect::Make(clipBoundsI);
     SkMatrix vmi;
     if (!args.fViewMatrix->invert(&vmi)) {