Rename GrBatchFlushState to GrOpFlushState

Change-Id: I1a8052c61d7624929caf45ba44e2a465cd0dc1c2
Reviewed-on: https://skia-review.googlesource.com/5649
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 e87ea7c..4df4461 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -75,8 +75,6 @@
   "$_src/gpu/GrAllocator.h",
   "$_src/gpu/GrBatchAtlas.cpp",
   "$_src/gpu/GrBatchAtlas.h",
-  "$_src/gpu/GrBatchFlushState.cpp",
-  "$_src/gpu/GrBatchFlushState.h",
   "$_src/gpu/GrBatchTest.cpp",
   "$_src/gpu/GrBatchTest.h",
   "$_src/gpu/GrBitmapTextureMaker.cpp",
@@ -119,6 +117,8 @@
   "$_src/gpu/GrMemoryPool.h",
   "$_src/gpu/GrMesh.h",
   "$_src/gpu/GrNonAtomicRef.h",
+  "$_src/gpu/GrOpFlushState.cpp",
+  "$_src/gpu/GrOpFlushState.h",
   "$_src/gpu/GrOpList.cpp",
   "$_src/gpu/GrOpList.h",
   "$_src/gpu/GrOvalRenderer.cpp",
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index 32e7b1c..9f0909a 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "GrBatchAtlas.h"
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 #include "GrRectanizer.h"
 #include "GrTracing.h"
 
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index 90a3064..9a05215 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -8,14 +8,13 @@
 #ifndef GrDrawingManager_DEFINED
 #define GrDrawingManager_DEFINED
 
-#include "text/GrAtlasTextContext.h"
-#include "GrBatchFlushState.h"
-#include "GrPathRendererChain.h"
+#include "GrOpFlushState.h"
 #include "GrPathRenderer.h"
+#include "GrPathRendererChain.h"
 #include "GrRenderTargetOpList.h"
 #include "GrResourceCache.h"
 #include "SkTDArray.h"
-
+#include "text/GrAtlasTextContext.h"
 
 class GrContext;
 class GrRenderTargetContext;
@@ -112,7 +111,7 @@
     GrPathRendererChain*              fPathRendererChain;
     GrSoftwarePathRenderer*           fSoftwarePathRenderer;
 
-    GrBatchFlushState                 fFlushState;
+    GrOpFlushState                    fFlushState;
     bool                              fFlushing;
 
     bool                              fIsImmediateMode;
diff --git a/src/gpu/GrGpuCommandBuffer.h b/src/gpu/GrGpuCommandBuffer.h
index 3bb0071..13b7334 100644
--- a/src/gpu/GrGpuCommandBuffer.h
+++ b/src/gpu/GrGpuCommandBuffer.h
@@ -11,7 +11,7 @@
 #include "GrColor.h"
 #include "batches/GrDrawOp.h"
 
-class GrBatchFlushState;
+class GrOpFlushState;
 class GrFixedClip;
 class GrGpu;
 class GrMesh;
@@ -73,7 +73,7 @@
               const SkRect& bounds);
 
     // Performs an upload of vertex data in the middle of a set of a set of draws
-    virtual void inlineUpload(GrBatchFlushState* state, GrDrawOp::DeferredUploadFn& upload) = 0;
+    virtual void inlineUpload(GrOpFlushState* state, GrDrawOp::DeferredUploadFn& upload) = 0;
 
     /**
      * Clear the passed in render target. Ignores the draw state and clip.
diff --git a/src/gpu/GrBatchFlushState.cpp b/src/gpu/GrOpFlushState.cpp
similarity index 75%
rename from src/gpu/GrBatchFlushState.cpp
rename to src/gpu/GrOpFlushState.cpp
index 5bc02bd..e936c45 100644
--- a/src/gpu/GrBatchFlushState.cpp
+++ b/src/gpu/GrOpFlushState.cpp
@@ -5,12 +5,12 @@
  * found in the LICENSE file.
  */
 
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 
 #include "GrBatchAtlas.h"
 #include "GrPipeline.h"
 
-GrBatchFlushState::GrBatchFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider)
+GrOpFlushState::GrOpFlushState(GrGpu* gpu, GrResourceProvider* resourceProvider)
     : fGpu(gpu)
     , fResourceProvider(resourceProvider)
     , fCommandBuffer(nullptr)
@@ -19,12 +19,12 @@
     , fLastIssuedToken(GrDrawOpUploadToken::AlreadyFlushedToken())
     , fLastFlushedToken(0) {}
 
-void* GrBatchFlushState::makeVertexSpace(size_t vertexSize, int vertexCount,
+void* GrOpFlushState::makeVertexSpace(size_t vertexSize, int vertexCount,
                                          const GrBuffer** buffer, int* startVertex) {
     return fVertexPool.makeSpace(vertexSize, vertexCount, buffer, startVertex);
 }
 
-uint16_t* GrBatchFlushState::makeIndexSpace(int indexCount,
+uint16_t* GrOpFlushState::makeIndexSpace(int indexCount,
                                             const GrBuffer** buffer, int* startIndex) {
     return reinterpret_cast<uint16_t*>(fIndexPool.makeSpace(indexCount, buffer, startIndex));
 }
diff --git a/src/gpu/GrBatchFlushState.h b/src/gpu/GrOpFlushState.h
similarity index 79%
rename from src/gpu/GrBatchFlushState.h
rename to src/gpu/GrOpFlushState.h
index e449140..9b8baff 100644
--- a/src/gpu/GrBatchFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -15,15 +15,15 @@
 class GrGpuCommandBuffer;
 class GrResourceProvider;
 
-/** Tracks the state across all the GrBatches in a GrOpList flush. */
-class GrBatchFlushState {
+/** Tracks the state across all the GrOps (really just the GrDrawOps) in a GrOpList flush. */
+class GrOpFlushState {
 public:
-    GrBatchFlushState(GrGpu*, GrResourceProvider*);
+    GrOpFlushState(GrGpu*, GrResourceProvider*);
 
-    ~GrBatchFlushState() { this->reset(); }
+    ~GrOpFlushState() { this->reset(); }
 
-    /** Inserts an upload to be executed after all batches in the flush prepared their draws
-        but before the draws are executed to the backend 3D API. */
+    /** Inserts an upload to be executed after all ops in the flush prepared their draws but before
+        the draws are executed to the backend 3D API. */
     void addASAPUpload(GrDrawOp::DeferredUploadFn&& upload) {
         fAsapUploads.emplace_back(std::move(upload));
     }
@@ -58,8 +58,8 @@
                           const GrBuffer** buffer, int* startVertex);
     uint16_t* makeIndexSpace(int indexCount, const GrBuffer** buffer, int* startIndex);
 
-    /** This is called after each batch has a chance to prepare its draws and before the draws
-        are issued. */
+    /** This is called after each op has a chance to prepare its draws and before the draws are
+        issued. */
     void preIssueDraws() {
         fVertexPool.unmap();
         fIndexPool.unmap();
@@ -115,20 +115,20 @@
 };
 
 /**
- * A word about uploads and tokens: Batches should usually schedule their uploads to occur at the
+ * A word about uploads and tokens: Ops should usually schedule their uploads to occur at the
  * begining of a frame whenever possible. These are called ASAP uploads. Of course, this requires
  * that there are no draws that have yet to be flushed that rely on the old texture contents. In
  * that case the ASAP upload would happen prior to the previous draw causing the draw to read the
  * new (wrong) texture data. In that case they should schedule an inline upload.
  *
- * Batches, in conjunction with helpers such as GrBatchAtlas, can use the token system to know
+ * Ops, in conjunction with helpers such as GrBatchAtlas, can use the token system to know
  * what the most recent draw was that referenced a resource (or portion of a resource). Each draw
  * is assigned a token. A resource (or portion) can be tagged with the most recent draw's
  * token. The target provides a facility for testing whether the draw corresponding to the token
- * has been flushed. If it has not been flushed then the batch must perform an inline upload
- * instead. When scheduling an inline upload the batch provides the token of the draw that the
- * upload must occur before. The upload will then occur between the draw that requires the new
- * data but after the token that requires the old data.
+ * has been flushed. If it has not been flushed then the op must perform an inline upload instead.
+ * When scheduling an inline upload the op provides the token of the draw that the upload must occur
+ * before. The upload will then occur between the draw that requires the new data but after the
+ * token that requires the old data.
  *
  * TODO: Currently the token/upload interface is spread over GrDrawOp, GrMeshDrawOp,
  * GrDrawOp::Target, and GrMeshDrawOp::Target. However, the interface at the GrDrawOp level is not
@@ -138,16 +138,16 @@
 
 /**
  * GrDrawOp instances use this object to allocate space for their geometry and to issue the draws
- * that render their batch.
+ * that render their op.
  */
 class GrDrawOp::Target {
 public:
-    Target(GrBatchFlushState* state, GrDrawOp* batch) : fState(state), fBatch(batch) {}
+    Target(GrOpFlushState* state, GrDrawOp* op) : fState(state), fOp(op) {}
 
     /** Returns the token of the draw that this upload will occur before. */
     GrDrawOpUploadToken addInlineUpload(DeferredUploadFn&& upload) {
-        fBatch->fInlineUploads.emplace_back(std::move(upload), fState->nextDrawToken());
-        return fBatch->fInlineUploads.back().fUploadBeforeToken;
+        fOp->fInlineUploads.emplace_back(std::move(upload), fState->nextDrawToken());
+        return fOp->fInlineUploads.back().fUploadBeforeToken;
     }
 
     /** Returns the token of the draw that this upload will occur before. Since ASAP uploads
@@ -162,7 +162,7 @@
         return fState->hasDrawBeenFlushed(token);
     }
 
-    /** Gets the next draw token that will be issued by this target. This can be used by a batch
+    /** Gets the next draw token that will be issued by this target. This can be used by an op
         to record that the next draw it issues will use a resource (e.g. texture) while preparing
         that draw. */
     GrDrawOpUploadToken nextDrawToken() const { return fState->nextDrawToken(); }
@@ -172,19 +172,19 @@
     GrResourceProvider* resourceProvider() const { return fState->resourceProvider(); }
 
 protected:
-    GrDrawOp* batch() { return fBatch; }
-    GrBatchFlushState* state() { return fState; }
+    GrDrawOp* op() { return fOp; }
+    GrOpFlushState* state() { return fState; }
 
 private:
-    GrBatchFlushState*  fState;
-    GrDrawOp*           fBatch;
+    GrOpFlushState* fState;
+    GrDrawOp* fOp;
 };
 
 /** Extension of GrDrawOp::Target for use by GrMeshDrawOp. Adds the ability to create vertex
     draws. */
 class GrMeshDrawOp::Target : public GrDrawOp::Target {
 public:
-    Target(GrBatchFlushState* state, GrMeshDrawOp* batch) : INHERITED(state, batch) {}
+    Target(GrOpFlushState* state, GrMeshDrawOp* op) : INHERITED(state, op) {}
 
     void draw(const GrGeometryProcessor* gp, const GrMesh& mesh);
 
@@ -197,14 +197,14 @@
         return this->state()->makeIndexSpace(indexCount, buffer, startIndex);
     }
 
-    /** Helpers for batches which over-allocate and then return data to the pool. */
+    /** Helpers for ops which over-allocate and then return data to the pool. */
     void putBackIndices(int indices) { this->state()->putBackIndices(indices); }
     void putBackVertices(int vertices, size_t vertexStride) {
         this->state()->putBackVertexSpace(vertices * vertexStride);
     }
 
 private:
-    GrMeshDrawOp* vertexBatch() { return static_cast<GrMeshDrawOp*>(this->batch()); }
+    GrMeshDrawOp* meshDrawOp() { return static_cast<GrMeshDrawOp*>(this->op()); }
     typedef GrDrawOp::Target INHERITED;
 };
 
diff --git a/src/gpu/GrOpList.h b/src/gpu/GrOpList.h
index 873cdcb..75fc5e6 100644
--- a/src/gpu/GrOpList.h
+++ b/src/gpu/GrOpList.h
@@ -14,7 +14,7 @@
 //#define ENABLE_MDB 1
 
 class GrAuditTrail;
-class GrBatchFlushState;
+class GrOpFlushState;
 class GrRenderTargetOpList;
 class GrSurface;
 class GrSurfaceProxy;
@@ -26,8 +26,8 @@
     ~GrOpList() override;
 
     // These two methods are invoked as flush time
-    virtual void prepareOps(GrBatchFlushState* flushState) = 0;
-    virtual bool executeOps(GrBatchFlushState* flushState) = 0;
+    virtual void prepareOps(GrOpFlushState* flushState) = 0;
+    virtual bool executeOps(GrOpFlushState* flushState) = 0;
 
     virtual void makeClosed() {
         // We only close GrOpLists when MDB is enabled. When MDB is disabled there is only
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 735b92f..9adfb0c 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -7,10 +7,10 @@
 
 #include "GrOvalRenderer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrGeometryProcessor.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrProcessor.h"
 #include "GrResourceProvider.h"
 #include "GrShaderCaps.h"
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 226bfed..41c0d4f 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -151,7 +151,7 @@
     dstTexture->setOffset(copyRect.fLeft, copyRect.fTop);
 }
 
-void GrRenderTargetOpList::prepareOps(GrBatchFlushState* flushState) {
+void GrRenderTargetOpList::prepareOps(GrOpFlushState* flushState) {
     // Semi-usually the GrOpLists are already closed at this point, but sometimes Ganesh
     // needs to flush mid-draw. In that case, the SkGpuDevice's GrOpLists won't be closed
     // but need to be flushed anyway. Closing such GrOpLists here will mean new
@@ -173,7 +173,7 @@
 // TODO: this is where GrOp::renderTarget is used (which is fine since it
 // is at flush time). However, we need to store the RenderTargetProxy in the
 // Ops and instantiate them here.
-bool GrRenderTargetOpList::executeOps(GrBatchFlushState* flushState) {
+bool GrRenderTargetOpList::executeOps(GrOpFlushState* flushState) {
     if (0 == fRecordedOps.count()) {
         return false;
     }
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 5029b4b..d7f8ba1 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -74,8 +74,8 @@
      * Together these two functions flush all queued up draws to GrCommandBuffer. The return value
      * of executeOps() indicates whether any commands were actually issued to the GPU.
      */
-    void prepareOps(GrBatchFlushState* flushState) override;
-    bool executeOps(GrBatchFlushState* flushState) override;
+    void prepareOps(GrOpFlushState* flushState) override;
+    bool executeOps(GrOpFlushState* flushState) override;
 
     /**
      * Gets the capabilities of the draw target.
diff --git a/src/gpu/GrTextureContext.cpp b/src/gpu/GrTextureContext.cpp
index 66030f9..22620fe 100644
--- a/src/gpu/GrTextureContext.cpp
+++ b/src/gpu/GrTextureContext.cpp
@@ -73,7 +73,7 @@
     bool result = opList->copySurface(tex.get(), src, srcRect, dstPoint);
 
 #ifndef ENABLE_MDB
-    GrBatchFlushState flushState(fContext->getGpu(), nullptr);
+    GrOpFlushState flushState(fContext->getGpu(), nullptr);
     opList->prepareOps(&flushState);
     opList->executeOps(&flushState);
     opList->reset();
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index e9021da..1013643 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -44,7 +44,7 @@
 }
 #endif
 
-void GrTextureOpList::prepareOps(GrBatchFlushState* flushState) {
+void GrTextureOpList::prepareOps(GrOpFlushState* flushState) {
     // Semi-usually the GrOpLists are already closed at this point, but sometimes Ganesh
     // needs to flush mid-draw. In that case, the SkGpuDevice's GrOpLists won't be closed
     // but need to be flushed anyway. Closing such GrOpLists here will mean new
@@ -59,7 +59,7 @@
     }
 }
 
-bool GrTextureOpList::executeOps(GrBatchFlushState* flushState) {
+bool GrTextureOpList::executeOps(GrOpFlushState* flushState) {
     if (0 == fRecordedOps.count()) {
         return false;
     }
diff --git a/src/gpu/GrTextureOpList.h b/src/gpu/GrTextureOpList.h
index 0b28421..10ebd1b 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -37,8 +37,8 @@
      * Together these two functions flush all queued up draws to GrCommandBuffer. The return value
      * of drawOps() indicates whether any commands were actually issued to the GPU.
      */
-    void prepareOps(GrBatchFlushState* flushState) override;
-    bool executeOps(GrBatchFlushState* flushState) override;
+    void prepareOps(GrOpFlushState* flushState) override;
+    bool executeOps(GrOpFlushState* flushState) override;
 
     /**
      * Copies a pixel rectangle from one surface to another. This call may finalize
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index 7de67f6..56a5e7a 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -8,13 +8,13 @@
 #include "GrAAConvexPathRenderer.h"
 
 #include "GrAAConvexTessellator.h"
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrCaps.h"
 #include "GrContext.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrGeometryProcessor.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
 #include "GrProcessor.h"
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index 8f7c679..0aa451d 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -7,10 +7,10 @@
 
 #include "GrAADistanceFieldPathRenderer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrBuffer.h"
 #include "GrContext.h"
+#include "GrOpFlushState.h"
 #include "GrPipelineBuilder.h"
 #include "GrResourceProvider.h"
 #include "GrSWMaskHelper.h"
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 826c7fd..01392d0 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -7,10 +7,10 @@
 
 #include "GrAAFillRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrColor.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "GrResourceKey.h"
 #include "GrResourceProvider.h"
 #include "GrTypes.h"
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 8ff4231..70d0d4c 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -7,12 +7,12 @@
 
 #include "GrAAHairLinePathRenderer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrBuffer.h"
 #include "GrCaps.h"
 #include "GrContext.h"
 #include "GrDefaultGeoProcFactory.h"
+#include "GrOpFlushState.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
 #include "GrProcessor.h"
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index f959df6..f961c5e 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -8,12 +8,12 @@
 #include "GrAALinearizingConvexPathRenderer.h"
 
 #include "GrAAConvexTessellator.h"
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrContext.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrGeometryProcessor.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
 #include "GrProcessor.h"
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index fcdb7c0..008faa0 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -7,8 +7,8 @@
 
 #include "GrAAStrokeRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrDefaultGeoProcFactory.h"
+#include "GrOpFlushState.h"
 #include "GrResourceKey.h"
 #include "GrResourceProvider.h"
 
diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp
index ff68000..e87319c 100644
--- a/src/gpu/batches/GrAnalyticRectBatch.cpp
+++ b/src/gpu/batches/GrAnalyticRectBatch.cpp
@@ -7,10 +7,10 @@
 
 #include "GrAnalyticRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrGeometryProcessor.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrProcessor.h"
 #include "GrResourceProvider.h"
 #include "SkRRect.h"
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 75bbfca..1b45095 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -7,7 +7,7 @@
 
 #include "GrAtlasTextBatch.h"
 
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
 
 #include "SkGlyphCache.h"
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h
index f187048..2571c26 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearBatch.h
@@ -8,11 +8,11 @@
 #ifndef GrClearBatch_DEFINED
 #define GrClearBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrFixedClip.h"
 #include "GrGpu.h"
 #include "GrGpuCommandBuffer.h"
 #include "GrOp.h"
+#include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
 class GrClearBatch final : public GrOp {
@@ -95,9 +95,9 @@
                 fClip.scissorRect().contains(that->fClip.scissorRect()));
     }
 
-    void onPrepare(GrBatchFlushState*) override {}
+    void onPrepare(GrOpFlushState*) override {}
 
-    void onDraw(GrBatchFlushState* state, const SkRect& /*bounds*/) override {
+    void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override {
         state->commandBuffer()->clear(fRenderTarget.get(), fClip, fColor);
     }
 
diff --git a/src/gpu/batches/GrClearStencilClipBatch.h b/src/gpu/batches/GrClearStencilClipBatch.h
index 87c12f0..f9843ce 100644
--- a/src/gpu/batches/GrClearStencilClipBatch.h
+++ b/src/gpu/batches/GrClearStencilClipBatch.h
@@ -8,11 +8,11 @@
 #ifndef GrClearStencilClipBatch_DEFINED
 #define GrClearStencilClipBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrFixedClip.h"
 #include "GrGpu.h"
 #include "GrGpuCommandBuffer.h"
 #include "GrOp.h"
+#include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
 class GrClearStencilClipBatch final : public GrOp {
@@ -51,9 +51,9 @@
 private:
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override { return false; }
 
-    void onPrepare(GrBatchFlushState*) override {}
+    void onPrepare(GrOpFlushState*) override {}
 
-    void onDraw(GrBatchFlushState* state, const SkRect& /*bounds*/) override {
+    void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override {
         state->commandBuffer()->clearStencilClip(fRenderTarget.get(), fClip, fInsideStencilMask);
     }
 
diff --git a/src/gpu/batches/GrCopySurfaceBatch.h b/src/gpu/batches/GrCopySurfaceBatch.h
index a808b2f..b28b383 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.h
+++ b/src/gpu/batches/GrCopySurfaceBatch.h
@@ -8,9 +8,9 @@
 #ifndef GrCopySurfaceBatch_DEFINED
 #define GrCopySurfaceBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrGpu.h"
 #include "GrOp.h"
+#include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
 class GrCopySurfaceBatch final : public GrOp {
@@ -66,9 +66,9 @@
 
     bool onCombineIfPossible(GrOp* that, const GrCaps& caps) override { return false; }
 
-    void onPrepare(GrBatchFlushState*) override {}
+    void onPrepare(GrOpFlushState*) override {}
 
-    void onDraw(GrBatchFlushState* state, const SkRect& /*bounds*/) override {
+    void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override {
         if (!state->commandBuffer()) {
             state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint);
         } else {
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index ce51cf0..f3f9e73 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -7,12 +7,12 @@
 
 #include "GrDefaultPathRenderer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrContext.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrFixedClip.h"
 #include "GrMesh.h"
+#include "GrOpFlushState.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
 #include "SkGeometry.h"
diff --git a/src/gpu/batches/GrDiscardBatch.h b/src/gpu/batches/GrDiscardBatch.h
index a53feff..4192390 100644
--- a/src/gpu/batches/GrDiscardBatch.h
+++ b/src/gpu/batches/GrDiscardBatch.h
@@ -8,9 +8,9 @@
 #ifndef GrDiscardBatch_DEFINED
 #define GrDiscardBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrGpu.h"
 #include "GrOp.h"
+#include "GrOpFlushState.h"
 #include "GrRenderTarget.h"
 
 class GrDiscardBatch final : public GrOp {
@@ -43,9 +43,9 @@
         return this->renderTargetUniqueID() == that->renderTargetUniqueID();
     }
 
-    void onPrepare(GrBatchFlushState*) override {}
+    void onPrepare(GrOpFlushState*) override {}
 
-    void onDraw(GrBatchFlushState* state, const SkRect& /*bounds*/) override {
+    void onDraw(GrOpFlushState* state, const SkRect& /*bounds*/) override {
         state->commandBuffer()->discard(fRenderTarget.get());
     }
 
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp
index 95c8f2c..f94dc97 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.cpp
+++ b/src/gpu/batches/GrDrawAtlasBatch.cpp
@@ -6,11 +6,11 @@
  */
 
 #include "GrDrawAtlasBatch.h"
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
+#include "GrOpFlushState.h"
 #include "SkGr.h"
-#include "SkRandom.h"
 #include "SkRSXform.h"
+#include "SkRandom.h"
 
 void GrDrawAtlasBatch::initBatchTracker(const GrXPOverridesForBatch& overrides) {
     SkASSERT(fGeoData.count() == 1);
diff --git a/src/gpu/batches/GrDrawOp.h b/src/gpu/batches/GrDrawOp.h
index 8ad22d9..7606b0c 100644
--- a/src/gpu/batches/GrDrawOp.h
+++ b/src/gpu/batches/GrDrawOp.h
@@ -37,7 +37,7 @@
 private:
     GrDrawOpUploadToken();
     explicit GrDrawOpUploadToken(uint64_t sequenceNumber) : fSequenceNumber(sequenceNumber) {}
-    friend class GrBatchFlushState;
+    friend class GrOpFlushState;
     uint64_t fSequenceNumber;
 };
 
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index 8d0bc42..264078c 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -13,7 +13,7 @@
                                            GrPathRendering::PathTransformType type, int count,
                                            SkScalar x, SkScalar y, float* dst);
 
-void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) {
+void GrDrawPathBatchBase::onPrepare(GrOpFlushState*) {
     const GrRenderTargetPriv& rtPriv = this->pipeline()->getRenderTarget()->renderTargetPriv();
     fStencilPassSettings.reset(GrPathRendering::GetStencilPassSettings(fFillType),
                                this->pipeline()->hasStencilClip(), rtPriv.numStencilBits());
@@ -27,7 +27,7 @@
     return string;
 }
 
-void GrDrawPathBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
+void GrDrawPathBatch::onDraw(GrOpFlushState* state, const SkRect& bounds) {
     GrProgramDesc  desc;
 
     sk_sp<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
@@ -118,7 +118,7 @@
     return true;
 }
 
-void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
+void GrDrawPathRangeBatch::onDraw(GrOpFlushState* state, const SkRect& bounds) {
     const Draw& head = *fDraws.head();
 
     SkMatrix drawMatrix(this->viewMatrix());
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index 6dca9dc..c6bb55e 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -8,12 +8,12 @@
 #ifndef GrDrawPathBatch_DEFINED
 #define GrDrawPathBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrDrawOp.h"
 #include "GrGpu.h"
+#include "GrOpFlushState.h"
 #include "GrPath.h"
-#include "GrPathRendering.h"
 #include "GrPathProcessor.h"
+#include "GrPathRendering.h"
 #include "GrStencilSettings.h"
 
 #include "SkTLList.h"
@@ -50,7 +50,7 @@
         fOverrides = overrides;
     }
 
-    void onPrepare(GrBatchFlushState*) override; // Initializes fStencilPassSettings.
+    void onPrepare(GrOpFlushState*) override;  // Initializes fStencilPassSettings.
 
     SkMatrix                                                fViewMatrix;
     GrColor                                                 fColor;
@@ -82,7 +82,7 @@
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override { return false; }
 
-    void onDraw(GrBatchFlushState* state, const SkRect& bounds) override;
+    void onDraw(GrOpFlushState* state, const SkRect& bounds) override;
 
     GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
 
@@ -175,7 +175,7 @@
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override;
 
-    void onDraw(GrBatchFlushState* state, const SkRect& bounds) override;
+    void onDraw(GrOpFlushState* state, const SkRect& bounds) override;
 
     struct Draw {
         void set(const InstanceData* instanceData, SkScalar x, SkScalar y) {
diff --git a/src/gpu/batches/GrDrawVerticesBatch.cpp b/src/gpu/batches/GrDrawVerticesBatch.cpp
index 1d02320..3cc69cb 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.cpp
+++ b/src/gpu/batches/GrDrawVerticesBatch.cpp
@@ -7,9 +7,9 @@
 
 #include "GrDrawVerticesBatch.h"
 
-#include "GrBatchFlushState.h"
-#include "GrInvariantOutput.h"
 #include "GrDefaultGeoProcFactory.h"
+#include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 
 static sk_sp<GrGeometryProcessor> set_vertex_attributes(bool hasLocalCoords,
                                                         int* colorOffset,
diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h
index 26f23b5..4a38707 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.h
+++ b/src/gpu/batches/GrDrawVerticesBatch.h
@@ -15,7 +15,7 @@
 #include "SkRect.h"
 #include "SkTDArray.h"
 
-class GrBatchFlushState;
+class GrOpFlushState;
 struct GrInitInvariantOutput;
 
 class GrDrawVerticesBatch : public GrMeshDrawOp {
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 6b96349..f073db0 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -8,11 +8,11 @@
 #include "GrMSAAPathRenderer.h"
 
 #include "GrAuditTrail.h"
-#include "GrBatchFlushState.h"
 #include "GrClip.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrFixedClip.h"
 #include "GrMesh.h"
+#include "GrOpFlushState.h"
 #include "GrPathStencilSettings.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
diff --git a/src/gpu/batches/GrMeshDrawOp.cpp b/src/gpu/batches/GrMeshDrawOp.cpp
index 4f6b939..5f132ee 100644
--- a/src/gpu/batches/GrMeshDrawOp.cpp
+++ b/src/gpu/batches/GrMeshDrawOp.cpp
@@ -6,13 +6,13 @@
  */
 
 #include "GrMeshDrawOp.h"
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
 
 GrMeshDrawOp::GrMeshDrawOp(uint32_t classID)
     : INHERITED(classID), fBaseDrawToken(GrDrawOpUploadToken::AlreadyFlushedToken()) {}
 
-void GrMeshDrawOp::onPrepare(GrBatchFlushState* state) {
+void GrMeshDrawOp::onPrepare(GrOpFlushState* state) {
     Target target(state, this);
     this->onPrepareDraws(&target);
 }
@@ -59,7 +59,7 @@
                                  quadsToDraw);
 }
 
-void GrMeshDrawOp::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
+void GrMeshDrawOp::onDraw(GrOpFlushState* state, const SkRect& bounds) {
     int currUploadIdx = 0;
     int currMeshIdx = 0;
 
@@ -86,24 +86,24 @@
 //////////////////////////////////////////////////////////////////////////////
 
 void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrMesh& mesh) {
-    GrMeshDrawOp* batch = this->vertexBatch();
-    batch->fMeshes.push_back(mesh);
-    if (!batch->fQueuedDraws.empty()) {
+    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 = this->vertexBatch()->fQueuedDraws.back();
+        GrMeshDrawOp::QueuedDraw& lastDraw = op->fQueuedDraws.back();
         if (lastDraw.fGeometryProcessor == gp &&
-            (batch->fInlineUploads.empty() ||
-             batch->fInlineUploads.back().fUploadBeforeToken != this->nextDrawToken())) {
+            (op->fInlineUploads.empty() ||
+             op->fInlineUploads.back().fUploadBeforeToken != this->nextDrawToken())) {
             ++lastDraw.fMeshCnt;
             return;
         }
     }
-    GrMeshDrawOp::QueuedDraw& draw = this->vertexBatch()->fQueuedDraws.push_back();
+    GrMeshDrawOp::QueuedDraw& draw = op->fQueuedDraws.push_back();
     GrDrawOpUploadToken token = this->state()->issueDrawToken();
     draw.fGeometryProcessor.reset(gp);
     draw.fMeshCnt = 1;
-    if (batch->fQueuedDraws.count() == 1) {
-        batch->fBaseDrawToken = token;
+    if (op->fQueuedDraws.count() == 1) {
+        op->fBaseDrawToken = token;
     }
 }
diff --git a/src/gpu/batches/GrMeshDrawOp.h b/src/gpu/batches/GrMeshDrawOp.h
index b0292ae..6100166 100644
--- a/src/gpu/batches/GrMeshDrawOp.h
+++ b/src/gpu/batches/GrMeshDrawOp.h
@@ -15,7 +15,7 @@
 
 #include "SkTLList.h"
 
-class GrBatchFlushState;
+class GrOpFlushState;
 
 /**
  * Base class for mesh-drawing GrDrawOps.
@@ -63,8 +63,8 @@
     };
 
 private:
-    void onPrepare(GrBatchFlushState* state) final;
-    void onDraw(GrBatchFlushState* state, const SkRect& bounds) final;
+    void onPrepare(GrOpFlushState* state) final;
+    void onDraw(GrOpFlushState* state, const SkRect& bounds) final;
 
     virtual void onPrepareDraws(Target*) const = 0;
 
diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp
index a99a073..21a4185 100644
--- a/src/gpu/batches/GrNinePatch.cpp
+++ b/src/gpu/batches/GrNinePatch.cpp
@@ -7,9 +7,9 @@
 
 #include "GrNinePatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
 #include "SkBitmap.h"
 #include "SkLatticeIter.h"
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp
index 175b556..abebe62 100644
--- a/src/gpu/batches/GrNonAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp
@@ -7,10 +7,10 @@
 
 #include "GrNonAAFillRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrColor.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "GrPrimitiveProcessor.h"
 #include "GrQuad.h"
 #include "GrResourceProvider.h"
diff --git a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
index 8698e8f..9bcab05 100644
--- a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
@@ -7,10 +7,10 @@
 
 #include "GrNonAAFillRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrColor.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "GrPrimitiveProcessor.h"
 #include "GrQuad.h"
 #include "GrResourceProvider.h"
diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
index 4649edf..f5493c6 100644
--- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
@@ -7,11 +7,11 @@
 
 #include "GrNonAAStrokeRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrColor.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "SkRandom.h"
 
 /*  create a triangle strip that strokes the specified rect. There are 8
diff --git a/src/gpu/batches/GrOp.h b/src/gpu/batches/GrOp.h
index 79fbfa4..827e58e 100644
--- a/src/gpu/batches/GrOp.h
+++ b/src/gpu/batches/GrOp.h
@@ -19,7 +19,7 @@
 
 class GrCaps;
 class GrGpuCommandBuffer;
-class GrBatchFlushState;
+class GrOpFlushState;
 
 /**
  * GrOp is the base class for all Ganesh deferred GPU operations. To facilitate reorderable
@@ -121,10 +121,10 @@
 
     /** Called prior to drawing. The op should perform any resource creation necessary to
         to quickly issue its draw when draw is called. */
-    void prepare(GrBatchFlushState* state) { this->onPrepare(state); }
+    void prepare(GrOpFlushState* state) { this->onPrepare(state); }
 
     /** Issues the op's commands to GrGpu. */
-    void draw(GrBatchFlushState* state, const SkRect& bounds) { this->onDraw(state, bounds); }
+    void draw(GrOpFlushState* state, const SkRect& bounds) { this->onDraw(state, bounds); }
 
     /** Used to block batching across render target changes. Remove this once we store
         GrOps for different RTs in different targets. */
@@ -187,8 +187,8 @@
 private:
     virtual bool onCombineIfPossible(GrOp*, const GrCaps& caps) = 0;
 
-    virtual void onPrepare(GrBatchFlushState*) = 0;
-    virtual void onDraw(GrBatchFlushState*, const SkRect& bounds) = 0;
+    virtual void onPrepare(GrOpFlushState*) = 0;
+    virtual void onDraw(GrOpFlushState*, const SkRect& bounds) = 0;
 
     static uint32_t GenID(int32_t* idCounter) {
         // The atomic inc returns the old value not the incremented value. So we add
diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp
index bdc1024..6dd2199 100644
--- a/src/gpu/batches/GrPLSPathRenderer.cpp
+++ b/src/gpu/batches/GrPLSPathRenderer.cpp
@@ -7,12 +7,12 @@
 
 #include "GrPLSPathRenderer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrCaps.h"
 #include "GrContext.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrPLSGeometryProcessor.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
diff --git a/src/gpu/batches/GrRegionBatch.cpp b/src/gpu/batches/GrRegionBatch.cpp
index 5f9877e..72be6c8 100644
--- a/src/gpu/batches/GrRegionBatch.cpp
+++ b/src/gpu/batches/GrRegionBatch.cpp
@@ -7,9 +7,9 @@
 
 #include "GrRegionBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMeshDrawOp.h"
+#include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
 #include "SkMatrixPriv.h"
 #include "SkRegion.h"
diff --git a/src/gpu/batches/GrShadowRRectBatch.cpp b/src/gpu/batches/GrShadowRRectBatch.cpp
index 84e2a15..b299787 100755
--- a/src/gpu/batches/GrShadowRRectBatch.cpp
+++ b/src/gpu/batches/GrShadowRRectBatch.cpp
@@ -7,8 +7,8 @@
 
 #include "GrShadowRRectBatch.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
+#include "GrOpFlushState.h"
 #include "GrResourceProvider.h"
 #include "GrStyle.h"
 
diff --git a/src/gpu/batches/GrStencilPathBatch.h b/src/gpu/batches/GrStencilPathBatch.h
index 293da12..0e7936a 100644
--- a/src/gpu/batches/GrStencilPathBatch.h
+++ b/src/gpu/batches/GrStencilPathBatch.h
@@ -8,9 +8,9 @@
 #ifndef GrStencilPathBatch_DEFINED
 #define GrStencilPathBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrGpu.h"
 #include "GrOp.h"
+#include "GrOpFlushState.h"
 #include "GrPath.h"
 #include "GrPathRendering.h"
 #include "GrRenderTarget.h"
@@ -66,9 +66,9 @@
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override { return false; }
 
-    void onPrepare(GrBatchFlushState*) override {}
+    void onPrepare(GrOpFlushState*) override {}
 
-    void onDraw(GrBatchFlushState* state, const SkRect& bounds) override {
+    void onDraw(GrOpFlushState* state, const SkRect& bounds) override {
         GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewMatrix,
                                               &fScissor, &fStencil);
         state->gpu()->pathRendering()->stencilPath(args, fPath.get());
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index e0327d0..86cf883 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -8,11 +8,11 @@
 #include "GrTessellatingPathRenderer.h"
 
 #include "GrAuditTrail.h"
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrClip.h"
 #include "GrDefaultGeoProcFactory.h"
 #include "GrMesh.h"
+#include "GrOpFlushState.h"
 #include "GrPathUtils.h"
 #include "GrPipelineBuilder.h"
 #include "GrResourceCache.h"
diff --git a/src/gpu/batches/GrTestBatch.h b/src/gpu/batches/GrTestBatch.h
index 700e1c8..66df776 100644
--- a/src/gpu/batches/GrTestBatch.h
+++ b/src/gpu/batches/GrTestBatch.h
@@ -8,8 +8,8 @@
 #ifndef GrTestBatch_DEFINED
 #define GrTestBatch_DEFINED
 
-#include "GrBatchFlushState.h"
 #include "GrGeometryProcessor.h"
+#include "GrOpFlushState.h"
 
 #include "batches/GrMeshDrawOp.h"
 
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 311bad3..02c0d22 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -7,7 +7,6 @@
 
 #include "GrDashingEffect.h"
 
-#include "GrBatchFlushState.h"
 #include "GrBatchTest.h"
 #include "GrCaps.h"
 #include "GrContext.h"
@@ -15,6 +14,7 @@
 #include "GrDefaultGeoProcFactory.h"
 #include "GrGeometryProcessor.h"
 #include "GrInvariantOutput.h"
+#include "GrOpFlushState.h"
 #include "GrProcessor.h"
 #include "GrStyle.h"
 #include "SkGr.h"
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h
index 76bff91..519272f 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.h
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.h
@@ -10,8 +10,8 @@
 
 #include "GrGpuCommandBuffer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrGLGpu.h"
+#include "GrOpFlushState.h"
 
 class GrGLRenderTarget;
 
@@ -36,7 +36,7 @@
         SkASSERT(target == fRenderTarget);
     }
 
-    void inlineUpload(GrBatchFlushState* state, GrDrawOp::DeferredUploadFn& upload) override {
+    void inlineUpload(GrOpFlushState* state, GrDrawOp::DeferredUploadFn& upload) override {
         state->doUpload(upload);
     }
 
diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp
index fb0d53c..135a061 100644
--- a/src/gpu/instanced/InstancedRendering.cpp
+++ b/src/gpu/instanced/InstancedRendering.cpp
@@ -7,8 +7,8 @@
 
 #include "InstancedRendering.h"
 
-#include "GrBatchFlushState.h"
 #include "GrCaps.h"
+#include "GrOpFlushState.h"
 #include "GrPipeline.h"
 #include "GrResourceProvider.h"
 #include "instanced/InstanceProcessor.h"
@@ -462,7 +462,7 @@
     this->onBeginFlush(rp);
 }
 
-void InstancedRendering::Batch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
+void InstancedRendering::Batch::onDraw(GrOpFlushState* state, const SkRect& bounds) {
     SkASSERT(State::kFlushing == fInstancedRendering->fState);
     SkASSERT(state->gpu() == fInstancedRendering->gpu());
 
diff --git a/src/gpu/instanced/InstancedRendering.h b/src/gpu/instanced/InstancedRendering.h
index d5cb309..d3a0152 100644
--- a/src/gpu/instanced/InstancedRendering.h
+++ b/src/gpu/instanced/InstancedRendering.h
@@ -143,8 +143,8 @@
                                           GrInitInvariantOutput* coverage,
                                           GrBatchToXPOverrides*) const override;
 
-        void onPrepare(GrBatchFlushState*) override {}
-        void onDraw(GrBatchFlushState*, const SkRect& bounds) override;
+        void onPrepare(GrOpFlushState*) override {}
+        void onDraw(GrOpFlushState*, const SkRect& bounds) override;
 
         InstancedRendering* const         fInstancedRendering;
         BatchInfo                         fInfo;
diff --git a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
index 238489d..68f00fc 100644
--- a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
+++ b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
@@ -7,7 +7,7 @@
 
 #include "GrAtlasTextBlob.h"
 
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 #include "GrTextUtils.h"
 
 #include "SkDistanceFieldGen.h"
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index 4dd042b..d2d5ee8 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -7,9 +7,9 @@
 
 #include "GrVkGpuCommandBuffer.h"
 
-#include "GrBatchFlushState.h"
 #include "GrFixedClip.h"
 #include "GrMesh.h"
+#include "GrOpFlushState.h"
 #include "GrPipeline.h"
 #include "GrRenderTargetPriv.h"
 #include "GrTexturePriv.h"
@@ -400,8 +400,7 @@
     cbInfo.fCommandBuffer->begin(fGpu, fRenderTarget->framebuffer(), cbInfo.fRenderPass);
 }
 
-void GrVkGpuCommandBuffer::inlineUpload(GrBatchFlushState* state,
-                                        GrDrawOp::DeferredUploadFn& upload) {
+void GrVkGpuCommandBuffer::inlineUpload(GrOpFlushState* state, GrDrawOp::DeferredUploadFn& upload) {
     if (!fCommandBufferInfos[fCurrentCmdBuffer].fIsEmpty) {
         this->addAdditionalCommandBuffer();
     }
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.h b/src/gpu/vk/GrVkGpuCommandBuffer.h
index 76c756e..d3eece3 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.h
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.h
@@ -33,7 +33,7 @@
 
     void discard(GrRenderTarget*) override;
 
-    void inlineUpload(GrBatchFlushState* state, GrDrawOp::DeferredUploadFn& upload) override;
+    void inlineUpload(GrOpFlushState* state, GrDrawOp::DeferredUploadFn& upload) override;
 
 private:
     // Performs lazy initialization on the first operation seen by the command buffer.
@@ -64,11 +64,10 @@
     void addAdditionalCommandBuffer();
 
     struct InlineUploadInfo {
-        InlineUploadInfo(GrBatchFlushState* state, const GrDrawOp::DeferredUploadFn& upload)
-                : fFlushState(state)
-                , fUpload(upload) {}
+        InlineUploadInfo(GrOpFlushState* state, const GrDrawOp::DeferredUploadFn& upload)
+            : fFlushState(state), fUpload(upload) {}
 
-        GrBatchFlushState*            fFlushState;
+        GrOpFlushState* fFlushState;
         GrDrawOp::DeferredUploadFn fUpload;
     };
 
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index 10891b7..816b4e4 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -11,7 +11,7 @@
 #include "Test.h"
 
 #if SK_SUPPORT_GPU
-#include "GrBatchFlushState.h"
+#include "GrOpFlushState.h"
 #include "GrContext.h"
 #include "GrGeometryProcessor.h"
 #include "GrGpu.h"