Move pipeline handling out of GrMeshDrawOp.

The monolithic GrPipeline is moved to a subclass GrLegacyDrawMeshOp.

The pipeline used to record a GrMesh draw in a GrMeshDrawOp must now be passed rather than implicitly using the op's pipeline.

Change-Id: I50d77e4dcc8d91a523fa7566ce43a9a291174706
Reviewed-on: https://skia-review.googlesource.com/11002
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 3b0fd69..5c52fef 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -722,12 +722,12 @@
                               viewMatrix);
 }
 
-class AAConvexPathOp final : public GrMeshDrawOp {
+class AAConvexPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              const SkPath& path) {
-        return std::unique_ptr<GrMeshDrawOp>(new AAConvexPathOp(color, viewMatrix, path));
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    const SkPath& path) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new AAConvexPathOp(color, viewMatrix, path));
     }
 
     const char* name() const override { return "AAConvexPathOp"; }
@@ -817,7 +817,7 @@
                              vertexBuffer, indexBuffer,
                              firstVertex, firstIndex,
                              tess.numPts(), tess.numIndices());
-            target->draw(gp.get(), mesh);
+            target->draw(gp.get(), this->pipeline(), mesh);
         }
     }
 
@@ -905,7 +905,7 @@
                 const Draw& draw = draws[j];
                 mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer,
                                  firstVertex, firstIndex, draw.fVertexCnt, draw.fIndexCnt);
-                target->draw(quadProcessor.get(), mesh);
+                target->draw(quadProcessor.get(), this->pipeline(), mesh);
                 firstVertex += draw.fVertexCnt;
                 firstIndex += draw.fIndexCnt;
             }
@@ -961,7 +961,7 @@
 
     SkSTArray<1, PathData, true> fPaths;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -973,13 +973,13 @@
     SkPath path;
     args.fShape->asPath(&path);
 
-    std::unique_ptr<GrMeshDrawOp> op =
+    std::unique_ptr<GrLegacyMeshDrawOp> op =
             AAConvexPathOp::Make(args.fPaint.getColor(), *args.fViewMatrix, path);
 
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
 
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
 
     return true;
 
diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp
index b48ec0e..15fb645 100644
--- a/src/gpu/ops/GrAAFillRectOp.cpp
+++ b/src/gpu/ops/GrAAFillRectOp.cpp
@@ -153,7 +153,7 @@
     }
 }
 
-class AAFillRectOp final: public GrMeshDrawOp {
+class AAFillRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -257,7 +257,7 @@
                                            localMatrix);
             info = this->next(info);
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -338,41 +338,41 @@
     SkSTArray<4 * sizeof(RectWithLocalMatrixInfo), uint8_t, true> fRectData;
     int fRectCnt;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrAAFillRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkRect& devRect) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkRect& devRect) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new AAFillRectOp(color, viewMatrix, rect, devRect, nullptr));
 }
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkMatrix& localMatrix,
-                                   const SkRect& rect,
-                                   const SkRect& devRect) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkMatrix& localMatrix,
+                                         const SkRect& rect,
+                                         const SkRect& devRect) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new AAFillRectOp(color, viewMatrix, rect, devRect, &localMatrix));
 }
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkMatrix& localMatrix,
-                                   const SkRect& rect) {
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkMatrix& localMatrix,
+                                         const SkRect& rect) {
     SkRect devRect;
     viewMatrix.mapRect(&devRect, rect);
     return Make(color, viewMatrix, localMatrix, rect, devRect);
 }
 
-std::unique_ptr<GrMeshDrawOp> MakeWithLocalRect(GrColor color,
-                                                const SkMatrix& viewMatrix,
-                                                const SkRect& rect,
-                                                const SkRect& localRect) {
+std::unique_ptr<GrLegacyMeshDrawOp> MakeWithLocalRect(GrColor color,
+                                                      const SkMatrix& viewMatrix,
+                                                      const SkRect& rect,
+                                                      const SkRect& localRect) {
     SkRect devRect;
     viewMatrix.mapRect(&devRect, rect);
     SkMatrix localMatrix;
diff --git a/src/gpu/ops/GrAAFillRectOp.h b/src/gpu/ops/GrAAFillRectOp.h
index c047eed..7d97716 100644
--- a/src/gpu/ops/GrAAFillRectOp.h
+++ b/src/gpu/ops/GrAAFillRectOp.h
@@ -11,31 +11,31 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkMatrix;
 struct SkRect;
 
 namespace GrAAFillRectOp {
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkRect& devRect);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkRect& devRect);
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkMatrix& localMatrix,
-                                   const SkRect& rect);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkMatrix& localMatrix,
+                                         const SkRect& rect);
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkMatrix& localMatrix,
-                                   const SkRect& rect,
-                                   const SkRect& devRect);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkMatrix& localMatrix,
+                                         const SkRect& rect,
+                                         const SkRect& devRect);
 
-std::unique_ptr<GrMeshDrawOp> MakeWithLocalRect(GrColor color,
-                                                const SkMatrix& viewMatrix,
-                                                const SkRect& rect,
-                                                const SkRect& localRect);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeWithLocalRect(GrColor color,
+                                                      const SkMatrix& viewMatrix,
+                                                      const SkRect& rect,
+                                                      const SkRect& localRect);
 };
 
 #endif
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index 9e1ac83c..c789aa8 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -668,22 +668,22 @@
     return true;
 }
 
-class AAHairlineOp final : public GrMeshDrawOp {
+class AAHairlineOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                              const SkMatrix& viewMatrix,
-                                              const SkPath& path,
-                                              const GrStyle& style,
-                                              const SkIRect& devClipBounds) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                                    const SkMatrix& viewMatrix,
+                                                    const SkPath& path,
+                                                    const GrStyle& style,
+                                                    const SkIRect& devClipBounds) {
         SkScalar hairlineCoverage;
         uint8_t newCoverage = 0xff;
         if (GrPathRenderer::IsStrokeHairlineOrEquivalent(style, viewMatrix, &hairlineCoverage)) {
             newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff);
         }
 
-        return std::unique_ptr<GrMeshDrawOp>(
+        return std::unique_ptr<GrLegacyMeshDrawOp>(
                 new AAHairlineOp(color, newCoverage, viewMatrix, path, devClipBounds));
     }
 
@@ -783,7 +783,7 @@
 
     SkSTArray<1, PathData, true> fPaths;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 void AAHairlineOp::onPrepareDraws(Target* target) const {
@@ -864,7 +864,7 @@
         mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer.get(),
                            firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, lineCount,
                            kLineSegsNumInIdxBuffer);
-        target->draw(lineGP.get(), mesh);
+        target->draw(lineGP.get(), this->pipeline(), mesh);
     }
 
     if (quadCount || conicCount) {
@@ -921,7 +921,7 @@
             mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer.get(),
                                firstVertex, kQuadNumVertices, kIdxsPerQuad, quadCount,
                                kQuadsNumInIdxBuffer);
-            target->draw(quadGP.get(), mesh);
+            target->draw(quadGP.get(), this->pipeline(), mesh);
             firstVertex += quadCount * kQuadNumVertices;
         }
 
@@ -930,7 +930,7 @@
             mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer.get(),
                                firstVertex, kQuadNumVertices, kIdxsPerQuad, conicCount,
                                kQuadsNumInIdxBuffer);
-            target->draw(conicGP.get(), mesh);
+            target->draw(conicGP.get(), this->pipeline(), mesh);
         }
     }
 }
@@ -946,11 +946,11 @@
                                       &devClipBounds);
     SkPath path;
     args.fShape->asPath(&path);
-    std::unique_ptr<GrMeshDrawOp> op = AAHairlineOp::Make(
+    std::unique_ptr<GrLegacyMeshDrawOp> op = AAHairlineOp::Make(
             args.fPaint.getColor(), *args.fViewMatrix, path, args.fShape->style(), devClipBounds);
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
     return true;
 }
 
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index b1f1f98..8768c1e 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -117,17 +117,17 @@
                               viewMatrix);
 }
 
-class AAFlatteningConvexPathOp final : public GrMeshDrawOp {
+class AAFlatteningConvexPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                              const SkMatrix& viewMatrix,
-                                              const SkPath& path,
-                                              SkScalar strokeWidth,
-                                              SkStrokeRec::Style style,
-                                              SkPaint::Join join,
-                                              SkScalar miterLimit) {
-        return std::unique_ptr<GrMeshDrawOp>(new AAFlatteningConvexPathOp(
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                                    const SkMatrix& viewMatrix,
+                                                    const SkPath& path,
+                                                    SkScalar strokeWidth,
+                                                    SkStrokeRec::Style style,
+                                                    SkPaint::Join join,
+                                                    SkScalar miterLimit) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new AAFlatteningConvexPathOp(
                 color, viewMatrix, path, strokeWidth, style, join, miterLimit));
     }
 
@@ -184,7 +184,7 @@
         fCanTweakAlphaForCoverage = optimizations.canTweakAlphaForCoverage();
     }
 
-    void draw(GrMeshDrawOp::Target* target, const GrGeometryProcessor* gp, int vertexCount,
+    void draw(GrLegacyMeshDrawOp::Target* target, const GrGeometryProcessor* gp, int vertexCount,
               size_t vertexStride, void* vertices, int indexCount, uint16_t* indices) const {
         if (vertexCount == 0 || indexCount == 0) {
             return;
@@ -210,7 +210,7 @@
         memcpy(idxs, indices, indexCount * sizeof(uint16_t));
         mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
                          firstIndex, vertexCount, indexCount);
-        target->draw(gp, mesh);
+        target->draw(gp, this->pipeline(), mesh);
     }
 
     void onPrepareDraws(Target* target) const override {
@@ -318,7 +318,7 @@
     bool fCanTweakAlphaForCoverage;
     SkSTArray<1, PathData, true> fPaths;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -336,14 +336,14 @@
     SkPaint::Join join = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin();
     SkScalar miterLimit = stroke.getMiter();
 
-    std::unique_ptr<GrMeshDrawOp> op =
+    std::unique_ptr<GrLegacyMeshDrawOp> op =
             AAFlatteningConvexPathOp::Make(args.fPaint.getColor(), *args.fViewMatrix, path,
                                            strokeWidth, stroke.getStyle(), join, miterLimit);
 
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
 
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
 
     return true;
 }
diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp
index ce0cef6..8b47f5e 100644
--- a/src/gpu/ops/GrAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrAAStrokeRectOp.cpp
@@ -110,7 +110,7 @@
                               viewMatrix);
 }
 
-class AAStrokeRectOp final : public GrMeshDrawOp {
+class AAStrokeRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -125,8 +125,8 @@
         fMiterStroke = true;
     }
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              const SkRect& rect, const SkStrokeRec& stroke) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    const SkRect& rect, const SkStrokeRec& stroke) {
         bool isMiter;
         if (!allowed_stroke(stroke, &isMiter)) {
             return nullptr;
@@ -148,7 +148,7 @@
             op->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kNo);
         }
         op->fViewMatrix = viewMatrix;
-        return std::unique_ptr<GrMeshDrawOp>(op);
+        return std::unique_ptr<GrLegacyMeshDrawOp>(op);
     }
 
     const char* name() const override { return "AAStrokeRect"; }
@@ -227,7 +227,7 @@
     SkMatrix fViewMatrix;
     bool fMiterStroke;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 void AAStrokeRectOp::applyPipelineOptimizations(const PipelineOptimizations& optimizations) {
@@ -286,7 +286,7 @@
                                            info.fDegenerate,
                                            canTweakAlphaForCoverage);
     }
-    helper.recordDraw(target, gp.get());
+    helper.recordDraw(target, gp.get(), this->pipeline());
 }
 
 const GrBuffer* AAStrokeRectOp::GetIndexBuffer(GrResourceProvider* resourceProvider,
@@ -571,18 +571,18 @@
 
 namespace GrAAStrokeRectOp {
 
-std::unique_ptr<GrMeshDrawOp> MakeFillBetweenRects(GrColor color,
-                                                   const SkMatrix& viewMatrix,
-                                                   const SkRect& devOutside,
-                                                   const SkRect& devInside) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> MakeFillBetweenRects(GrColor color,
+                                                         const SkMatrix& viewMatrix,
+                                                         const SkRect& devOutside,
+                                                         const SkRect& devInside) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new AAStrokeRectOp(color, viewMatrix, devOutside, devInside));
 }
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkStrokeRec& stroke) {
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkStrokeRec& stroke) {
     return AAStrokeRectOp::Make(color, viewMatrix, rect, stroke);
 }
 }
diff --git a/src/gpu/ops/GrAAStrokeRectOp.h b/src/gpu/ops/GrAAStrokeRectOp.h
index 4dfbe64..074f8e0 100644
--- a/src/gpu/ops/GrAAStrokeRectOp.h
+++ b/src/gpu/ops/GrAAStrokeRectOp.h
@@ -11,22 +11,22 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkMatrix;
 struct SkRect;
 class SkStrokeRec;
 
 namespace GrAAStrokeRectOp {
 
-std::unique_ptr<GrMeshDrawOp> MakeFillBetweenRects(GrColor color,
-                                                   const SkMatrix& viewMatrix,
-                                                   const SkRect& devOutside,
-                                                   const SkRect& devInside);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeFillBetweenRects(GrColor color,
+                                                         const SkMatrix& viewMatrix,
+                                                         const SkRect& devOutside,
+                                                         const SkRect& devInside);
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkStrokeRec& stroke);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkStrokeRec& stroke);
 }
 
 #endif
diff --git a/src/gpu/ops/GrAnalyticRectOp.cpp b/src/gpu/ops/GrAnalyticRectOp.cpp
index 85da29c..6a9daf3 100644
--- a/src/gpu/ops/GrAnalyticRectOp.cpp
+++ b/src/gpu/ops/GrAnalyticRectOp.cpp
@@ -230,7 +230,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-class AnalyticRectOp final : public GrMeshDrawOp {
+class AnalyticRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -344,7 +344,7 @@
 
             verts += kVerticesPerQuad;
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -375,15 +375,15 @@
     SkMatrix fViewMatrixIfUsingLocalCoords;
     SkSTArray<1, Geometry, true> fGeoData;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
-std::unique_ptr<GrMeshDrawOp> GrAnalyticRectOp::Make(GrColor color,
-                                                     const SkMatrix& viewMatrix,
-                                                     const SkRect& rect,
-                                                     const SkRect& croppedRect,
-                                                     const SkRect& bounds) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> GrAnalyticRectOp::Make(GrColor color,
+                                                           const SkMatrix& viewMatrix,
+                                                           const SkRect& rect,
+                                                           const SkRect& croppedRect,
+                                                           const SkRect& bounds) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new AnalyticRectOp(color, viewMatrix, rect, croppedRect, bounds));
 }
 
@@ -395,7 +395,7 @@
     SkRect rect = GrTest::TestSquare(random);
     SkRect croppedRect = GrTest::TestSquare(random);
     SkRect bounds = GrTest::TestSquare(random);
-    return std::unique_ptr<GrMeshDrawOp>(
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new AnalyticRectOp(color, viewMatrix, rect, croppedRect, bounds));
 }
 
diff --git a/src/gpu/ops/GrAnalyticRectOp.h b/src/gpu/ops/GrAnalyticRectOp.h
index 4331794..9907de0 100644
--- a/src/gpu/ops/GrAnalyticRectOp.h
+++ b/src/gpu/ops/GrAnalyticRectOp.h
@@ -11,7 +11,7 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkMatrix;
 struct SkRect;
 
@@ -27,11 +27,11 @@
  */
 class GrAnalyticRectOp {
 public:
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                              const SkMatrix& viewMatrix,
-                                              const SkRect& rect,
-                                              const SkRect& croppedRect,
-                                              const SkRect& bounds);
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                                    const SkMatrix& viewMatrix,
+                                                    const SkRect& rect,
+                                                    const SkRect& croppedRect,
+                                                    const SkRect& bounds);
 };
 
 #endif  // GrAnalyticRectOp_DEFINED
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index bf2745b..64710e7 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -145,14 +145,14 @@
     this->flush(target, &flushInfo);
 }
 
-void GrAtlasTextOp::flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
+void GrAtlasTextOp::flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
     GrMesh mesh;
     int maxGlyphsPerDraw =
             static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
     mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer.get(),
                        flushInfo->fIndexBuffer.get(), flushInfo->fVertexOffset, kVerticesPerGlyph,
                        kIndicesPerGlyph, flushInfo->fGlyphsToFlush, maxGlyphsPerDraw);
-    target->draw(flushInfo->fGeometryProcessor.get(), mesh);
+    target->draw(flushInfo->fGeometryProcessor.get(), this->pipeline(), mesh);
     flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush;
     flushInfo->fGlyphsToFlush = 0;
 }
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index 452cfbd..8b65fb9 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -13,7 +13,7 @@
 #include "text/GrAtlasTextContext.h"
 #include "text/GrDistanceFieldAdjustTable.h"
 
-class GrAtlasTextOp final : public GrMeshDrawOp {
+class GrAtlasTextOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -138,7 +138,7 @@
         return kLCDCoverageMask_MaskType == fMaskType || kLCDDistanceField_MaskType == fMaskType;
     }
 
-    inline void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const;
+    inline void flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const;
 
     GrColor color() const { return fColor; }
     const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
@@ -180,7 +180,7 @@
 
     friend class GrBlobRegenHelper;  // Needs to trigger flushes
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 /*
@@ -189,7 +189,7 @@
  */
 class GrBlobRegenHelper {
 public:
-    GrBlobRegenHelper(const GrAtlasTextOp* op, GrMeshDrawOp::Target* target,
+    GrBlobRegenHelper(const GrAtlasTextOp* op, GrLegacyMeshDrawOp::Target* target,
                       GrAtlasTextOp::FlushInfo* flushInfo)
             : fOp(op), fTarget(target), fFlushInfo(flushInfo) {}
 
@@ -199,7 +199,7 @@
 
 private:
     const GrAtlasTextOp* fOp;
-    GrMeshDrawOp::Target* fTarget;
+    GrLegacyMeshDrawOp::Target* fTarget;
     GrAtlasTextOp::FlushInfo* fFlushInfo;
 };
 
diff --git a/src/gpu/ops/GrDashLinePathRenderer.cpp b/src/gpu/ops/GrDashLinePathRenderer.cpp
index 9f170ff..eda8906 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.cpp
+++ b/src/gpu/ops/GrDashLinePathRenderer.cpp
@@ -46,7 +46,7 @@
     }
     SkPoint pts[2];
     SkAssertResult(args.fShape->asLine(pts, nullptr));
-    std::unique_ptr<GrMeshDrawOp> op = GrDashOp::MakeDashLineOp(
+    std::unique_ptr<GrLegacyMeshDrawOp> op = GrDashOp::MakeDashLineOp(
             args.fPaint.getColor(), *args.fViewMatrix, pts, aaMode, args.fShape->style());
     if (!op) {
         return false;
@@ -55,6 +55,6 @@
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
 
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
     return true;
 }
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index 3e8c07e..01ae34b 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -237,7 +237,7 @@
                                                const SkMatrix& localMatrix,
                                                bool usesLocalCoords);
 
-class DashOp final : public GrMeshDrawOp {
+class DashOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
     struct LineData {
@@ -251,9 +251,11 @@
         SkScalar fPerpendicularScale;
     };
 
-    static std::unique_ptr<GrMeshDrawOp> Make(const LineData& geometry, GrColor color,
-                                              SkPaint::Cap cap, AAMode aaMode, bool fullDash) {
-        return std::unique_ptr<GrMeshDrawOp>(new DashOp(geometry, color, cap, aaMode, fullDash));
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(const LineData& geometry, GrColor color,
+                                                    SkPaint::Cap cap, AAMode aaMode,
+                                                    bool fullDash) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(
+                new DashOp(geometry, color, cap, aaMode, fullDash));
     }
 
     const char* name() const override { return "DashOp"; }
@@ -625,7 +627,7 @@
             rectIndex++;
         }
         SkASSERT(0 == (curVIdx % 4) && (curVIdx / 4) == totalRectCount);
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -679,14 +681,14 @@
     bool fFullDash;
     SkSTArray<1, LineData, true> fLines;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
-std::unique_ptr<GrMeshDrawOp> GrDashOp::MakeDashLineOp(GrColor color,
-                                                       const SkMatrix& viewMatrix,
-                                                       const SkPoint pts[2],
-                                                       AAMode aaMode,
-                                                       const GrStyle& style) {
+std::unique_ptr<GrLegacyMeshDrawOp> GrDashOp::MakeDashLineOp(GrColor color,
+                                                             const SkMatrix& viewMatrix,
+                                                             const SkPoint pts[2],
+                                                             AAMode aaMode,
+                                                             const GrStyle& style) {
     SkASSERT(GrDashOp::CanDrawDashLine(pts, style, viewMatrix));
     const SkScalar* intervals = style.dashIntervals();
     SkScalar phase = style.dashPhase();
diff --git a/src/gpu/ops/GrDashOp.h b/src/gpu/ops/GrDashOp.h
index 6ffd326..d3e0b6f 100644
--- a/src/gpu/ops/GrDashOp.h
+++ b/src/gpu/ops/GrDashOp.h
@@ -12,7 +12,7 @@
 #include "GrTypesPriv.h"
 #include "SkPathEffect.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class GrStyle;
 
 namespace GrDashOp {
@@ -23,8 +23,9 @@
 };
 static const int kAAModeCnt = static_cast<int>(AAMode::kCoverageWithMSAA) + 1;
 
-std::unique_ptr<GrMeshDrawOp> MakeDashLineOp(GrColor, const SkMatrix& viewMatrix,
-                                             const SkPoint pts[2], AAMode, const GrStyle& style);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeDashLineOp(GrColor, const SkMatrix& viewMatrix,
+                                                   const SkPoint pts[2], AAMode,
+                                                   const GrStyle& style);
 bool CanDrawDashLine(const SkPoint pts[2], const GrStyle& style, const SkMatrix& viewMatrix);
 }
 
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index cf4cdbe..73c1f10 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -94,15 +94,16 @@
     }
 }
 
-class DefaultPathOp final : public GrMeshDrawOp {
+class DefaultPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkPath& path, SkScalar tolerance,
-                                              uint8_t coverage, const SkMatrix& viewMatrix,
-                                              bool isHairline, const SkRect& devBounds) {
-        return std::unique_ptr<GrMeshDrawOp>(new DefaultPathOp(color, path, tolerance, coverage,
-                                                               viewMatrix, isHairline, devBounds));
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkPath& path,
+                                                    SkScalar tolerance, uint8_t coverage,
+                                                    const SkMatrix& viewMatrix, bool isHairline,
+                                                    const SkRect& devBounds) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new DefaultPathOp(
+                color, path, tolerance, coverage, viewMatrix, isHairline, devBounds));
     }
 
     const char* name() const override { return "DefaultPathOp"; }
@@ -256,7 +257,7 @@
         } else {
             mesh.init(primitiveType, vertexBuffer, firstVertex, vertexOffset);
         }
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
 
         // put back reserves
         target->putBackIndices((size_t)(maxIndices - indexOffset));
@@ -401,7 +402,7 @@
     bool fIsHairline;
     SkSTArray<1, PathData, true> fPaths;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetContext,
@@ -546,16 +547,16 @@
             }
             const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
                                                                                viewMatrix;
-            std::unique_ptr<GrMeshDrawOp> op(GrRectOpFactory::MakeNonAAFill(
+            std::unique_ptr<GrLegacyMeshDrawOp> op(GrRectOpFactory::MakeNonAAFill(
                     paint.getColor(), viewM, bounds, nullptr, &localMatrix));
 
             SkASSERT(GrDrawFace::kBoth == drawFace[p]);
             GrPipelineBuilder pipelineBuilder(std::move(paint), aaType);
             pipelineBuilder.setDrawFace(drawFace[p]);
             pipelineBuilder.setUserStencil(passes[p]);
-            renderTargetContext->addMeshDrawOp(pipelineBuilder, clip, std::move(op));
+            renderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, clip, std::move(op));
         } else {
-            std::unique_ptr<GrMeshDrawOp> op =
+            std::unique_ptr<GrLegacyMeshDrawOp> op =
                     DefaultPathOp::Make(paint.getColor(), path, srcSpaceTol, newCoverage,
                                         viewMatrix, isHairline, devBounds);
             bool stencilPass = stencilOnly || passCount > 1;
@@ -566,7 +567,7 @@
             GrPipelineBuilder pipelineBuilder(std::move(passPaint), aaType);
             pipelineBuilder.setDrawFace(drawFace[p]);
             pipelineBuilder.setUserStencil(passes[p]);
-            renderTargetContext->addMeshDrawOp(pipelineBuilder, clip, std::move(op));
+            renderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, clip, std::move(op));
         }
     }
     return true;
diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp
index 36131e1..4b3d0d3 100644
--- a/src/gpu/ops/GrDrawAtlasOp.cpp
+++ b/src/gpu/ops/GrDrawAtlasOp.cpp
@@ -67,7 +67,7 @@
         memcpy(vertPtr, args.fVerts.begin(), allocSize);
         vertPtr += allocSize;
     }
-    helper.recordDraw(target, gp.get());
+    helper.recordDraw(target, gp.get(), this->pipeline());
 }
 
 GrDrawAtlasOp::GrDrawAtlasOp(GrColor color, const SkMatrix& viewMatrix, int spriteCount,
diff --git a/src/gpu/ops/GrDrawAtlasOp.h b/src/gpu/ops/GrDrawAtlasOp.h
index 7d60974..79a6098 100644
--- a/src/gpu/ops/GrDrawAtlasOp.h
+++ b/src/gpu/ops/GrDrawAtlasOp.h
@@ -12,14 +12,14 @@
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
 
-class GrDrawAtlasOp final : public GrMeshDrawOp {
+class GrDrawAtlasOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              int spriteCount, const SkRSXform* xforms,
-                                              const SkRect* rects, const SkColor* colors) {
-        return std::unique_ptr<GrMeshDrawOp>(
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    int spriteCount, const SkRSXform* xforms,
+                                                    const SkRect* rects, const SkColor* colors) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(
                 new GrDrawAtlasOp(color, viewMatrix, spriteCount, xforms, rects, colors));
     }
 
@@ -72,7 +72,7 @@
     int fQuadCount;
     bool fHasColors;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 #endif
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp
index 1af49d2..71835db 100644
--- a/src/gpu/ops/GrDrawVerticesOp.cpp
+++ b/src/gpu/ops/GrDrawVerticesOp.cpp
@@ -10,7 +10,7 @@
 #include "GrOpFlushState.h"
 #include "SkGr.h"
 
-std::unique_ptr<GrMeshDrawOp> GrDrawVerticesOp::Make(
+std::unique_ptr<GrLegacyMeshDrawOp> GrDrawVerticesOp::Make(
         GrColor color, GrPrimitiveType primitiveType, const SkMatrix& viewMatrix,
         const SkPoint* positions, int vertexCount, const uint16_t* indices, int indexCount,
         const uint32_t* colors, const SkPoint* localCoords, const SkRect& bounds,
@@ -27,17 +27,18 @@
     if (!vertices) {
         return nullptr;
     }
-    return std::unique_ptr<GrMeshDrawOp>(new GrDrawVerticesOp(std::move(vertices), primitiveType,
-                                                              color, colorArrayType, viewMatrix));
+    return std::unique_ptr<GrLegacyMeshDrawOp>(new GrDrawVerticesOp(
+            std::move(vertices), primitiveType, color, colorArrayType, viewMatrix));
 }
 
-std::unique_ptr<GrMeshDrawOp> GrDrawVerticesOp::Make(GrColor color, sk_sp<SkVertices> vertices,
-                                                     const SkMatrix& viewMatrix) {
+std::unique_ptr<GrLegacyMeshDrawOp> GrDrawVerticesOp::Make(GrColor color,
+                                                           sk_sp<SkVertices> vertices,
+                                                           const SkMatrix& viewMatrix) {
     SkASSERT(vertices);
     GrPrimitiveType primType = SkVertexModeToGrPrimitiveType(vertices->mode());
-    return std::unique_ptr<GrMeshDrawOp>(new GrDrawVerticesOp(
-            std::move(vertices), primType, color, GrRenderTargetContext::ColorArrayType::kSkColor,
-            viewMatrix));
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
+            new GrDrawVerticesOp(std::move(vertices), primType, color,
+                                 GrRenderTargetContext::ColorArrayType::kSkColor, viewMatrix));
 }
 
 GrDrawVerticesOp::GrDrawVerticesOp(sk_sp<SkVertices> vertices, GrPrimitiveType primitiveType,
@@ -242,7 +243,7 @@
     } else {
         mesh.init(this->primitiveType(), vertexBuffer, firstVertex, fVertexCount);
     }
-    target->draw(gp.get(), mesh);
+    target->draw(gp.get(), this->pipeline(), mesh);
 }
 
 bool GrDrawVerticesOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
diff --git a/src/gpu/ops/GrDrawVerticesOp.h b/src/gpu/ops/GrDrawVerticesOp.h
index 2c4d1c9..4bd14af 100644
--- a/src/gpu/ops/GrDrawVerticesOp.h
+++ b/src/gpu/ops/GrDrawVerticesOp.h
@@ -21,7 +21,7 @@
 class SkVertices;
 struct GrInitInvariantOutput;
 
-class GrDrawVerticesOp final : public GrMeshDrawOp {
+class GrDrawVerticesOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -38,12 +38,11 @@
      * as local coords. 'colorArrayType' specifies whether the colors are premul GrColors or
      * unpremul SkColors.
      */
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, GrPrimitiveType primitiveType,
-                                              const SkMatrix& viewMatrix, const SkPoint* positions,
-                                              int vertexCount, const uint16_t* indices,
-                                              int indexCount, const uint32_t* colors,
-                                              const SkPoint* localCoords, const SkRect& bounds,
-                                              GrRenderTargetContext::ColorArrayType colorArrayType);
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(
+            GrColor color, GrPrimitiveType primitiveType, const SkMatrix& viewMatrix,
+            const SkPoint* positions, int vertexCount, const uint16_t* indices, int indexCount,
+            const uint32_t* colors, const SkPoint* localCoords, const SkRect& bounds,
+            GrRenderTargetContext::ColorArrayType colorArrayType);
 
     /**
      * Draw a SkVertices. The GrColor param is used if the vertices lack per-vertex color or 'flags'
@@ -51,8 +50,8 @@
      * specified by SkCanvas::VerticesFlags. If the vertices lack local coords or 'flags' indicates
      * that they should be ignored then the vertex positions are used as local coords.
      */
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, sk_sp<SkVertices>,
-                                              const SkMatrix& viewMatrix);
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, sk_sp<SkVertices>,
+                                                    const SkMatrix& viewMatrix);
 
     const char* name() const override { return "DrawVerticesOp"; }
 
@@ -139,7 +138,7 @@
     GrRenderTargetContext::ColorArrayType fColorArrayType;
     SkSTArray<1, Mesh, true> fMeshes;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 #endif
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index 6dce60e..4b8f5e3 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -21,7 +21,7 @@
                                          LocalCoords::kHasExplicit_Type, SkMatrix::I());
 }
 
-class NonAALatticeOp final : public GrMeshDrawOp {
+class NonAALatticeOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -133,7 +133,7 @@
                         positions, vertexStride, kVertsPerRect * patch.fIter->numRectsToDraw());
             }
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -162,14 +162,15 @@
     int fImageHeight;
     SkSTArray<1, Patch, true> fPatches;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrLatticeOp {
-std::unique_ptr<GrMeshDrawOp> MakeNonAA(GrColor color, const SkMatrix& viewMatrix, int imageWidth,
-                                        int imageHeight, std::unique_ptr<SkLatticeIter> iter,
-                                        const SkRect& dst) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> MakeNonAA(GrColor color, const SkMatrix& viewMatrix,
+                                              int imageWidth, int imageHeight,
+                                              std::unique_ptr<SkLatticeIter> iter,
+                                              const SkRect& dst) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new NonAALatticeOp(color, viewMatrix, imageWidth, imageHeight, std::move(iter), dst));
 }
 };
diff --git a/src/gpu/ops/GrLatticeOp.h b/src/gpu/ops/GrLatticeOp.h
index ef0f58a..65aa622 100644
--- a/src/gpu/ops/GrLatticeOp.h
+++ b/src/gpu/ops/GrLatticeOp.h
@@ -11,15 +11,16 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkLatticeIter;
 class SkMatrix;
 struct SkRect;
 
 namespace GrLatticeOp {
-std::unique_ptr<GrMeshDrawOp> MakeNonAA(GrColor color, const SkMatrix& viewMatrix, int imageWidth,
-                                        int imageHeight, std::unique_ptr<SkLatticeIter> iter,
-                                        const SkRect& dst);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeNonAA(GrColor color, const SkMatrix& viewMatrix,
+                                              int imageWidth, int imageHeight,
+                                              std::unique_ptr<SkLatticeIter> iter,
+                                              const SkRect& dst);
 };
 
 #endif
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index 047fca6..227c540 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -215,11 +215,12 @@
     typedef GrGeometryProcessor INHERITED;
 };
 
-class MSAAPathOp final : public GrMeshDrawOp {
+class MSAAPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkPath& path,
-                                              const SkMatrix& viewMatrix, const SkRect& devBounds) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkPath& path,
+                                                    const SkMatrix& viewMatrix,
+                                                    const SkRect& devBounds) {
         int contourCount;
         int maxLineVertices;
         int maxQuadVertices;
@@ -231,7 +232,7 @@
             return nullptr;
         }
 
-        return std::unique_ptr<GrMeshDrawOp>(new MSAAPathOp(
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new MSAAPathOp(
                 color, path, viewMatrix, devBounds, maxLineVertices, maxQuadVertices, isIndexed));
     }
 
@@ -420,7 +421,7 @@
                 lineMeshes.init(primitiveType, lineVertexBuffer, firstLineVertex,
                                   lineVertexOffset);
             }
-            target->draw(lineGP.get(), lineMeshes);
+            target->draw(lineGP.get(), this->pipeline(), lineMeshes);
         }
 
         if (quadVertexOffset) {
@@ -448,7 +449,7 @@
                 quadMeshes.init(kTriangles_GrPrimitiveType, quadVertexBuffer, firstQuadVertex,
                                 quadVertexOffset);
             }
-            target->draw(quadGP.get(), quadMeshes);
+            target->draw(quadGP.get(), this->pipeline(), quadMeshes);
         }
     }
 
@@ -568,7 +569,7 @@
     int fMaxQuadVertices;
     bool fIsIndexed;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrMSAAPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetContext,
@@ -625,7 +626,7 @@
 
     SkASSERT(passes[0]);
     {  // First pass
-        std::unique_ptr<GrMeshDrawOp> op =
+        std::unique_ptr<GrLegacyMeshDrawOp> op =
                 MSAAPathOp::Make(paint.getColor(), path, viewMatrix, devBounds);
         if (!op) {
             return false;
@@ -639,7 +640,7 @@
         }
         GrPipelineBuilder pipelineBuilder(std::move(firstPassPaint), aaType);
         pipelineBuilder.setUserStencil(passes[0]);
-        renderTargetContext->addMeshDrawOp(pipelineBuilder, clip, std::move(op));
+        renderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, clip, std::move(op));
     }
 
     if (passes[1]) {
@@ -662,13 +663,13 @@
         }
         const SkMatrix& viewM =
                 (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() : viewMatrix;
-        std::unique_ptr<GrMeshDrawOp> op(GrRectOpFactory::MakeNonAAFill(
+        std::unique_ptr<GrLegacyMeshDrawOp> op(GrRectOpFactory::MakeNonAAFill(
                 paint.getColor(), viewM, bounds, nullptr, &localMatrix));
 
         GrPipelineBuilder pipelineBuilder(std::move(paint), aaType);
         pipelineBuilder.setUserStencil(passes[1]);
 
-        renderTargetContext->addMeshDrawOp(pipelineBuilder, clip, std::move(op));
+        renderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, clip, std::move(op));
     }
     return true;
 }
diff --git a/src/gpu/ops/GrMeshDrawOp.cpp b/src/gpu/ops/GrMeshDrawOp.cpp
index c3a191d..3785245 100644
--- a/src/gpu/ops/GrMeshDrawOp.cpp
+++ b/src/gpu/ops/GrMeshDrawOp.cpp
@@ -43,9 +43,10 @@
     return vertices;
 }
 
-void GrMeshDrawOp::InstancedHelper::recordDraw(Target* target, const GrGeometryProcessor* gp) {
+void GrMeshDrawOp::InstancedHelper::recordDraw(Target* target, const GrGeometryProcessor* gp,
+                                               const GrPipeline* pipeline) {
     SkASSERT(fMesh.instanceCount());
-    target->draw(gp, fMesh);
+    target->draw(gp, pipeline, fMesh);
 }
 
 void* GrMeshDrawOp::QuadHelper::init(Target* target, size_t vertexStride, int quadsToDraw) {
@@ -62,7 +63,6 @@
 void GrMeshDrawOp::onExecute(GrOpFlushState* state) {
     SkASSERT(!state->drawOpArgs().fAppliedClip);
     SkASSERT(!state->drawOpArgs().fDstTexture.texture());
-    SkASSERT(state->drawOpArgs().fRenderTarget == this->pipeline()->getRenderTarget());
     int currUploadIdx = 0;
     int currMeshIdx = 0;
 
@@ -73,10 +73,11 @@
         while (currUploadIdx < fInlineUploads.count() &&
                fInlineUploads[currUploadIdx].fUploadBeforeToken == drawToken) {
             state->commandBuffer()->inlineUpload(state, fInlineUploads[currUploadIdx++].fUpload,
-                                                 this->pipeline()->getRenderTarget());
+                                                 state->drawOpArgs().fRenderTarget);
         }
         const QueuedDraw& draw = fQueuedDraws[currDrawIdx];
-        state->commandBuffer()->draw(*this->pipeline(), *draw.fGeometryProcessor.get(),
+        SkASSERT(draw.fPipeline->getRenderTarget() == state->drawOpArgs().fRenderTarget);
+        state->commandBuffer()->draw(*draw.fPipeline, *draw.fGeometryProcessor.get(),
                                      fMeshes.begin() + currMeshIdx, draw.fMeshCnt, this->bounds());
         currMeshIdx += draw.fMeshCnt;
         state->flushToken();
@@ -89,23 +90,25 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrMesh& mesh) {
+void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrPipeline* pipeline,
+                                const GrMesh& mesh) {
     GrMeshDrawOp* op = this->meshDrawOp();
     op->fMeshes.push_back(mesh);
     if (!op->fQueuedDraws.empty()) {
-        // If the last draw shares a geometry processor and there are no intervening uploads,
-        // add this mesh to it.
-        GrMeshDrawOp::QueuedDraw& lastDraw = op->fQueuedDraws.back();
-        if (lastDraw.fGeometryProcessor == gp &&
+        // If the last draw shares a geometry processor and pipeline and there are no intervening
+        // uploads, add this mesh to it.
+        GrLegacyMeshDrawOp::QueuedDraw& lastDraw = op->fQueuedDraws.back();
+        if (lastDraw.fGeometryProcessor == gp && lastDraw.fPipeline == pipeline &&
             (op->fInlineUploads.empty() ||
              op->fInlineUploads.back().fUploadBeforeToken != this->nextDrawToken())) {
             ++lastDraw.fMeshCnt;
             return;
         }
     }
-    GrMeshDrawOp::QueuedDraw& draw = op->fQueuedDraws.push_back();
+    GrLegacyMeshDrawOp::QueuedDraw& draw = op->fQueuedDraws.push_back();
     GrDrawOpUploadToken token = this->state()->issueDrawToken();
     draw.fGeometryProcessor.reset(gp);
+    draw.fPipeline = pipeline;
     draw.fMeshCnt = 1;
     if (op->fQueuedDraws.count() == 1) {
         op->fBaseDrawToken = token;
diff --git a/src/gpu/ops/GrMeshDrawOp.h b/src/gpu/ops/GrMeshDrawOp.h
index a8da29a..8daa62b 100644
--- a/src/gpu/ops/GrMeshDrawOp.h
+++ b/src/gpu/ops/GrMeshDrawOp.h
@@ -25,6 +25,77 @@
 public:
     class Target;
 
+protected:
+    GrMeshDrawOp(uint32_t classID);
+
+    /** Helper for rendering instances using an instanced index buffer. This class creates the space
+        for the vertices and flushes the draws to the GrMeshDrawOp::Target. */
+    class InstancedHelper {
+    public:
+        InstancedHelper() {}
+        /** Returns the allocated storage for the vertices. The caller should populate the vertices
+            before calling recordDraws(). */
+        void* init(Target*, GrPrimitiveType, size_t vertexStride, const GrBuffer*,
+                   int verticesPerInstance, int indicesPerInstance, int instancesToDraw);
+
+        /** Call after init() to issue draws to the GrMeshDrawOp::Target.*/
+        void recordDraw(Target*, const GrGeometryProcessor*, const GrPipeline*);
+
+    private:
+        GrMesh fMesh;
+    };
+
+    static const int kVerticesPerQuad = 4;
+    static const int kIndicesPerQuad = 6;
+
+    /** A specialization of InstanceHelper for quad rendering. */
+    class QuadHelper : private InstancedHelper {
+    public:
+        QuadHelper() : INHERITED() {}
+        /** Finds the cached quad index buffer and reserves vertex space. Returns nullptr on failure
+            and on success a pointer to the vertex data that the caller should populate before
+            calling recordDraws(). */
+        void* init(Target*, size_t vertexStride, int quadsToDraw);
+
+        using InstancedHelper::recordDraw;
+
+    private:
+        typedef InstancedHelper INHERITED;
+    };
+
+private:
+    void onPrepare(GrOpFlushState* state) final;
+    void onExecute(GrOpFlushState* state) final;
+
+    virtual void onPrepareDraws(Target*) const = 0;
+
+    // A set of contiguous draws that share a draw token and primitive processor. The draws all use
+    // the op's pipeline. The meshes for the draw are stored in the fMeshes array and each
+    // Queued draw uses fMeshCnt meshes from the fMeshes array. The reason for coallescing meshes
+    // that share a primitive processor into a QueuedDraw is that it allows the Gpu object to setup
+    // the shared state once and then issue draws for each mesh.
+    struct QueuedDraw {
+        int fMeshCnt = 0;
+        GrPendingProgramElement<const GrGeometryProcessor> fGeometryProcessor;
+        const GrPipeline* fPipeline;
+    };
+
+    // All draws in all the GrMeshDrawOps have implicit tokens based on the order they are enqueued
+    // globally across all ops. This is the offset of the first entry in fQueuedDraws.
+    // fQueuedDraws[i]'s token is fBaseDrawToken + i.
+    GrDrawOpUploadToken fBaseDrawToken;
+    SkSTArray<4, GrMesh> fMeshes;
+    SkSTArray<4, QueuedDraw, true> fQueuedDraws;
+
+    typedef GrDrawOp INHERITED;
+};
+
+/**
+ * Many of our ops derive from this class which initializes a GrPipeline just before being recorded.
+ * We are migrating away from use of this class.
+ */
+class GrLegacyMeshDrawOp : public GrMeshDrawOp {
+public:
     /**
      * Performs analysis of the fragment processors in GrProcessorSet and GrAppliedClip using the
      * initial color and coverage from this op's geometry processor.
@@ -49,19 +120,19 @@
      * the op is recorded. These methods are unnecessary as this information is in the pipeline.
      */
     FixedFunctionFlags fixedFunctionFlags() const override {
-        SkFAIL("This should never be called for mesh draw ops.");
+        SkFAIL("This should never be called for legacy mesh draw ops.");
         return FixedFunctionFlags::kNone;
     }
     bool xpRequiresDstTexture(const GrCaps&, const GrAppliedClip*) override {
-        SkFAIL("Should never be called for mesh draw ops.");
+        SkFAIL("Should never be called for legacy mesh draw ops.");
         return false;
     }
 
 protected:
-    GrMeshDrawOp(uint32_t classID);
+    GrLegacyMeshDrawOp(uint32_t classID) : INHERITED(classID) {}
     /**
-     * This is a legacy class only used by GrMeshDrawOp and will be removed. It presents some
-     * aspects of GrProcessorSet::Analysis to GrMeshDrawOp subclasses.
+     * This is a legacy class only used by GrLegacyMeshDrawOp and will be removed. It presents some
+     * aspects of GrProcessorSet::Analysis to GrLegacyMeshDrawOp subclasses.
      */
     class PipelineOptimizations {
     public:
@@ -116,41 +187,6 @@
         GrColor fOverrideColor;
     };
 
-    /** Helper for rendering instances using an instanced index index buffer. This class creates the
-        space for the vertices and flushes the draws to the GrMeshDrawOp::Target. */
-    class InstancedHelper {
-    public:
-        InstancedHelper() {}
-        /** Returns the allocated storage for the vertices. The caller should populate the vertices
-            before calling recordDraws(). */
-        void* init(Target*, GrPrimitiveType, size_t vertexStride, const GrBuffer*,
-                   int verticesPerInstance, int indicesPerInstance, int instancesToDraw);
-
-        /** Call after init() to issue draws to the GrMeshDrawOp::Target.*/
-        void recordDraw(Target*, const GrGeometryProcessor*);
-
-    private:
-        GrMesh fMesh;
-    };
-
-    static const int kVerticesPerQuad = 4;
-    static const int kIndicesPerQuad = 6;
-
-    /** A specialization of InstanceHelper for quad rendering. */
-    class QuadHelper : private InstancedHelper {
-    public:
-        QuadHelper() : INHERITED() {}
-        /** Finds the cached quad index buffer and reserves vertex space. Returns nullptr on failure
-            and on success a pointer to the vertex data that the caller should populate before
-            calling recordDraws(). */
-        void* init(Target*, size_t vertexStride, int quadsToDraw);
-
-        using InstancedHelper::recordDraw;
-
-    private:
-        typedef InstancedHelper INHERITED;
-    };
-
     const GrPipeline* pipeline() const {
         SkASSERT(fPipeline.isInitialized());
         return &fPipeline;
@@ -170,30 +206,9 @@
      */
     virtual void applyPipelineOptimizations(const PipelineOptimizations&) = 0;
 
-    void onPrepare(GrOpFlushState* state) final;
-    void onExecute(GrOpFlushState* state) final;
-
-    virtual void onPrepareDraws(Target*) const = 0;
-
-    // A set of contiguous draws that share a draw token and primitive processor. The draws all use
-    // the op's pipeline. The meshes for the draw are stored in the fMeshes array and each
-    // Queued draw uses fMeshCnt meshes from the fMeshes array. The reason for coallescing meshes
-    // that share a primitive processor into a QueuedDraw is that it allows the Gpu object to setup
-    // the shared state once and then issue draws for each mesh.
-    struct QueuedDraw {
-        int fMeshCnt = 0;
-        GrPendingProgramElement<const GrGeometryProcessor> fGeometryProcessor;
-    };
-
-    // All draws in all the GrMeshDrawOps have implicit tokens based on the order they are enqueued
-    // globally across all ops. This is the offset of the first entry in fQueuedDraws.
-    // fQueuedDraws[i]'s token is fBaseDrawToken + i.
-    GrDrawOpUploadToken fBaseDrawToken;
     GrPipeline fPipeline;
-    SkSTArray<4, GrMesh> fMeshes;
-    SkSTArray<4, QueuedDraw, true> fQueuedDraws;
 
-    typedef GrDrawOp INHERITED;
+    typedef GrMeshDrawOp INHERITED;
 };
 
 #endif
diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp
index c522794..99cb2bd 100644
--- a/src/gpu/ops/GrNonAAFillRectOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectOp.cpp
@@ -67,7 +67,7 @@
     }
 }
 
-class NonAAFillRectOp final : public GrMeshDrawOp {
+class NonAAFillRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -148,7 +148,7 @@
             tesselate(verts, vertexStride, fRects[i].fColor, &fRects[i].fViewMatrix,
                       fRects[i].fRect, &fRects[i].fLocalQuad);
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -172,17 +172,17 @@
 
     SkSTArray<1, RectInfo, true> fRects;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrNonAAFillRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkRect* localRect,
-                                   const SkMatrix* localMatrix) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkRect* localRect,
+                                         const SkMatrix* localMatrix) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new NonAAFillRectOp(color, viewMatrix, rect, localRect, localMatrix));
 }
 };
diff --git a/src/gpu/ops/GrNonAAFillRectOp.h b/src/gpu/ops/GrNonAAFillRectOp.h
index 046a955..8972281 100644
--- a/src/gpu/ops/GrNonAAFillRectOp.h
+++ b/src/gpu/ops/GrNonAAFillRectOp.h
@@ -11,23 +11,23 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkMatrix;
 struct SkRect;
 
 namespace GrNonAAFillRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkRect* localRect,
-                                   const SkMatrix* localMatrix);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkRect* localRect,
+                                         const SkMatrix* localMatrix);
 
-std::unique_ptr<GrMeshDrawOp> MakeWithPerspective(GrColor color,
-                                                  const SkMatrix& viewMatrix,
-                                                  const SkRect& rect,
-                                                  const SkRect* localRect,
-                                                  const SkMatrix* localMatrix);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeWithPerspective(GrColor color,
+                                                        const SkMatrix& viewMatrix,
+                                                        const SkRect& rect,
+                                                        const SkRect* localRect,
+                                                        const SkMatrix* localMatrix);
 };
 
 #endif
diff --git a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
index a7c445c..fef5154 100644
--- a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
@@ -89,7 +89,7 @@
 }
 
 // We handle perspective in the local matrix or viewmatrix with special ops.
-class NonAAFillRectPerspectiveOp final : public GrMeshDrawOp {
+class NonAAFillRectPerspectiveOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -178,7 +178,7 @@
                 tesselate(verts, vertexStride, info.fColor, nullptr, info.fRect, nullptr);
             }
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -216,17 +216,17 @@
     SkMatrix fLocalMatrix;
     SkMatrix fViewMatrix;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrNonAAFillRectOp {
 
-std::unique_ptr<GrMeshDrawOp> MakeWithPerspective(GrColor color,
-                                                  const SkMatrix& viewMatrix,
-                                                  const SkRect& rect,
-                                                  const SkRect* localRect,
-                                                  const SkMatrix* localMatrix) {
-    return std::unique_ptr<GrMeshDrawOp>(
+std::unique_ptr<GrLegacyMeshDrawOp> MakeWithPerspective(GrColor color,
+                                                        const SkMatrix& viewMatrix,
+                                                        const SkRect& rect,
+                                                        const SkRect* localRect,
+                                                        const SkMatrix* localMatrix) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(
             new NonAAFillRectPerspectiveOp(color, viewMatrix, rect, localRect, localMatrix));
 }
 };
diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
index ffabad1..69958c0 100644
--- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
@@ -46,7 +46,7 @@
            (stroke.getJoin() == SkPaint::kMiter_Join && stroke.getMiter() > SK_ScalarSqrt2);
 }
 
-class NonAAStrokeRectOp final : public GrMeshDrawOp {
+class NonAAStrokeRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -63,9 +63,9 @@
         return string;
     }
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              const SkRect& rect, const SkStrokeRec& stroke,
-                                              bool snapToPixelCenters) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    const SkRect& rect, const SkStrokeRec& stroke,
+                                                    bool snapToPixelCenters) {
         if (!allowed_stroke(stroke)) {
             return nullptr;
         }
@@ -96,7 +96,7 @@
         } else {
             op->setTransformedBounds(bounds, op->fViewMatrix, HasAABloat::kNo, IsZeroArea::kNo);
         }
-        return std::unique_ptr<GrMeshDrawOp>(op);
+        return std::unique_ptr<GrLegacyMeshDrawOp>(op);
     }
 
 private:
@@ -158,7 +158,7 @@
 
         GrMesh mesh;
         mesh.init(primType, vertexBuffer, firstVertex, vertexCount);
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
     }
 
     void applyPipelineOptimizations(const PipelineOptimizations& optimizations) override {
@@ -181,16 +181,16 @@
     const static int kVertsPerHairlineRect = 5;
     const static int kVertsPerStrokeRect = 10;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrNonAAStrokeRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkStrokeRec& stroke,
-                                   bool snapToPixelCenters) {
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkStrokeRec& stroke,
+                                         bool snapToPixelCenters) {
     return NonAAStrokeRectOp::Make(color, viewMatrix, rect, stroke, snapToPixelCenters);
 }
 }
diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.h b/src/gpu/ops/GrNonAAStrokeRectOp.h
index 5c9c98e..4071cfd 100644
--- a/src/gpu/ops/GrNonAAStrokeRectOp.h
+++ b/src/gpu/ops/GrNonAAStrokeRectOp.h
@@ -11,18 +11,18 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 struct SkRect;
 class SkStrokeRec;
 class SkMatrix;
 
 namespace GrNonAAStrokeRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRect& rect,
-                                   const SkStrokeRec&,
-                                   bool snapToPixelCenters);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRect& rect,
+                                         const SkStrokeRec&,
+                                         bool snapToPixelCenters);
 }
 
 #endif
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 5ede5e1..e00ee0b 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -608,7 +608,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-class CircleOp final : public GrMeshDrawOp {
+class CircleOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -618,9 +618,10 @@
         SkScalar fSweepAngleRadians;
         bool fUseCenter;
     };
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              SkPoint center, SkScalar radius, const GrStyle& style,
-                                              const ArcParams* arcParams = nullptr) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    SkPoint center, SkScalar radius,
+                                                    const GrStyle& style,
+                                                    const ArcParams* arcParams = nullptr) {
         SkASSERT(circle_stays_circle(viewMatrix));
         const SkStrokeRec& stroke = style.strokeRec();
         if (style.hasPathEffect()) {
@@ -1098,7 +1099,7 @@
         GrMesh mesh;
         mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
                          firstIndex, fVertCount, fIndexCount);
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -1152,16 +1153,17 @@
     bool fClipPlaneIsect;
     bool fClipPlaneUnion;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 
-class EllipseOp : public GrMeshDrawOp {
+class EllipseOp : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              const SkRect& ellipse, const SkStrokeRec& stroke) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    const SkRect& ellipse,
+                                                    const SkStrokeRec& stroke) {
         SkASSERT(viewMatrix.rectStaysRect());
 
         // do any matrix crunching before we reset the draw state for device coords
@@ -1334,7 +1336,7 @@
 
             verts += kVerticesPerQuad;
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -1371,19 +1373,19 @@
     SkMatrix fViewMatrixIfUsingLocalCoords;
     SkSTArray<1, Geometry, true> fGeoData;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
-class DIEllipseOp : public GrMeshDrawOp {
+class DIEllipseOp : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                              const SkMatrix& viewMatrix,
-                                              const SkRect& ellipse,
-                                              const SkStrokeRec& stroke) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                                    const SkMatrix& viewMatrix,
+                                                    const SkRect& ellipse,
+                                                    const SkStrokeRec& stroke) {
         SkPoint center = SkPoint::Make(ellipse.centerX(), ellipse.centerY());
         SkScalar xRadius = SkScalarHalf(ellipse.width());
         SkScalar yRadius = SkScalarHalf(ellipse.height());
@@ -1536,7 +1538,7 @@
 
             verts += kVerticesPerQuad;
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -1579,7 +1581,7 @@
     bool fUsesLocalCoords;
     SkSTArray<1, Geometry, true> fGeoData;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1712,7 +1714,7 @@
 //   each vertex is also given the normalized x & y distance from the interior rect's edge
 //      the GP takes the min of those depths +1 to get the normalized distance to the outer edge
 
-class CircularRRectOp : public GrMeshDrawOp {
+class CircularRRectOp : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -1998,7 +2000,7 @@
         GrMesh mesh;
         mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
                          firstIndex, fVertCount, fIndexCount);
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -2040,7 +2042,7 @@
     int fIndexCount;
     bool fAllFill;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 static const int kNumRRectsInIndexBuffer = 256;
@@ -2066,16 +2068,16 @@
     };
 }
 
-class EllipticalRRectOp : public GrMeshDrawOp {
+class EllipticalRRectOp : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
     // If devStrokeWidths values are <= 0 indicates then fill only. Otherwise, strokeOnly indicates
     // whether the rrect is only stroked or stroked and filled.
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              const SkRect& devRect, float devXRadius,
-                                              float devYRadius, SkVector devStrokeWidths,
-                                              bool strokeOnly) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    const SkRect& devRect, float devXRadius,
+                                                    float devYRadius, SkVector devStrokeWidths,
+                                                    bool strokeOnly) {
         SkASSERT(devXRadius > 0.5);
         SkASSERT(devYRadius > 0.5);
         SkASSERT((devStrokeWidths.fX > 0) == (devStrokeWidths.fY > 0));
@@ -2246,7 +2248,7 @@
                 verts++;
             }
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -2283,14 +2285,14 @@
     SkMatrix fViewMatrixIfUsingLocalCoords;
     SkSTArray<1, Geometry, true> fGeoData;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
-static std::unique_ptr<GrMeshDrawOp> make_rrect_op(GrColor color,
-                                                   bool needsDistance,
-                                                   const SkMatrix& viewMatrix,
-                                                   const SkRRect& rrect,
-                                                   const SkStrokeRec& stroke) {
+static std::unique_ptr<GrLegacyMeshDrawOp> make_rrect_op(GrColor color,
+                                                         bool needsDistance,
+                                                         const SkMatrix& viewMatrix,
+                                                         const SkRRect& rrect,
+                                                         const SkStrokeRec& stroke) {
     SkASSERT(viewMatrix.rectStaysRect());
     SkASSERT(rrect.isSimple());
     SkASSERT(!rrect.isOval());
@@ -2348,7 +2350,7 @@
 
     // if the corners are circles, use the circle renderer
     if (isCircular) {
-        return std::unique_ptr<GrMeshDrawOp>(new CircularRRectOp(
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new CircularRRectOp(
                 color, needsDistance, viewMatrix, bounds, xRadius, scaledStroke.fX, isStrokeOnly));
         // otherwise we use the ellipse renderer
     } else {
@@ -2357,12 +2359,12 @@
     }
 }
 
-std::unique_ptr<GrMeshDrawOp> GrOvalOpFactory::MakeRRectOp(GrColor color,
-                                                           bool needsDistance,
-                                                           const SkMatrix& viewMatrix,
-                                                           const SkRRect& rrect,
-                                                           const SkStrokeRec& stroke,
-                                                           const GrShaderCaps* shaderCaps) {
+std::unique_ptr<GrLegacyMeshDrawOp> GrOvalOpFactory::MakeRRectOp(GrColor color,
+                                                                 bool needsDistance,
+                                                                 const SkMatrix& viewMatrix,
+                                                                 const SkRRect& rrect,
+                                                                 const SkStrokeRec& stroke,
+                                                                 const GrShaderCaps* shaderCaps) {
     if (rrect.isOval()) {
         return MakeOvalOp(color, viewMatrix, rrect.getBounds(), stroke, shaderCaps);
     }
@@ -2376,11 +2378,11 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-std::unique_ptr<GrMeshDrawOp> GrOvalOpFactory::MakeOvalOp(GrColor color,
-                                                          const SkMatrix& viewMatrix,
-                                                          const SkRect& oval,
-                                                          const SkStrokeRec& stroke,
-                                                          const GrShaderCaps* shaderCaps) {
+std::unique_ptr<GrLegacyMeshDrawOp> GrOvalOpFactory::MakeOvalOp(GrColor color,
+                                                                const SkMatrix& viewMatrix,
+                                                                const SkRect& oval,
+                                                                const SkStrokeRec& stroke,
+                                                                const GrShaderCaps* shaderCaps) {
     // we can draw circles
     SkScalar width = oval.width();
     if (SkScalarNearlyEqual(width, oval.height()) && circle_stays_circle(viewMatrix)) {
@@ -2403,11 +2405,9 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-std::unique_ptr<GrMeshDrawOp> GrOvalOpFactory::MakeArcOp(GrColor color, const SkMatrix& viewMatrix,
-                                                         const SkRect& oval, SkScalar startAngle,
-                                                         SkScalar sweepAngle, bool useCenter,
-                                                         const GrStyle& style,
-                                                         const GrShaderCaps* shaderCaps) {
+std::unique_ptr<GrLegacyMeshDrawOp> GrOvalOpFactory::MakeArcOp(
+        GrColor color, const SkMatrix& viewMatrix, const SkRect& oval, SkScalar startAngle,
+        SkScalar sweepAngle, bool useCenter, const GrStyle& style, const GrShaderCaps* shaderCaps) {
     SkASSERT(!oval.isEmpty());
     SkASSERT(sweepAngle);
     SkScalar width = oval.width();
@@ -2450,8 +2450,8 @@
             arcParamsTmp.fUseCenter = random->nextBool();
             arcParams = &arcParamsTmp;
         }
-        std::unique_ptr<GrMeshDrawOp> op = CircleOp::Make(color, viewMatrix, center, radius,
-                                                          GrStyle(stroke, nullptr), arcParams);
+        std::unique_ptr<GrLegacyMeshDrawOp> op = CircleOp::Make(
+                color, viewMatrix, center, radius, GrStyle(stroke, nullptr), arcParams);
         if (op) {
             return op;
         }
diff --git a/src/gpu/ops/GrOvalOpFactory.h b/src/gpu/ops/GrOvalOpFactory.h
index e6a160d..72e0fa2 100644
--- a/src/gpu/ops/GrOvalOpFactory.h
+++ b/src/gpu/ops/GrOvalOpFactory.h
@@ -11,7 +11,7 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class GrShaderCaps;
 class GrStyle;
 class SkMatrix;
@@ -24,26 +24,26 @@
  */
 class GrOvalOpFactory {
 public:
-    static std::unique_ptr<GrMeshDrawOp> MakeOvalOp(GrColor,
-                                                    const SkMatrix& viewMatrix,
-                                                    const SkRect& oval,
-                                                    const SkStrokeRec& stroke,
-                                                    const GrShaderCaps* shaderCaps);
-    static std::unique_ptr<GrMeshDrawOp> MakeRRectOp(GrColor,
-                                                     bool needsDistance,
-                                                     const SkMatrix& viewMatrix,
-                                                     const SkRRect& rrect,
-                                                     const SkStrokeRec& stroke,
-                                                     const GrShaderCaps* shaderCaps);
+    static std::unique_ptr<GrLegacyMeshDrawOp> MakeOvalOp(GrColor,
+                                                          const SkMatrix& viewMatrix,
+                                                          const SkRect& oval,
+                                                          const SkStrokeRec& stroke,
+                                                          const GrShaderCaps* shaderCaps);
+    static std::unique_ptr<GrLegacyMeshDrawOp> MakeRRectOp(GrColor,
+                                                           bool needsDistance,
+                                                           const SkMatrix& viewMatrix,
+                                                           const SkRRect& rrect,
+                                                           const SkStrokeRec& stroke,
+                                                           const GrShaderCaps* shaderCaps);
 
-    static std::unique_ptr<GrMeshDrawOp> MakeArcOp(GrColor,
-                                                   const SkMatrix& viewMatrix,
-                                                   const SkRect& oval,
-                                                   SkScalar startAngle,
-                                                   SkScalar sweepAngle,
-                                                   bool useCenter,
-                                                   const GrStyle&,
-                                                   const GrShaderCaps* shaderCaps);
+    static std::unique_ptr<GrLegacyMeshDrawOp> MakeArcOp(GrColor,
+                                                         const SkMatrix& viewMatrix,
+                                                         const SkRect& oval,
+                                                         SkScalar startAngle,
+                                                         SkScalar sweepAngle,
+                                                         bool useCenter,
+                                                         const GrStyle&,
+                                                         const GrShaderCaps* shaderCaps);
 };
 
 #endif  // GrOvalOpFactory_DEFINED
diff --git a/src/gpu/ops/GrRectOpFactory.cpp b/src/gpu/ops/GrRectOpFactory.cpp
index e6d0c1f..45e2053 100644
--- a/src/gpu/ops/GrRectOpFactory.cpp
+++ b/src/gpu/ops/GrRectOpFactory.cpp
@@ -13,9 +13,9 @@
 
 namespace GrRectOpFactory {
 
-std::unique_ptr<GrMeshDrawOp> MakeAAFillNestedRects(GrColor color,
-                                                    const SkMatrix& viewMatrix,
-                                                    const SkRect rects[2]) {
+std::unique_ptr<GrLegacyMeshDrawOp> MakeAAFillNestedRects(GrColor color,
+                                                          const SkMatrix& viewMatrix,
+                                                          const SkRect rects[2]) {
     SkASSERT(viewMatrix.rectStaysRect());
     SkASSERT(!rects[0].isEmpty() && !rects[1].isEmpty());
 
diff --git a/src/gpu/ops/GrRectOpFactory.h b/src/gpu/ops/GrRectOpFactory.h
index 19bce7f..fef88e6 100644
--- a/src/gpu/ops/GrRectOpFactory.h
+++ b/src/gpu/ops/GrRectOpFactory.h
@@ -27,11 +27,11 @@
  */
 namespace GrRectOpFactory {
 
-inline std::unique_ptr<GrMeshDrawOp> MakeNonAAFill(GrColor color,
-                                                   const SkMatrix& viewMatrix,
-                                                   const SkRect& rect,
-                                                   const SkRect* localRect,
-                                                   const SkMatrix* localMatrix) {
+inline std::unique_ptr<GrLegacyMeshDrawOp> MakeNonAAFill(GrColor color,
+                                                         const SkMatrix& viewMatrix,
+                                                         const SkRect& rect,
+                                                         const SkRect* localRect,
+                                                         const SkMatrix* localMatrix) {
     if (viewMatrix.hasPerspective() || (localMatrix && localMatrix->hasPerspective())) {
         return GrNonAAFillRectOp::MakeWithPerspective(color, viewMatrix, rect, localRect,
                                                       localMatrix);
@@ -40,11 +40,11 @@
     }
 }
 
-inline std::unique_ptr<GrMeshDrawOp> MakeAAFill(const GrPaint& paint,
-                                                const SkMatrix& viewMatrix,
-                                                const SkRect& rect,
-                                                const SkRect& croppedRect,
-                                                const SkRect& devRect) {
+inline std::unique_ptr<GrLegacyMeshDrawOp> MakeAAFill(const GrPaint& paint,
+                                                      const SkMatrix& viewMatrix,
+                                                      const SkRect& rect,
+                                                      const SkRect& croppedRect,
+                                                      const SkRect& devRect) {
     if (!paint.usesDistanceVectorField()) {
         return GrAAFillRectOp::Make(paint.getColor(), viewMatrix, croppedRect, devRect);
     } else {
@@ -52,32 +52,32 @@
     }
 }
 
-inline std::unique_ptr<GrMeshDrawOp> MakeAAFill(GrColor color,
-                                                const SkMatrix& viewMatrix,
-                                                const SkMatrix& localMatrix,
-                                                const SkRect& rect,
-                                                const SkRect& devRect) {
+inline std::unique_ptr<GrLegacyMeshDrawOp> MakeAAFill(GrColor color,
+                                                      const SkMatrix& viewMatrix,
+                                                      const SkMatrix& localMatrix,
+                                                      const SkRect& rect,
+                                                      const SkRect& devRect) {
     return GrAAFillRectOp::Make(color, viewMatrix, localMatrix, rect, devRect);
 }
 
-inline std::unique_ptr<GrMeshDrawOp> MakeNonAAStroke(GrColor color,
-                                                     const SkMatrix& viewMatrix,
-                                                     const SkRect& rect,
-                                                     const SkStrokeRec& strokeRec,
-                                                     bool snapToPixelCenters) {
+inline std::unique_ptr<GrLegacyMeshDrawOp> MakeNonAAStroke(GrColor color,
+                                                           const SkMatrix& viewMatrix,
+                                                           const SkRect& rect,
+                                                           const SkStrokeRec& strokeRec,
+                                                           bool snapToPixelCenters) {
     return GrNonAAStrokeRectOp::Make(color, viewMatrix, rect, strokeRec, snapToPixelCenters);
 }
 
-inline std::unique_ptr<GrMeshDrawOp> MakeAAStroke(GrColor color,
-                                                  const SkMatrix& viewMatrix,
-                                                  const SkRect& rect,
-                                                  const SkStrokeRec& stroke) {
+inline std::unique_ptr<GrLegacyMeshDrawOp> MakeAAStroke(GrColor color,
+                                                        const SkMatrix& viewMatrix,
+                                                        const SkRect& rect,
+                                                        const SkStrokeRec& stroke) {
     return GrAAStrokeRectOp::Make(color, viewMatrix, rect, stroke);
 }
 
 // First rect is outer; second rect is inner
-std::unique_ptr<GrMeshDrawOp> MakeAAFillNestedRects(GrColor, const SkMatrix& viewMatrix,
-                                                    const SkRect rects[2]);
+std::unique_ptr<GrLegacyMeshDrawOp> MakeAAFillNestedRects(GrColor, const SkMatrix& viewMatrix,
+                                                          const SkRect rects[2]);
 };
 
 #endif
diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp
index ba153a6..91191f3 100644
--- a/src/gpu/ops/GrRegionOp.cpp
+++ b/src/gpu/ops/GrRegionOp.cpp
@@ -47,7 +47,7 @@
     }
 }
 
-class RegionOp final : public GrMeshDrawOp {
+class RegionOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -118,7 +118,7 @@
             int numRectsInRegion = fRegions[i].fRegion.computeRegionComplexity();
             verts += numRectsInRegion * kVertsPerInstance * vertexStride;
         }
-        helper.recordDraw(target, gp.get());
+        helper.recordDraw(target, gp.get(), this->pipeline());
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -145,13 +145,13 @@
     SkMatrix fViewMatrix;
     SkSTArray<1, RegionInfo, true> fRegions;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 namespace GrRegionOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                   const SkRegion& region) {
-    return std::unique_ptr<GrMeshDrawOp>(new RegionOp(color, viewMatrix, region));
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                         const SkRegion& region) {
+    return std::unique_ptr<GrLegacyMeshDrawOp>(new RegionOp(color, viewMatrix, region));
 }
 }
diff --git a/src/gpu/ops/GrRegionOp.h b/src/gpu/ops/GrRegionOp.h
index 5ee6f35..2170667 100644
--- a/src/gpu/ops/GrRegionOp.h
+++ b/src/gpu/ops/GrRegionOp.h
@@ -11,13 +11,13 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class SkMatrix;
 class SkRegion;
 
 namespace GrRegionOp {
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                   const SkRegion& region);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                         const SkRegion& region);
 }
 
 #endif
diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp
index 9b2bc82..00ec35f 100644
--- a/src/gpu/ops/GrShadowRRectOp.cpp
+++ b/src/gpu/ops/GrShadowRRectOp.cpp
@@ -63,13 +63,13 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-class ShadowCircleOp final : public GrMeshDrawOp {
+class ShadowCircleOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
-                                              SkPoint center, SkScalar radius, SkScalar blurRadius,
-                                              const GrStyle& style) {
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const SkMatrix& viewMatrix,
+                                                    SkPoint center, SkScalar radius,
+                                                    SkScalar blurRadius, const GrStyle& style) {
         SkASSERT(viewMatrix.isSimilarity());
         const SkStrokeRec& stroke = style.strokeRec();
         if (style.hasPathEffect()) {
@@ -353,7 +353,7 @@
         GrMesh mesh;
         mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
                          firstIndex, fVertCount, fIndexCount);
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -388,7 +388,7 @@
     int fVertCount;
     int fIndexCount;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -504,7 +504,7 @@
 //   each vertex is also given the normalized x & y distance from the interior rect's edge
 //      the GP takes the min of those depths +1 to get the normalized distance to the outer edge
 
-class ShadowCircularRRectOp final : public GrMeshDrawOp {
+class ShadowCircularRRectOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -768,7 +768,7 @@
         GrMesh mesh;
         mesh.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
                          firstIndex, fVertCount, fIndexCount);
-        target->draw(gp.get(), mesh);
+        target->draw(gp.get(), this->pipeline(), mesh);
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
@@ -803,17 +803,17 @@
     int fVertCount;
     int fIndexCount;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 
-std::unique_ptr<GrMeshDrawOp> make_shadow_circle_op(GrColor color,
-                                                    const SkMatrix& viewMatrix,
-                                                    const SkRect& oval,
-                                                    SkScalar blurRadius,
-                                                    const SkStrokeRec& stroke,
-                                                    const GrShaderCaps* shaderCaps) {
+std::unique_ptr<GrLegacyMeshDrawOp> make_shadow_circle_op(GrColor color,
+                                                          const SkMatrix& viewMatrix,
+                                                          const SkRect& oval,
+                                                          SkScalar blurRadius,
+                                                          const SkStrokeRec& stroke,
+                                                          const GrShaderCaps* shaderCaps) {
     // we can only draw circles
     SkScalar width = oval.width();
     SkASSERT(SkScalarNearlyEqual(width, oval.height()) && viewMatrix.isSimilarity());
@@ -822,11 +822,11 @@
                                 GrStyle(stroke, nullptr));
 }
 
-static std::unique_ptr<GrMeshDrawOp> make_shadow_rrect_op(GrColor color,
-                                                          const SkMatrix& viewMatrix,
-                                                          const SkRRect& rrect,
-                                                          SkScalar blurRadius,
-                                                          const SkStrokeRec& stroke) {
+static std::unique_ptr<GrLegacyMeshDrawOp> make_shadow_rrect_op(GrColor color,
+                                                                const SkMatrix& viewMatrix,
+                                                                const SkRRect& rrect,
+                                                                SkScalar blurRadius,
+                                                                const SkStrokeRec& stroke) {
     SkASSERT(viewMatrix.rectStaysRect());
     SkASSERT(rrect.isSimple());
     SkASSERT(!rrect.isOval());
@@ -879,17 +879,17 @@
         return nullptr;
     }
 
-    return std::unique_ptr<GrMeshDrawOp>(new ShadowCircularRRectOp(
+    return std::unique_ptr<GrLegacyMeshDrawOp>(new ShadowCircularRRectOp(
             color, viewMatrix, bounds, xRadius, blurRadius, scaledStroke.fX, isStrokeOnly));
 }
 
 namespace GrShadowRRectOp {
-std::unique_ptr<GrMeshDrawOp> Make(GrColor color,
-                                   const SkMatrix& viewMatrix,
-                                   const SkRRect& rrect,
-                                   const SkScalar blurRadius,
-                                   const SkStrokeRec& stroke,
-                                   const GrShaderCaps* shaderCaps) {
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color,
+                                         const SkMatrix& viewMatrix,
+                                         const SkRRect& rrect,
+                                         const SkScalar blurRadius,
+                                         const SkStrokeRec& stroke,
+                                         const GrShaderCaps* shaderCaps) {
     if (rrect.isOval()) {
         return make_shadow_circle_op(color, viewMatrix, rrect.getBounds(), blurRadius, stroke,
                                      shaderCaps);
@@ -922,7 +922,7 @@
         SkScalar radius = circle.width() / 2.f;
         SkStrokeRec stroke = GrTest::TestStrokeRec(random);
         SkScalar blurRadius = random->nextSScalar1() * 72.f;
-        std::unique_ptr<GrMeshDrawOp> op = ShadowCircleOp::Make(
+        std::unique_ptr<GrLegacyMeshDrawOp> op = ShadowCircleOp::Make(
                 color, viewMatrix, center, radius, blurRadius, GrStyle(stroke, nullptr));
         if (op) {
             return op;
diff --git a/src/gpu/ops/GrShadowRRectOp.h b/src/gpu/ops/GrShadowRRectOp.h
index 081b217..9b9993e 100644
--- a/src/gpu/ops/GrShadowRRectOp.h
+++ b/src/gpu/ops/GrShadowRRectOp.h
@@ -11,7 +11,7 @@
 #include "GrColor.h"
 #include "SkRefCnt.h"
 
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
 class GrShaderCaps;
 class SkMatrix;
 class SkRRect;
@@ -19,9 +19,9 @@
 
 namespace GrShadowRRectOp {
 
-std::unique_ptr<GrMeshDrawOp> Make(GrColor, const SkMatrix& viewMatrix, const SkRRect& rrect,
-                                   const SkScalar blurRadius, const SkStrokeRec& stroke,
-                                   const GrShaderCaps* shaderCaps);
+std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor, const SkMatrix& viewMatrix, const SkRRect& rrect,
+                                         const SkScalar blurRadius, const SkStrokeRec& stroke,
+                                         const GrShaderCaps* shaderCaps);
 }
 
 #endif
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index ced9b4e..ef70bc5 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -133,7 +133,7 @@
 // padding around path bounds to allow for antialiased pixels
 static const SkScalar kAntiAliasPad = 1.0f;
 
-class SmallPathOp final : public GrMeshDrawOp {
+class SmallPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -141,12 +141,12 @@
     using ShapeCache = SkTDynamicHash<ShapeData, ShapeData::Key>;
     using ShapeDataList = GrSmallPathRenderer::ShapeDataList;
 
-    static std::unique_ptr<GrMeshDrawOp> Make(GrColor color, const GrShape& shape,
-                                              const SkMatrix& viewMatrix, GrDrawOpAtlas* atlas,
-                                              ShapeCache* shapeCache, ShapeDataList* shapeList,
-                                              bool gammaCorrect) {
-        return std::unique_ptr<GrMeshDrawOp>(new SmallPathOp(color, shape, viewMatrix, atlas,
-                                                             shapeCache, shapeList, gammaCorrect));
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(GrColor color, const GrShape& shape,
+                                                    const SkMatrix& viewMatrix,
+                                                    GrDrawOpAtlas* atlas, ShapeCache* shapeCache,
+                                                    ShapeDataList* shapeList, bool gammaCorrect) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(new SmallPathOp(
+                color, shape, viewMatrix, atlas, shapeCache, shapeList, gammaCorrect));
     }
 
     const char* name() const override { return "SmallPathOp"; }
@@ -388,9 +388,9 @@
         this->flush(target, &flushInfo);
     }
 
-    bool addDFPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo, GrDrawOpAtlas* atlas,
-                          ShapeData* shapeData, const GrShape& shape, uint32_t dimension,
-                          SkScalar scale) const {
+    bool addDFPathToAtlas(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo,
+                          GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape,
+                          uint32_t dimension, SkScalar scale) const {
         const SkRect& bounds = shape.bounds();
 
         // generate bounding rect for bitmap draw
@@ -505,9 +505,9 @@
         return true;
     }
 
-    bool addBMPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo, 
-                          GrDrawOpAtlas* atlas, ShapeData* shapeData,
-                          const GrShape& shape, const SkMatrix& ctm) const {
+    bool addBMPathToAtlas(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo,
+                          GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape,
+                          const SkMatrix& ctm) const {
         const SkRect& bounds = shape.bounds();
         if (bounds.isEmpty()) {
             return false;
@@ -677,7 +677,7 @@
         textureCoords[1] = t;
     }
 
-    void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
+    void flush(GrLegacyMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
         if (flushInfo->fInstancesToFlush) {
             GrMesh mesh;
             int maxInstancesPerDraw =
@@ -685,7 +685,7 @@
             mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer.get(),
                 flushInfo->fIndexBuffer.get(), flushInfo->fVertexOffset, kVerticesPerQuad,
                 kIndicesPerQuad, flushInfo->fInstancesToFlush, maxInstancesPerDraw);
-            target->draw(flushInfo->fGeometryProcessor.get(), mesh);
+            target->draw(flushInfo->fGeometryProcessor.get(), this->pipeline(), mesh);
             flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFlush;
             flushInfo->fInstancesToFlush = 0;
         }
@@ -738,7 +738,7 @@
     ShapeDataList* fShapeList;
     bool fGammaCorrect;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrSmallPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -760,13 +760,13 @@
         }
     }
 
-    std::unique_ptr<GrMeshDrawOp> op = SmallPathOp::Make(
-            args.fPaint.getColor(), *args.fShape, *args.fViewMatrix, fAtlas.get(), &fShapeCache,
-            &fShapeList, args.fGammaCorrect);
+    std::unique_ptr<GrLegacyMeshDrawOp> op =
+            SmallPathOp::Make(args.fPaint.getColor(), *args.fShape, *args.fViewMatrix, fAtlas.get(),
+                              &fShapeCache, &fShapeList, args.fGammaCorrect);
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
 
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
 
     return true;
 }
diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
index 4c2edf4..ea07644 100644
--- a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
@@ -112,7 +112,7 @@
         }
         const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
 
-        std::unique_ptr<GrMeshDrawOp> coverOp(GrRectOpFactory::MakeNonAAFill(
+        std::unique_ptr<GrLegacyMeshDrawOp> coverOp(GrRectOpFactory::MakeNonAAFill(
                 args.fPaint.getColor(), viewM, bounds, nullptr, &invert));
 
         // fake inverse with a stencil and cover
@@ -141,8 +141,8 @@
             GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), coverAAType);
             pipelineBuilder.setUserStencil(&kInvertedCoverPass);
 
-            args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip,
-                                                     std::move(coverOp));
+            args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip,
+                                                           std::move(coverOp));
         }
     } else {
         GrAA aa = GrBoolToAA(GrAATypeIsHW(args.fAAType));
diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp
index 9f3b1d6e..eda39c2 100644
--- a/src/gpu/ops/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp
@@ -103,8 +103,11 @@
 
 class DynamicVertexAllocator : public GrTessellator::VertexAllocator {
 public:
-    DynamicVertexAllocator(size_t stride, GrMeshDrawOp::Target* target)
-        : VertexAllocator(stride), fTarget(target), fVertexBuffer(nullptr), fVertices(nullptr) {}
+    DynamicVertexAllocator(size_t stride, GrLegacyMeshDrawOp::Target* target)
+            : VertexAllocator(stride)
+            , fTarget(target)
+            , fVertexBuffer(nullptr)
+            , fVertices(nullptr) {}
     void* lock(int vertexCount) override {
         fVertexCount = vertexCount;
         fVertices = fTarget->makeVertexSpace(stride(), vertexCount, &fVertexBuffer, &fFirstVertex);
@@ -117,7 +120,7 @@
     const GrBuffer* vertexBuffer() const { return fVertexBuffer; }
     int firstVertex() const { return fFirstVertex; }
 private:
-    GrMeshDrawOp::Target* fTarget;
+    GrLegacyMeshDrawOp::Target* fTarget;
     const GrBuffer* fVertexBuffer;
     int fVertexCount;
     int fFirstVertex;
@@ -156,16 +159,16 @@
     return true;
 }
 
-class TessellatingPathOp final : public GrMeshDrawOp {
+class TessellatingPathOp final : public GrLegacyMeshDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static std::unique_ptr<GrMeshDrawOp> Make(const GrColor& color,
-                                              const GrShape& shape,
-                                              const SkMatrix& viewMatrix,
-                                              SkIRect devClipBounds,
-                                              bool antiAlias) {
-        return std::unique_ptr<GrMeshDrawOp>(
+    static std::unique_ptr<GrLegacyMeshDrawOp> Make(const GrColor& color,
+                                                    const GrShape& shape,
+                                                    const SkMatrix& viewMatrix,
+                                                    SkIRect devClipBounds,
+                                                    bool antiAlias) {
+        return std::unique_ptr<GrLegacyMeshDrawOp>(
                 new TessellatingPathOp(color, shape, viewMatrix, devClipBounds, antiAlias));
     }
 
@@ -314,7 +317,7 @@
                                                               : kTriangles_GrPrimitiveType;
         GrMesh mesh;
         mesh.init(primitiveType, vb, firstVertex, count);
-        target->draw(gp, mesh);
+        target->draw(gp, this->pipeline(), mesh);
     }
 
     bool onCombineIfPossible(GrOp*, const GrCaps&) override { return false; }
@@ -348,7 +351,7 @@
     bool                    fCanTweakAlphaForCoverage;
     bool                    fNeedsLocalCoords;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -358,7 +361,7 @@
     args.fClip->getConservativeBounds(args.fRenderTargetContext->width(),
                                       args.fRenderTargetContext->height(),
                                       &clipBoundsI);
-    std::unique_ptr<GrMeshDrawOp> op =
+    std::unique_ptr<GrLegacyMeshDrawOp> op =
             TessellatingPathOp::Make(args.fPaint.getColor(),
                                      *args.fShape,
                                      *args.fViewMatrix,
@@ -366,7 +369,7 @@
                                      GrAAType::kCoverage == args.fAAType);
     GrPipelineBuilder pipelineBuilder(std::move(args.fPaint), args.fAAType);
     pipelineBuilder.setUserStencil(args.fUserStencilSettings);
-    args.fRenderTargetContext->addMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
+    args.fRenderTargetContext->addLegacyMeshDrawOp(pipelineBuilder, *args.fClip, std::move(op));
     return true;
 }
 
diff --git a/src/gpu/ops/GrTestMeshDrawOp.h b/src/gpu/ops/GrTestMeshDrawOp.h
index 5ca4af7..aad6774 100644
--- a/src/gpu/ops/GrTestMeshDrawOp.h
+++ b/src/gpu/ops/GrTestMeshDrawOp.h
@@ -14,10 +14,10 @@
 #include "ops/GrMeshDrawOp.h"
 
 /*
- * A simple solid color GrMeshDrawOp for testing purposes which doesn't ever combine. Subclassing
- * this in tests saves having to fill out some boiler plate methods.
+ * A simple solid color GrLegacyMeshDrawOp for testing purposes which doesn't ever combine.
+ * Subclassing this in tests saves having to fill out some boiler plate methods.
  */
-class GrTestMeshDrawOp : public GrMeshDrawOp {
+class GrTestMeshDrawOp : public GrLegacyMeshDrawOp {
 public:
     const char* name() const override = 0;
 
@@ -49,7 +49,7 @@
     GrColor fColor;
     bool fUsesLocalCoords = false;
 
-    typedef GrMeshDrawOp INHERITED;
+    typedef GrLegacyMeshDrawOp INHERITED;
 };
 
 #endif