Some more batch->op renaming

Change-Id: I5cbdc606170186d2d908d518af0e0fd1094fcf78
Reviewed-on: https://skia-review.googlesource.com/6089
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index a8f724e..12005fb 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -243,15 +243,15 @@
   "$_src/gpu/batches/GrAnalyticRectOp.h",
   "$_src/gpu/batches/GrAtlasTextBatch.cpp",
   "$_src/gpu/batches/GrAtlasTextBatch.h",
-  "$_src/gpu/batches/GrClearBatch.h",
-  "$_src/gpu/batches/GrClearStencilClipBatch.h",
-  "$_src/gpu/batches/GrCopySurfaceBatch.cpp",
-  "$_src/gpu/batches/GrCopySurfaceBatch.h",
+  "$_src/gpu/batches/GrClearOp.h",
+  "$_src/gpu/batches/GrClearStencilClipOp.h",
+  "$_src/gpu/batches/GrCopySurfaceOp.cpp",
+  "$_src/gpu/batches/GrCopySurfaceOp.h",
   "$_src/gpu/batches/GrDashLinePathRenderer.cpp",
   "$_src/gpu/batches/GrDashLinePathRenderer.h",
   "$_src/gpu/batches/GrDefaultPathRenderer.cpp",
   "$_src/gpu/batches/GrDefaultPathRenderer.h",
-  "$_src/gpu/batches/GrDiscardBatch.h",
+  "$_src/gpu/batches/GrDiscardOp.h",
   "$_src/gpu/batches/GrDrawAtlasBatch.cpp",
   "$_src/gpu/batches/GrDrawAtlasBatch.h",
   "$_src/gpu/batches/GrDrawOp.cpp",
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 78435d0..bcb4f88 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -21,7 +21,7 @@
 #include "SkConfig8888.h"
 #include "SkGrPriv.h"
 
-#include "batches/GrCopySurfaceBatch.h"
+#include "batches/GrCopySurfaceOp.h"
 #include "effects/GrConfigConversionEffect.h"
 #include "effects/GrGammaEffect.h"
 #include "text/GrTextBlobCache.h"
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 1c0832b..adf9ab1 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -19,7 +19,7 @@
 #include "GrResourceProvider.h"
 #include "SkSurfacePriv.h"
 
-#include "batches/GrClearBatch.h"
+#include "batches/GrClearOp.h"
 #include "batches/GrDrawAtlasBatch.h"
 #include "batches/GrDrawVerticesBatch.h"
 #include "batches/GrNinePatch.h"  // TODO Factory
@@ -276,7 +276,7 @@
         // This path doesn't handle coalescing of full screen clears b.c. it
         // has to clear the entire render target - not just the content area.
         // It could be done but will take more finagling.
-        sk_sp<GrOp> batch(GrClearBatch::Make(rtRect, color,
+        sk_sp<GrOp> batch(GrClearOp::Make(rtRect, color,
                                              fRenderTargetContext->accessRenderTarget(),
                                              !clearRect));
         if (!batch) {
@@ -333,7 +333,7 @@
         if (!this->accessRenderTarget()) {
             return;
         }
-        sk_sp<GrOp> op(GrClearBatch::Make(clip, color, this->accessRenderTarget()));
+        sk_sp<GrOp> op(GrClearOp::Make(clip, color, this->accessRenderTarget()));
         if (!op) {
             return;
         }
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index fafbd7c..2c7f6a3 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -27,10 +27,10 @@
 
 #include "SkStrokeRec.h"
 
-#include "batches/GrClearBatch.h"
-#include "batches/GrClearStencilClipBatch.h"
-#include "batches/GrCopySurfaceBatch.h"
-#include "batches/GrDiscardBatch.h"
+#include "batches/GrClearOp.h"
+#include "batches/GrClearStencilClipOp.h"
+#include "batches/GrCopySurfaceOp.h"
+#include "batches/GrDiscardOp.h"
 #include "batches/GrDrawOp.h"
 #include "batches/GrDrawPathBatch.h"
 #include "batches/GrRectOpFactory.h"
@@ -408,10 +408,10 @@
         fLastFullClearOp->setColor(color);
         return;
     }
-    sk_sp<GrClearBatch> op(GrClearBatch::Make(GrFixedClip::Disabled(), color, renderTarget));
+    sk_sp<GrClearOp> op(GrClearOp::Make(GrFixedClip::Disabled(), color, renderTarget));
     if (GrOp* clearOp = this->recordOp(std::move(op))) {
         // This is either the clear op we just created or another one that it combined with.
-        fLastFullClearOp = static_cast<GrClearBatch*>(clearOp);
+        fLastFullClearOp = static_cast<GrClearOp*>(clearOp);
     }
 }
 
@@ -419,7 +419,7 @@
     // Currently this just inserts a discard op. However, once in MDB this can remove all the
     // previously recorded ops and change the load op to discard.
     if (this->caps()->discardRenderTargetSupport()) {
-        this->recordOp(GrDiscardBatch::Make(renderTarget));
+        this->recordOp(GrDiscardOp::Make(renderTarget));
     }
 }
 
@@ -429,7 +429,7 @@
                                        GrSurface* src,
                                        const SkIRect& srcRect,
                                        const SkIPoint& dstPoint) {
-    sk_sp<GrOp> op = GrCopySurfaceBatch::Make(dst, src, srcRect, dstPoint);
+    sk_sp<GrOp> op = GrCopySurfaceOp::Make(dst, src, srcRect, dstPoint);
     if (!op) {
         return false;
     }
@@ -566,5 +566,5 @@
 void GrRenderTargetOpList::clearStencilClip(const GrFixedClip& clip,
                                             bool insideStencilMask,
                                             GrRenderTarget* rt) {
-    this->recordOp(GrClearStencilClipBatch::Make(clip, insideStencilMask, rt));
+    this->recordOp(GrClearStencilClipOp::Make(clip, insideStencilMask, rt));
 }
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index e961132..f65213d 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -28,7 +28,7 @@
 #include "SkTypes.h"
 
 class GrAuditTrail;
-class GrClearBatch;
+class GrClearOp;
 class GrClip;
 class GrCaps;
 class GrPath;
@@ -160,22 +160,22 @@
         sk_sp<GrOp> fOp;
         SkRect fClippedBounds;
     };
-    SkSTArray<256, RecordedOp, true>                fRecordedOps;
-    GrClearBatch*                                   fLastFullClearOp;
+    SkSTArray<256, RecordedOp, true> fRecordedOps;
+    GrClearOp* fLastFullClearOp;
     // The context is only in service of the GrClip, remove once it doesn't need this.
-    GrContext*                                      fContext;
-    GrGpu*                                          fGpu;
-    GrResourceProvider*                             fResourceProvider;
+    GrContext* fContext;
+    GrGpu* fGpu;
+    GrResourceProvider* fResourceProvider;
 
-    bool                                            fClipOpToBounds;
-    int                                             fMaxOpLookback;
-    int                                             fMaxOpLookahead;
+    bool fClipOpToBounds;
+    int fMaxOpLookback;
+    int fMaxOpLookahead;
 
     std::unique_ptr<gr_instanced::InstancedRendering> fInstancedRendering;
 
-    int32_t                                         fLastClipStackGenID;
-    SkIRect                                         fLastClipStackRect;
-    SkIPoint                                        fLastClipOrigin;
+    int32_t fLastClipStackGenID;
+    SkIRect fLastClipStackRect;
+    SkIPoint fLastClipOrigin;
 
     typedef GrOpList INHERITED;
 };
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index 47d2b70..454f498 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -11,7 +11,7 @@
 #include "GrGpu.h"
 #include "GrTextureProxy.h"
 
-#include "batches/GrCopySurfaceBatch.h"
+#include "batches/GrCopySurfaceOp.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -82,7 +82,7 @@
                                   GrSurface* src,
                                   const SkIRect& srcRect,
                                   const SkIPoint& dstPoint) {
-    sk_sp<GrOp> op = GrCopySurfaceBatch::Make(dst, src, srcRect, dstPoint);
+    sk_sp<GrOp> op = GrCopySurfaceOp::Make(dst, src, srcRect, dstPoint);
     if (!op) {
         return false;
     }
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearOp.h
similarity index 82%
rename from src/gpu/batches/GrClearBatch.h
rename to src/gpu/batches/GrClearOp.h
index f80605f..f2baefd 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearOp.h
@@ -5,8 +5,8 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrClearBatch_DEFINED
-#define GrClearBatch_DEFINED
+#ifndef GrClearOp_DEFINED
+#define GrClearOp_DEFINED
 
 #include "GrFixedClip.h"
 #include "GrGpu.h"
@@ -15,22 +15,21 @@
 #include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
-class GrClearBatch final : public GrOp {
+class GrClearOp final : public GrOp {
 public:
     DEFINE_OP_CLASS_ID
 
-    static sk_sp<GrClearBatch> Make(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) {
-        sk_sp<GrClearBatch> batch(new GrClearBatch(clip, color, rt));
-        if (!batch->fRenderTarget) {
+    static sk_sp<GrClearOp> Make(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) {
+        sk_sp<GrClearOp> op(new GrClearOp(clip, color, rt));
+        if (!op->fRenderTarget) {
             return nullptr; // The clip did not contain any pixels within the render target.
         }
-        return batch;
+        return op;
     }
 
-    static sk_sp<GrClearBatch> Make(const SkIRect& rect, GrColor color, GrRenderTarget* rt,
+    static sk_sp<GrClearOp> Make(const SkIRect& rect, GrColor color, GrRenderTarget* rt,
                                     bool fullScreen) {
-        sk_sp<GrClearBatch> batch(new GrClearBatch(rect, color, rt, fullScreen));
-        return batch;
+        return sk_sp<GrClearOp>(new GrClearOp(rect, color, rt, fullScreen));
     }
 
     const char* name() const override { return "Clear"; }
@@ -55,7 +54,7 @@
     void setColor(GrColor color) { fColor = color; }
 
 private:
-    GrClearBatch(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt)
+    GrClearOp(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt)
         : INHERITED(ClassID())
         , fClip(clip)
         , fColor(color) {
@@ -74,7 +73,7 @@
         fRenderTarget.reset(rt);
     }
 
-    GrClearBatch(const SkIRect& rect, GrColor color, GrRenderTarget* rt, bool fullScreen)
+    GrClearOp(const SkIRect& rect, GrColor color, GrRenderTarget* rt, bool fullScreen)
         : INHERITED(ClassID())
         , fClip(GrFixedClip(rect))
         , fColor(color)
@@ -89,7 +88,7 @@
         // This could be much more complicated. Currently we look at cases where the new clear
         // contains the old clear, or when the new clear is a subset of the old clear and is the
         // same color.
-        GrClearBatch* cb = t->cast<GrClearBatch>();
+        GrClearOp* cb = t->cast<GrClearOp>();
         SkASSERT(cb->fRenderTarget == fRenderTarget);
         if (!fClip.windowRectsState().cheapEqualTo(cb->fClip.windowRectsState())) {
             return false;
@@ -105,7 +104,7 @@
         return false;
     }
 
-    bool contains(const GrClearBatch* that) const {
+    bool contains(const GrClearOp* that) const {
         // The constructor ensures that scissor gets disabled on any clip that fills the entire RT.
         return !fClip.scissorEnabled() ||
                (that->fClip.scissorEnabled() &&
diff --git a/src/gpu/batches/GrClearStencilClipBatch.h b/src/gpu/batches/GrClearStencilClipOp.h
similarity index 69%
rename from src/gpu/batches/GrClearStencilClipBatch.h
rename to src/gpu/batches/GrClearStencilClipOp.h
index fa83c59..1d3b4b1 100644
--- a/src/gpu/batches/GrClearStencilClipBatch.h
+++ b/src/gpu/batches/GrClearStencilClipOp.h
@@ -5,8 +5,8 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrClearStencilClipBatch_DEFINED
-#define GrClearStencilClipBatch_DEFINED
+#ifndef GrClearStencilClipOp_DEFINED
+#define GrClearStencilClipOp_DEFINED
 
 #include "GrFixedClip.h"
 #include "GrGpu.h"
@@ -15,12 +15,12 @@
 #include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
-class GrClearStencilClipBatch final : public GrOp {
+class GrClearStencilClipOp final : public GrOp {
 public:
     DEFINE_OP_CLASS_ID
 
     static sk_sp<GrOp> Make(const GrFixedClip& clip, bool insideStencilMask, GrRenderTarget* rt) {
-        return sk_sp<GrOp>(new GrClearStencilClipBatch(clip, insideStencilMask, rt));
+        return sk_sp<GrOp>(new GrClearStencilClipOp(clip, insideStencilMask, rt));
     }
 
     const char* name() const override { return "ClearStencilClip"; }
@@ -37,17 +37,17 @@
             string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom);
         }
         string.appendf("], IC: %d, RT: %d", fInsideStencilMask,
-                                            fRenderTarget.get()->uniqueID().asUInt());
+                       fRenderTarget.get()->uniqueID().asUInt());
         string.append(INHERITED::dumpInfo());
         return string;
     }
 
 private:
-    GrClearStencilClipBatch(const GrFixedClip& clip, bool insideStencilMask, GrRenderTarget* rt)
-        : INHERITED(ClassID())
-        , fClip(clip)
-        , fInsideStencilMask(insideStencilMask)
-        , fRenderTarget(rt) {
+    GrClearStencilClipOp(const GrFixedClip& clip, bool insideStencilMask, GrRenderTarget* rt)
+            : INHERITED(ClassID())
+            , fClip(clip)
+            , fInsideStencilMask(insideStencilMask)
+            , fRenderTarget(rt) {
         const SkRect& bounds = fClip.scissorEnabled() ? SkRect::Make(fClip.scissorRect())
                                                       : SkRect::MakeIWH(rt->width(), rt->height());
         this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo);
@@ -61,9 +61,9 @@
         state->commandBuffer()->clearStencilClip(fRenderTarget.get(), fClip, fInsideStencilMask);
     }
 
-    const GrFixedClip                                       fClip;
-    const bool                                              fInsideStencilMask;
-    GrPendingIOResource<GrRenderTarget, kWrite_GrIOType>    fRenderTarget;
+    const GrFixedClip fClip;
+    const bool fInsideStencilMask;
+    GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
 
     typedef GrOp INHERITED;
 };
diff --git a/src/gpu/batches/GrCopySurfaceBatch.cpp b/src/gpu/batches/GrCopySurfaceOp.cpp
similarity index 75%
rename from src/gpu/batches/GrCopySurfaceBatch.cpp
rename to src/gpu/batches/GrCopySurfaceOp.cpp
index 0e9f0e6..3283517 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.cpp
+++ b/src/gpu/batches/GrCopySurfaceOp.cpp
@@ -5,16 +5,15 @@
  * found in the LICENSE file.
  */
 
-
-#include "GrCopySurfaceBatch.h"
+#include "GrCopySurfaceOp.h"
 
 // returns true if the read/written rect intersects the src/dst and false if not.
-bool GrCopySurfaceBatch::ClipSrcRectAndDstPoint(const GrSurface* dst,
-                                                const GrSurface* src,
-                                                const SkIRect& srcRect,
-                                                const SkIPoint& dstPoint,
-                                                SkIRect* clippedSrcRect,
-                                                SkIPoint* clippedDstPoint) {
+bool GrCopySurfaceOp::ClipSrcRectAndDstPoint(const GrSurface* dst,
+                                             const GrSurface* src,
+                                             const SkIRect& srcRect,
+                                             const SkIPoint& dstPoint,
+                                             SkIRect* clippedSrcRect,
+                                             SkIPoint* clippedDstPoint) {
     *clippedSrcRect = srcRect;
     *clippedDstPoint = dstPoint;
 
@@ -59,8 +58,8 @@
     return !clippedSrcRect->isEmpty();
 }
 
-sk_sp<GrOp> GrCopySurfaceBatch::Make(GrSurface* dst, GrSurface* src, const SkIRect& srcRect,
-                                     const SkIPoint& dstPoint) {
+sk_sp<GrOp> GrCopySurfaceOp::Make(GrSurface* dst, GrSurface* src, const SkIRect& srcRect,
+                                  const SkIPoint& dstPoint) {
     SkASSERT(dst);
     SkASSERT(src);
     if (GrPixelConfigIsSint(dst->config()) != GrPixelConfigIsSint(src->config())) {
@@ -75,5 +74,5 @@
     if (!ClipSrcRectAndDstPoint(dst, src, srcRect, dstPoint, &clippedSrcRect, &clippedDstPoint)) {
         return nullptr;
     }
-    return sk_sp<GrOp>(new GrCopySurfaceBatch(dst, src, clippedSrcRect, clippedDstPoint));
+    return sk_sp<GrOp>(new GrCopySurfaceOp(dst, src, clippedSrcRect, clippedDstPoint));
 }
diff --git a/src/gpu/batches/GrCopySurfaceBatch.h b/src/gpu/batches/GrCopySurfaceOp.h
similarity index 74%
rename from src/gpu/batches/GrCopySurfaceBatch.h
rename to src/gpu/batches/GrCopySurfaceOp.h
index bf91ce0..77b4009 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.h
+++ b/src/gpu/batches/GrCopySurfaceOp.h
@@ -5,15 +5,15 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrCopySurfaceBatch_DEFINED
-#define GrCopySurfaceBatch_DEFINED
+#ifndef GrCopySurfaceOp_DEFINED
+#define GrCopySurfaceOp_DEFINED
 
 #include "GrGpu.h"
 #include "GrOp.h"
 #include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
-class GrCopySurfaceBatch final : public GrOp {
+class GrCopySurfaceOp final : public GrOp {
 public:
     DEFINE_OP_CLASS_ID
 
@@ -42,22 +42,19 @@
 
     SkString dumpInfo() const override {
         SkString string;
-        string.printf("SRC: 0x%p, DST: 0x%p, SRECT: [L: %d, T: %d, R: %d, B: %d], "
-                      "DPT:[X: %d, Y: %d]",
-                      fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight,
-                      fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY);
+        string.printf(
+                "SRC: 0x%p, DST: 0x%p, SRECT: [L: %d, T: %d, R: %d, B: %d], "
+                "DPT:[X: %d, Y: %d]",
+                fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight,
+                fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY);
         string.append(INHERITED::dumpInfo());
         return string;
     }
 
 private:
-    GrCopySurfaceBatch(GrSurface* dst, GrSurface* src, const SkIRect& srcRect,
-                       const SkIPoint& dstPoint)
-        : INHERITED(ClassID())
-        , fDst(dst)
-        , fSrc(src)
-        , fSrcRect(srcRect)
-        , fDstPoint(dstPoint) {
+    GrCopySurfaceOp(GrSurface* dst, GrSurface* src, const SkIRect& srcRect,
+                    const SkIPoint& dstPoint)
+            : INHERITED(ClassID()), fDst(dst), fSrc(src), fSrcRect(srcRect), fDstPoint(dstPoint) {
         SkRect bounds =
                 SkRect::MakeXYWH(SkIntToScalar(dstPoint.fX), SkIntToScalar(dstPoint.fY),
                                  SkIntToScalar(srcRect.width()), SkIntToScalar(srcRect.height()));
@@ -79,9 +76,9 @@
     }
 
     GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst;
-    GrPendingIOResource<GrSurface, kRead_GrIOType>  fSrc;
-    SkIRect                                         fSrcRect;
-    SkIPoint                                        fDstPoint;
+    GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc;
+    SkIRect fSrcRect;
+    SkIPoint fDstPoint;
 
     typedef GrOp INHERITED;
 };
diff --git a/src/gpu/batches/GrDiscardBatch.h b/src/gpu/batches/GrDiscardOp.h
similarity index 85%
rename from src/gpu/batches/GrDiscardBatch.h
rename to src/gpu/batches/GrDiscardOp.h
index 53ac4d7..b978790 100644
--- a/src/gpu/batches/GrDiscardBatch.h
+++ b/src/gpu/batches/GrDiscardOp.h
@@ -5,18 +5,18 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrDiscardBatch_DEFINED
-#define GrDiscardBatch_DEFINED
+#ifndef GrDiscardOp_DEFINED
+#define GrDiscardOp_DEFINED
 
 #include "GrGpu.h"
 #include "GrOp.h"
 #include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
-class GrDiscardBatch final : public GrOp {
+class GrDiscardOp final : public GrOp {
 public:
     DEFINE_OP_CLASS_ID
-    static sk_sp<GrOp> Make(GrRenderTarget* rt) { return sk_sp<GrOp>(new GrDiscardBatch(rt)); }
+    static sk_sp<GrOp> Make(GrRenderTarget* rt) { return sk_sp<GrOp>(new GrDiscardOp(rt)); }
 
     const char* name() const override { return "Discard"; }
 
@@ -33,9 +33,7 @@
     }
 
 private:
-    GrDiscardBatch(GrRenderTarget* rt)
-        : INHERITED(ClassID())
-        , fRenderTarget(rt) {
+    GrDiscardOp(GrRenderTarget* rt) : INHERITED(ClassID()), fRenderTarget(rt) {
         this->setBounds(SkRect::MakeIWH(rt->width(), rt->height()), HasAABloat::kNo,
                         IsZeroArea::kNo);
     }