aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-07 17:06:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-07 23:36:31 +0000
commit742e31de1599f3902810aecdf2e2e3eed3b40a09 (patch)
treebbac738ec7cecce88712ad2df993933c8888305e /src/gpu
parent42521e891081a7a85db4390a457074054649f194 (diff)
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>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBatchAtlas.cpp2
-rw-r--r--src/gpu/GrDrawingManager.h9
-rw-r--r--src/gpu/GrGpuCommandBuffer.h4
-rw-r--r--src/gpu/GrOpFlushState.cpp (renamed from src/gpu/GrBatchFlushState.cpp)8
-rw-r--r--src/gpu/GrOpFlushState.h (renamed from src/gpu/GrBatchFlushState.h)52
-rw-r--r--src/gpu/GrOpList.h6
-rw-r--r--src/gpu/GrOvalRenderer.cpp2
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp4
-rw-r--r--src/gpu/GrRenderTargetOpList.h4
-rw-r--r--src/gpu/GrTextureContext.cpp2
-rw-r--r--src/gpu/GrTextureOpList.cpp4
-rw-r--r--src/gpu/GrTextureOpList.h4
-rw-r--r--src/gpu/batches/GrAAConvexPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAADistanceFieldPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAAFillRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrAAHairLinePathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAAStrokeRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrAnalyticRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrAtlasTextBatch.cpp2
-rw-r--r--src/gpu/batches/GrClearBatch.h6
-rw-r--r--src/gpu/batches/GrClearStencilClipBatch.h6
-rw-r--r--src/gpu/batches/GrCopySurfaceBatch.h6
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrDiscardBatch.h6
-rw-r--r--src/gpu/batches/GrDrawAtlasBatch.cpp4
-rw-r--r--src/gpu/batches/GrDrawOp.h2
-rw-r--r--src/gpu/batches/GrDrawPathBatch.cpp6
-rw-r--r--src/gpu/batches/GrDrawPathBatch.h10
-rw-r--r--src/gpu/batches/GrDrawVerticesBatch.cpp4
-rw-r--r--src/gpu/batches/GrDrawVerticesBatch.h2
-rw-r--r--src/gpu/batches/GrMSAAPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrMeshDrawOp.cpp24
-rw-r--r--src/gpu/batches/GrMeshDrawOp.h6
-rw-r--r--src/gpu/batches/GrNinePatch.cpp2
-rw-r--r--src/gpu/batches/GrNonAAFillRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp2
-rw-r--r--src/gpu/batches/GrNonAAStrokeRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrOp.h10
-rw-r--r--src/gpu/batches/GrPLSPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrRegionBatch.cpp2
-rwxr-xr-xsrc/gpu/batches/GrShadowRRectBatch.cpp2
-rw-r--r--src/gpu/batches/GrStencilPathBatch.h6
-rw-r--r--src/gpu/batches/GrTessellatingPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrTestBatch.h2
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp2
-rw-r--r--src/gpu/gl/GrGLGpuCommandBuffer.h4
-rw-r--r--src/gpu/instanced/InstancedRendering.cpp4
-rw-r--r--src/gpu/instanced/InstancedRendering.h4
-rw-r--r--src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp2
-rw-r--r--src/gpu/vk/GrVkGpuCommandBuffer.cpp5
-rw-r--r--src/gpu/vk/GrVkGpuCommandBuffer.h9
52 files changed, 132 insertions, 135 deletions
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index 32e7b1c369..9f0909a49b 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 90a3064e24..9a05215f5b 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 @@ private:
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 3bb00711fb..13b73346e3 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 @@ public:
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
index 5bc02bdb83..e936c45733 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 @@ GrBatchFlushState::GrBatchFlushState(GrGpu* gpu, GrResourceProvider* resourcePro
, 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
index e4491407a3..9b8baffcb2 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 @@ public:
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 @@ private:
};
/**
- * 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 @@ private:
/**
* 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 @@ public:
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 @@ public:
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 @@ public:
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 873cdcb650..75fc5e63d1 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 @@ public:
~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 735b92fcc1..9adfb0c1e0 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 226bfed99c..41c0d4f9fd 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -151,7 +151,7 @@ void GrRenderTargetOpList::setupDstTexture(GrRenderTarget* rt,
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 @@ void GrRenderTargetOpList::prepareOps(GrBatchFlushState* flushState) {
// 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 5029b4bdaf..d7f8ba1bab 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -74,8 +74,8 @@ public:
* 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 66030f9ee0..22620fed0f 100644
--- a/src/gpu/GrTextureContext.cpp
+++ b/src/gpu/GrTextureContext.cpp
@@ -73,7 +73,7 @@ bool GrTextureContext::copySurface(GrSurface* src, const SkIRect& srcRect,
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 e9021da895..10136439ce 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -44,7 +44,7 @@ void GrTextureOpList::dump() const {
}
#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 @@ void GrTextureOpList::prepareOps(GrBatchFlushState* flushState) {
}
}
-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 0b28421aa1..10ebd1bf34 100644
--- a/src/gpu/GrTextureOpList.h
+++ b/src/gpu/GrTextureOpList.h
@@ -37,8 +37,8 @@ public:
* 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 7de67f60d3..56a5e7ae14 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 8f7c679b1d..0aa451df86 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 826c7fd818..01392d099e 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 8ff4231ac2..70d0d4c81e 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 f959df6c08..f961c5eb74 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 fcdb7c04dd..008faa0f44 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 ff68000f79..e87319c4b6 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 75bbfcaed4..1b450956af 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 f1870486df..2571c26b8f 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 @@ private:
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 87c12f0a26..f9843ce301 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 @@ public:
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 a808b2f181..b28b38348f 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 @@ private:
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 ce51cf099b..f3f9e73155 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 a53feffd9c..419239039f 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 @@ private:
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 95c8f2cf32..f94dc97435 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 8ad22d9ac3..7606b0c27c 100644
--- a/src/gpu/batches/GrDrawOp.h
+++ b/src/gpu/batches/GrDrawOp.h
@@ -37,7 +37,7 @@ public:
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 8d0bc42261..264078c969 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -13,7 +13,7 @@ static void pre_translate_transform_values(const float* xforms,
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 @@ SkString GrDrawPathBatch::dumpInfo() const {
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 @@ bool GrDrawPathRangeBatch::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
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 6dca9dcd98..c6bb55eaee 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 @@ private:
fOverrides = overrides;
}
- void onPrepare(GrBatchFlushState*) override; // Initializes fStencilPassSettings.
+ void onPrepare(GrOpFlushState*) override; // Initializes fStencilPassSettings.
SkMatrix fViewMatrix;
GrColor fColor;
@@ -82,7 +82,7 @@ private:
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 @@ private:
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 1d023200c2..3cc69cb964 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 26f23b5996..4a38707105 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 6b96349793..f073db0a28 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 4f6b9390aa..5f132eeccc 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 @@ void* GrMeshDrawOp::QuadHelper::init(Target* target, size_t vertexStride, int qu
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::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
//////////////////////////////////////////////////////////////////////////////
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 b0292ae0a1..6100166126 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 @@ protected:
};
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 a99a073c5f..21a4185067 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 175b5564fb..abebe627d0 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 8698e8fdf7..9bcab05721 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 4649edf047..f5493c6a72 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 79fbfa4b90..827e58e77f 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 @@ public:
/** 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 @@ protected:
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 bdc102494f..6dd2199671 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 5f9877e788..72be6c8c12 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 84e2a157dd..b2997879cf 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 293da124ad..0e7936a107 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 @@ 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 {
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 e0327d0694..86cf88392c 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 700e1c8a99..66df7763cd 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 311bad3b40..02c0d22915 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 76bff91a88..519272f116 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 @@ public:
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 fb0d53cac0..135a0610ad 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 @@ void InstancedRendering::beginFlush(GrResourceProvider* rp) {
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 d5cb3096ef..d3a01523a6 100644
--- a/src/gpu/instanced/InstancedRendering.h
+++ b/src/gpu/instanced/InstancedRendering.h
@@ -143,8 +143,8 @@ protected:
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 238489d254..68f00fc5be 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 4dd042b7f6..d2d5ee8324 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 @@ void GrVkGpuCommandBuffer::addAdditionalCommandBuffer() {
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 76c756e130..d3eece3ce1 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.h
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.h
@@ -33,7 +33,7 @@ public:
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 @@ private:
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;
};