aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-01 16:40:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-01 22:46:23 +0000
commitdad2923b8ec9270d810c1e8e76da8e6768d8f9dd (patch)
treeb7509eb7dc5fbb79463392a09d1500fbe6834980 /src/gpu
parentabf8ba34c8038b814e67fe7c4dcf6c9915d81698 (diff)
Rename GrVertexBatch->GrMeshDrawOp
Change-Id: I3ebe5a471477ce1b71c150b0bde4982d113fd8a7 Reviewed-on: https://skia-review.googlesource.com/5468 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBatchFlushState.h20
-rw-r--r--src/gpu/GrOvalRenderer.cpp26
-rw-r--r--src/gpu/batches/GrAAConvexPathRenderer.cpp8
-rw-r--r--src/gpu/batches/GrAADistanceFieldPathRenderer.cpp21
-rw-r--r--src/gpu/batches/GrAAFillRectBatch.cpp6
-rw-r--r--src/gpu/batches/GrAAHairLinePathRenderer.cpp6
-rw-r--r--src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp12
-rw-r--r--src/gpu/batches/GrAAStrokeRectBatch.cpp4
-rw-r--r--src/gpu/batches/GrAnalyticRectBatch.cpp11
-rw-r--r--src/gpu/batches/GrAtlasTextBatch.cpp2
-rw-r--r--src/gpu/batches/GrAtlasTextBatch.h17
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp6
-rw-r--r--src/gpu/batches/GrDrawAtlasBatch.h6
-rw-r--r--src/gpu/batches/GrDrawVerticesBatch.h6
-rw-r--r--src/gpu/batches/GrMSAAPathRenderer.cpp16
-rw-r--r--src/gpu/batches/GrMeshDrawOp.cpp (renamed from src/gpu/batches/GrVertexBatch.cpp)46
-rw-r--r--src/gpu/batches/GrMeshDrawOp.h (renamed from src/gpu/batches/GrVertexBatch.h)19
-rw-r--r--src/gpu/batches/GrNinePatch.cpp6
-rw-r--r--src/gpu/batches/GrNonAAFillRectBatch.cpp8
-rw-r--r--src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp8
-rw-r--r--src/gpu/batches/GrNonAAStrokeRectBatch.cpp9
-rw-r--r--src/gpu/batches/GrPLSPathRenderer.cpp24
-rw-r--r--src/gpu/batches/GrRegionBatch.cpp8
-rwxr-xr-xsrc/gpu/batches/GrShadowRRectBatch.cpp8
-rw-r--r--src/gpu/batches/GrTessellatingPathRenderer.cpp16
-rw-r--r--src/gpu/batches/GrTestBatch.h6
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp8
27 files changed, 158 insertions, 175 deletions
diff --git a/src/gpu/GrBatchFlushState.h b/src/gpu/GrBatchFlushState.h
index f075dfb2d2..e4491407a3 100644
--- a/src/gpu/GrBatchFlushState.h
+++ b/src/gpu/GrBatchFlushState.h
@@ -10,7 +10,7 @@
#include "GrBufferAllocPool.h"
#include "GrGpu.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
class GrGpuCommandBuffer;
class GrResourceProvider;
@@ -130,12 +130,12 @@ private:
* 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, GrVertexBatch,
- * GrDrawOp::Target, and GrVertexBatch::Target. However, the interface at the GrDrawOp
- * level is not complete and isn't useful. We should push it down to GrVertexBatch until it
- * is required at the GrDrawOp level.
+ * 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
+ * complete and isn't useful. We should push it down to GrMeshDrawOp until it is required at the
+ * GrDrawOp level.
*/
-
+
/**
* GrDrawOp instances use this object to allocate space for their geometry and to issue the draws
* that render their batch.
@@ -180,11 +180,11 @@ private:
GrDrawOp* fBatch;
};
-/** Extension of GrDrawOp::Target for use by GrVertexBatch. Adds the ability to create vertex
+/** Extension of GrDrawOp::Target for use by GrMeshDrawOp. Adds the ability to create vertex
draws. */
-class GrVertexBatch::Target : public GrDrawOp::Target {
+class GrMeshDrawOp::Target : public GrDrawOp::Target {
public:
- Target(GrBatchFlushState* state, GrVertexBatch* batch) : INHERITED(state, batch) {}
+ Target(GrBatchFlushState* state, GrMeshDrawOp* batch) : INHERITED(state, batch) {}
void draw(const GrGeometryProcessor* gp, const GrMesh& mesh);
@@ -204,7 +204,7 @@ public:
}
private:
- GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batch()); }
+ GrMeshDrawOp* vertexBatch() { return static_cast<GrMeshDrawOp*>(this->batch()); }
typedef GrDrawOp::Target INHERITED;
};
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 4adccf98fb..735b92fcc1 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -17,14 +17,14 @@
#include "GrStyle.h"
#include "SkRRect.h"
#include "SkStrokeRec.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
-#include "glsl/GrGLSLVarying.h"
-#include "glsl/GrGLSLVertexShaderBuilder.h"
#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLUtil.h"
+#include "glsl/GrGLSLVarying.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
// TODO(joshualitt) - Break this file up during GrOp post implementation cleanup
@@ -597,7 +597,7 @@ static const uint16_t* circle_type_to_indices(bool stroked) {
///////////////////////////////////////////////////////////////////////////////
-class CircleBatch : public GrVertexBatch {
+class CircleBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -1143,12 +1143,12 @@ private:
bool fClipPlaneIsect;
bool fClipPlaneUnion;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
-class EllipseBatch : public GrVertexBatch {
+class EllipseBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
static GrDrawOp* Create(GrColor color, const SkMatrix& viewMatrix, const SkRect& ellipse,
@@ -1374,12 +1374,12 @@ private:
SkMatrix fViewMatrixIfUsingLocalCoords;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
/////////////////////////////////////////////////////////////////////////////////////////////////
-class DIEllipseBatch : public GrVertexBatch {
+class DIEllipseBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -1598,7 +1598,7 @@ private:
bool fUsesLocalCoords;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
@@ -1721,7 +1721,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
// each vertex is also given the normalized x & y distance from the interior rect's edge
// the GP takes the min of those depths +1 to get the normalized distance to the outer edge
-class RRectCircleRendererBatch : public GrVertexBatch {
+class RRectCircleRendererBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -2055,7 +2055,7 @@ private:
int fIndexCount;
bool fAllFill;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
static const int kNumRRectsInIndexBuffer = 256;
@@ -2081,7 +2081,7 @@ static const GrBuffer* ref_rrect_index_buffer(RRectType type,
};
}
-class RRectEllipseRendererBatch : public GrVertexBatch {
+class RRectEllipseRendererBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -2309,7 +2309,7 @@ private:
SkMatrix fViewMatrixIfUsingLocalCoords;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
static GrDrawOp* create_rrect_batch(GrColor color,
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index 6c01901687..0107e274bd 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -16,13 +16,13 @@
#include "GrGeometryProcessor.h"
#include "GrInvariantOutput.h"
#include "GrPathUtils.h"
-#include "GrProcessor.h"
#include "GrPipelineBuilder.h"
+#include "GrProcessor.h"
#include "SkGeometry.h"
#include "SkPathPriv.h"
#include "SkString.h"
#include "SkTraceEvent.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -732,7 +732,7 @@ static sk_sp<GrGeometryProcessor> create_fill_gp(bool tweakAlphaForCoverage,
return MakeForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-class AAConvexPathBatch : public GrVertexBatch {
+class AAConvexPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
AAConvexPathBatch(GrColor color, const SkMatrix& viewMatrix, const SkPath& path)
@@ -988,7 +988,7 @@ private:
BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index d56254d2d7..b06c503041 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -13,10 +13,10 @@
#include "GrContext.h"
#include "GrPipelineBuilder.h"
#include "GrResourceProvider.h"
-#include "GrSurfacePriv.h"
#include "GrSWMaskHelper.h"
+#include "GrSurfacePriv.h"
#include "GrTexturePriv.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "effects/GrDistanceFieldGeoProc.h"
#include "SkDistanceFieldGen.h"
@@ -118,7 +118,7 @@ bool GrAADistanceFieldPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
// padding around path bounds to allow for antialiased pixels
static const SkScalar kAntiAliasPad = 1.0f;
-class AADistanceFieldPathBatch : public GrVertexBatch {
+class AADistanceFieldPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -299,14 +299,9 @@ private:
this->flush(target, &flushInfo);
}
- bool addPathToAtlas(GrVertexBatch::Target* target,
- FlushInfo* flushInfo,
- GrBatchAtlas* atlas,
- ShapeData* shapeData,
- const GrShape& shape,
- bool antiAlias,
- uint32_t dimension,
- SkScalar scale) const {
+ bool addPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo, GrBatchAtlas* atlas,
+ ShapeData* shapeData, const GrShape& shape, bool antiAlias,
+ uint32_t dimension, SkScalar scale) const {
const SkRect& bounds = shape.bounds();
// generate bounding rect for bitmap draw
@@ -462,7 +457,7 @@ private:
vertexStride);
}
- void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
+ void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
if (flushInfo->fInstancesToFlush) {
GrMesh mesh;
int maxInstancesPerDraw =
@@ -517,7 +512,7 @@ private:
ShapeDataList* fShapeList;
bool fGammaCorrect;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) {
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 042b3745ac..826c7fd818 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -10,10 +10,10 @@
#include "GrBatchFlushState.h"
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrMeshDrawOp.h"
#include "GrResourceKey.h"
#include "GrResourceProvider.h"
#include "GrTypes.h"
-#include "GrVertexBatch.h"
#include "SkMatrix.h"
#include "SkRect.h"
@@ -157,7 +157,7 @@ static void generate_aa_fill_rect_geometry(intptr_t verts,
}
}
}
-class AAFillRectBatch : public GrVertexBatch {
+class AAFillRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -339,7 +339,7 @@ private:
SkSTArray<4 * sizeof(RectWithLocalMatrixInfo), uint8_t, true> fRectData;
int fRectCnt;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrAAFillRectBatch {
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 67fa00dc65..624be6e9b3 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -21,7 +21,7 @@
#include "SkStroke.h"
#include "SkTemplates.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "effects/GrBezierEffect.h"
@@ -675,7 +675,7 @@ bool check_bounds(const SkMatrix& viewMatrix, const SkRect& devBounds, void* ver
return true;
}
-class AAHairlineBatch : public GrVertexBatch {
+class AAHairlineBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -798,7 +798,7 @@ private:
BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
void AAHairlineBatch::onPrepareDraws(Target* target) const {
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index a91f7f605c..f3a76cb112 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -15,14 +15,14 @@
#include "GrGeometryProcessor.h"
#include "GrInvariantOutput.h"
#include "GrPathUtils.h"
-#include "GrProcessor.h"
#include "GrPipelineBuilder.h"
+#include "GrProcessor.h"
#include "GrStyle.h"
#include "SkGeometry.h"
+#include "SkPathPriv.h"
#include "SkString.h"
#include "SkTraceEvent.h"
-#include "SkPathPriv.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "glsl/GrGLSLGeometryProcessor.h"
static const int DEFAULT_BUFFER_SIZE = 100;
@@ -123,7 +123,7 @@ static sk_sp<GrGeometryProcessor> create_fill_gp(bool tweakAlphaForCoverage,
return MakeForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-class AAFlatteningConvexPathBatch : public GrVertexBatch {
+class AAFlatteningConvexPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -190,7 +190,7 @@ private:
fBatch.fCanTweakAlphaForCoverage = overrides.canTweakAlphaForCoverage();
}
- void draw(GrVertexBatch::Target* target, const GrGeometryProcessor* gp, int vertexCount,
+ void draw(GrMeshDrawOp::Target* target, const GrGeometryProcessor* gp, int vertexCount,
size_t vertexStride, void* vertices, int indexCount, uint16_t* indices) const {
if (vertexCount == 0 || indexCount == 0) {
return;
@@ -337,7 +337,7 @@ private:
BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index dc93146393..fcdb7c04dd 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -116,7 +116,7 @@ static sk_sp<GrGeometryProcessor> create_stroke_rect_gp(bool tweakAlphaForCovera
return MakeForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-class AAStrokeRectBatch : public GrVertexBatch {
+class AAStrokeRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -241,7 +241,7 @@ private:
SkMatrix fViewMatrix;
bool fMiterStroke;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
void AAStrokeRectBatch::initBatchTracker(const GrXPOverridesForBatch& overrides) {
diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp
index eed11b90db..ff68000f79 100644
--- a/src/gpu/batches/GrAnalyticRectBatch.cpp
+++ b/src/gpu/batches/GrAnalyticRectBatch.cpp
@@ -15,15 +15,14 @@
#include "GrResourceProvider.h"
#include "SkRRect.h"
#include "SkStrokeRec.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
-#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
-#include "glsl/GrGLSLVarying.h"
-#include "glsl/GrGLSLVertexShaderBuilder.h"
#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLUtil.h"
+#include "glsl/GrGLSLVarying.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
namespace {
@@ -234,7 +233,7 @@ sk_sp<GrGeometryProcessor> RectGeometryProcessor::TestCreate(GrProcessorTestData
///////////////////////////////////////////////////////////////////////////////
-class AnalyticRectBatch : public GrVertexBatch {
+class AnalyticRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -385,7 +384,7 @@ private:
SkMatrix fViewMatrixIfUsingLocalCoords;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
GrDrawOp* GrAnalyticRectBatch::CreateAnalyticRectBatch(GrColor color,
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index df81e2cb26..75bbfcaed4 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -170,7 +170,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
this->flush(target, &flushInfo);
}
-void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
+void GrAtlasTextBatch::flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
GrMesh mesh;
int maxGlyphsPerDraw =
static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
diff --git a/src/gpu/batches/GrAtlasTextBatch.h b/src/gpu/batches/GrAtlasTextBatch.h
index ca715a744c..7109ede3e3 100644
--- a/src/gpu/batches/GrAtlasTextBatch.h
+++ b/src/gpu/batches/GrAtlasTextBatch.h
@@ -8,12 +8,12 @@
#ifndef GrAtlasTextBatch_DEFINED
#define GrAtlasTextBatch_DEFINED
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "text/GrAtlasTextContext.h"
#include "text/GrDistanceFieldAdjustTable.h"
-class GrAtlasTextBatch : public GrVertexBatch {
+class GrAtlasTextBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -145,7 +145,7 @@ private:
kLCDDistanceField_MaskType == fMaskType;
}
- inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const;
+ inline void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const;
GrColor color() const { return fBatch.fColor; }
const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
@@ -191,7 +191,7 @@ private:
friend class GrBlobRegenHelper; // Needs to trigger flushes
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
/*
@@ -200,12 +200,9 @@ private:
*/
class GrBlobRegenHelper {
public:
- GrBlobRegenHelper(const GrAtlasTextBatch* batch,
- GrVertexBatch::Target* target,
+ GrBlobRegenHelper(const GrAtlasTextBatch* batch, GrMeshDrawOp::Target* target,
GrAtlasTextBatch::FlushInfo* flushInfo)
- : fBatch(batch)
- , fTarget(target)
- , fFlushInfo(flushInfo) {}
+ : fBatch(batch), fTarget(target), fFlushInfo(flushInfo) {}
void flush();
@@ -215,7 +212,7 @@ public:
private:
const GrAtlasTextBatch* fBatch;
- GrVertexBatch::Target* fTarget;
+ GrMeshDrawOp::Target* fTarget;
GrAtlasTextBatch::FlushInfo* fFlushInfo;
};
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index 884c37bf3b..e41818dbd6 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -21,8 +21,8 @@
#include "SkTLazy.h"
#include "SkTraceEvent.h"
+#include "batches/GrMeshDrawOp.h"
#include "batches/GrRectBatchFactory.h"
-#include "batches/GrVertexBatch.h"
GrDefaultPathRenderer::GrDefaultPathRenderer(bool separateStencilSupport,
bool stencilWrapOpsSupport)
@@ -94,7 +94,7 @@ static inline void add_quad(SkPoint** vert, const SkPoint* base, const SkPoint p
}
}
-class DefaultPathBatch : public GrVertexBatch {
+class DefaultPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -419,7 +419,7 @@ private:
BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetContext,
diff --git a/src/gpu/batches/GrDrawAtlasBatch.h b/src/gpu/batches/GrDrawAtlasBatch.h
index 449882c356..602258749b 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.h
+++ b/src/gpu/batches/GrDrawAtlasBatch.h
@@ -10,9 +10,9 @@
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
-#include "GrVertexBatch.h"
+#include "GrMeshDrawOp.h"
-class GrDrawAtlasBatch : public GrVertexBatch {
+class GrDrawAtlasBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -71,7 +71,7 @@ private:
bool fCoverageIgnored;
bool fHasColors;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
#endif
diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h
index 821321a771..26f23b5996 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.h
+++ b/src/gpu/batches/GrDrawVerticesBatch.h
@@ -9,8 +9,8 @@
#define GrDrawVerticesBatch_DEFINED
#include "GrColor.h"
+#include "GrMeshDrawOp.h"
#include "GrTypes.h"
-#include "GrVertexBatch.h"
#include "SkMatrix.h"
#include "SkRect.h"
#include "SkTDArray.h"
@@ -18,7 +18,7 @@
class GrBatchFlushState;
struct GrInitInvariantOutput;
-class GrDrawVerticesBatch : public GrVertexBatch {
+class GrDrawVerticesBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -74,7 +74,7 @@ private:
SkSTArray<1, Mesh, true> fMeshes;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
#endif
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 1a345c0c5d..5aa8f37903 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -12,20 +12,20 @@
#include "GrClip.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrFixedClip.h"
+#include "GrMesh.h"
#include "GrPathStencilSettings.h"
#include "GrPathUtils.h"
#include "GrPipelineBuilder.h"
-#include "GrMesh.h"
#include "SkGeometry.h"
#include "SkTraceEvent.h"
-#include "glsl/GrGLSLGeometryProcessor.h"
+#include "batches/GrMeshDrawOp.h"
+#include "batches/GrRectBatchFactory.h"
+#include "gl/GrGLVaryingHandler.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLVertexShaderBuilder.h"
+#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLUtil.h"
-#include "gl/GrGLVaryingHandler.h"
-#include "batches/GrRectBatchFactory.h"
-#include "batches/GrVertexBatch.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
static const float kTolerance = 0.5f;
@@ -214,7 +214,7 @@ private:
typedef GrGeometryProcessor INHERITED;
};
-class MSAAPathBatch : public GrVertexBatch {
+class MSAAPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -557,7 +557,7 @@ private:
int fMaxQuadIndices;
bool fIsIndexed;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrMSAAPathRenderer::internalDrawPath(GrRenderTargetContext* renderTargetContext,
diff --git a/src/gpu/batches/GrVertexBatch.cpp b/src/gpu/batches/GrMeshDrawOp.cpp
index 37bdcacc49..4f6b9390aa 100644
--- a/src/gpu/batches/GrVertexBatch.cpp
+++ b/src/gpu/batches/GrMeshDrawOp.cpp
@@ -5,24 +5,22 @@
* found in the LICENSE file.
*/
-#include "GrVertexBatch.h"
+#include "GrMeshDrawOp.h"
#include "GrBatchFlushState.h"
#include "GrResourceProvider.h"
-GrVertexBatch::GrVertexBatch(uint32_t classID)
- : INHERITED(classID)
- , fBaseDrawToken(GrDrawOpUploadToken::AlreadyFlushedToken()) {
-}
+GrMeshDrawOp::GrMeshDrawOp(uint32_t classID)
+ : INHERITED(classID), fBaseDrawToken(GrDrawOpUploadToken::AlreadyFlushedToken()) {}
-void GrVertexBatch::onPrepare(GrBatchFlushState* state) {
+void GrMeshDrawOp::onPrepare(GrBatchFlushState* state) {
Target target(state, this);
this->onPrepareDraws(&target);
}
-void* GrVertexBatch::InstancedHelper::init(Target* target, GrPrimitiveType primType,
- size_t vertexStride, const GrBuffer* indexBuffer,
- int verticesPerInstance, int indicesPerInstance,
- int instancesToDraw) {
+void* GrMeshDrawOp::InstancedHelper::init(Target* target, GrPrimitiveType primType,
+ size_t vertexStride, const GrBuffer* indexBuffer,
+ int verticesPerInstance, int indicesPerInstance,
+ int instancesToDraw) {
SkASSERT(target);
if (!indexBuffer) {
return nullptr;
@@ -30,7 +28,8 @@ void* GrVertexBatch::InstancedHelper::init(Target* target, GrPrimitiveType primT
const GrBuffer* vertexBuffer;
int firstVertex;
int vertexCount = verticesPerInstance * instancesToDraw;
- void* vertices = target->makeVertexSpace(vertexStride, vertexCount, &vertexBuffer, &firstVertex);
+ void* vertices =
+ target->makeVertexSpace(vertexStride, vertexCount, &vertexBuffer, &firstVertex);
if (!vertices) {
SkDebugf("Vertices could not be allocated for instanced rendering.");
return nullptr;
@@ -39,21 +38,18 @@ void* GrVertexBatch::InstancedHelper::init(Target* target, GrPrimitiveType primT
size_t ibSize = indexBuffer->gpuMemorySize();
int maxInstancesPerDraw = static_cast<int>(ibSize / (sizeof(uint16_t) * indicesPerInstance));
- fMesh.initInstanced(primType, vertexBuffer, indexBuffer,
- firstVertex, verticesPerInstance, indicesPerInstance, instancesToDraw,
- maxInstancesPerDraw);
+ fMesh.initInstanced(primType, vertexBuffer, indexBuffer, firstVertex, verticesPerInstance,
+ indicesPerInstance, instancesToDraw, maxInstancesPerDraw);
return vertices;
}
-void GrVertexBatch::InstancedHelper::recordDraw(Target* target, const GrGeometryProcessor* gp) {
+void GrMeshDrawOp::InstancedHelper::recordDraw(Target* target, const GrGeometryProcessor* gp) {
SkASSERT(fMesh.instanceCount());
target->draw(gp, fMesh);
}
-void* GrVertexBatch::QuadHelper::init(Target* target, size_t vertexStride,
- int quadsToDraw) {
- sk_sp<const GrBuffer> quadIndexBuffer(
- target->resourceProvider()->refQuadIndexBuffer());
+void* GrMeshDrawOp::QuadHelper::init(Target* target, size_t vertexStride, int quadsToDraw) {
+ sk_sp<const GrBuffer> quadIndexBuffer(target->resourceProvider()->refQuadIndexBuffer());
if (!quadIndexBuffer) {
SkDebugf("Could not get quad index buffer.");
return nullptr;
@@ -63,7 +59,7 @@ void* GrVertexBatch::QuadHelper::init(Target* target, size_t vertexStride,
quadsToDraw);
}
-void GrVertexBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
+void GrMeshDrawOp::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
int currUploadIdx = 0;
int currMeshIdx = 0;
@@ -75,7 +71,7 @@ void GrVertexBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
fInlineUploads[currUploadIdx].fUploadBeforeToken == drawToken) {
state->commandBuffer()->inlineUpload(state, fInlineUploads[currUploadIdx++].fUpload);
}
- const QueuedDraw &draw = fQueuedDraws[currDrawIdx];
+ const QueuedDraw& draw = fQueuedDraws[currDrawIdx];
state->commandBuffer()->draw(*this->pipeline(), *draw.fGeometryProcessor.get(),
fMeshes.begin() + currMeshIdx, draw.fMeshCnt, bounds);
currMeshIdx += draw.fMeshCnt;
@@ -89,13 +85,13 @@ void GrVertexBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
//////////////////////////////////////////////////////////////////////////////
-void GrVertexBatch::Target::draw(const GrGeometryProcessor* gp, const GrMesh& mesh) {
- GrVertexBatch* batch = this->vertexBatch();
+void GrMeshDrawOp::Target::draw(const GrGeometryProcessor* gp, const GrMesh& mesh) {
+ GrMeshDrawOp* batch = this->vertexBatch();
batch->fMeshes.push_back(mesh);
if (!batch->fQueuedDraws.empty()) {
// If the last draw shares a geometry processor and there are no intervening uploads,
// add this mesh to it.
- GrVertexBatch::QueuedDraw& lastDraw = this->vertexBatch()->fQueuedDraws.back();
+ GrMeshDrawOp::QueuedDraw& lastDraw = this->vertexBatch()->fQueuedDraws.back();
if (lastDraw.fGeometryProcessor == gp &&
(batch->fInlineUploads.empty() ||
batch->fInlineUploads.back().fUploadBeforeToken != this->nextDrawToken())) {
@@ -103,7 +99,7 @@ void GrVertexBatch::Target::draw(const GrGeometryProcessor* gp, const GrMesh& me
return;
}
}
- GrVertexBatch::QueuedDraw& draw = this->vertexBatch()->fQueuedDraws.push_back();
+ GrMeshDrawOp::QueuedDraw& draw = this->vertexBatch()->fQueuedDraws.push_back();
GrDrawOpUploadToken token = this->state()->issueDrawToken();
draw.fGeometryProcessor.reset(gp);
draw.fMeshCnt = 1;
diff --git a/src/gpu/batches/GrVertexBatch.h b/src/gpu/batches/GrMeshDrawOp.h
index f5945e2c20..b0292ae0a1 100644
--- a/src/gpu/batches/GrVertexBatch.h
+++ b/src/gpu/batches/GrMeshDrawOp.h
@@ -18,28 +18,28 @@
class GrBatchFlushState;
/**
- * Base class for vertex-based GrBatches.
+ * Base class for mesh-drawing GrDrawOps.
*/
-class GrVertexBatch : public GrDrawOp {
+class GrMeshDrawOp : public GrDrawOp {
public:
class Target;
- GrVertexBatch(uint32_t classID);
+ GrMeshDrawOp(uint32_t classID);
protected:
/** Helper for rendering instances using an instanced index index buffer. This class creates the
space for the vertices and flushes the draws to the batch target. */
- class InstancedHelper {
- public:
+ class InstancedHelper {
+ public:
InstancedHelper() {}
/** Returns the allocated storage for the vertices. The caller should populate the vertices
before calling recordDraws(). */
- void* init(Target*, GrPrimitiveType, size_t vertexStride,
- const GrBuffer*, int verticesPerInstance, int indicesPerInstance,
- int instancesToDraw);
+ void* init(Target*, GrPrimitiveType, size_t vertexStride, const GrBuffer*,
+ int verticesPerInstance, int indicesPerInstance, int instancesToDraw);
/** Call after init() to issue draws to the batch target.*/
void recordDraw(Target*, const GrGeometryProcessor*);
+
private:
GrMesh fMesh;
};
@@ -57,6 +57,7 @@ protected:
void* init(Target*, size_t vertexStride, int quadsToDraw);
using InstancedHelper::recordDraw;
+
private:
typedef InstancedHelper INHERITED;
};
@@ -82,7 +83,7 @@ private:
// fQueuedDraws[i]'s token is fBaseDrawToken + i.
GrDrawOpUploadToken fBaseDrawToken;
- SkSTArray<4, GrMesh> fMeshes;
+ SkSTArray<4, GrMesh> fMeshes;
SkSTArray<4, QueuedDraw, true> fQueuedDraws;
typedef GrDrawOp INHERITED;
diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp
index f9a660125b..a99a073c5f 100644
--- a/src/gpu/batches/GrNinePatch.cpp
+++ b/src/gpu/batches/GrNinePatch.cpp
@@ -9,8 +9,8 @@
#include "GrBatchFlushState.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrMeshDrawOp.h"
#include "GrResourceProvider.h"
-#include "GrVertexBatch.h"
#include "SkBitmap.h"
#include "SkLatticeIter.h"
#include "SkRect.h"
@@ -23,7 +23,7 @@ static sk_sp<GrGeometryProcessor> create_gp(bool readsCoverage) {
return GrDefaultGeoProcFactory::Make(color, coverage, localCoords, SkMatrix::I());
}
-class GrNonAANinePatchBatch : public GrVertexBatch {
+class GrNonAANinePatchBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -176,7 +176,7 @@ private:
int fImageHeight;
SkSTArray<1, Patch, true> fPatches;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrNinePatch {
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp
index db6499bc84..175b5564fb 100644
--- a/src/gpu/batches/GrNonAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp
@@ -10,10 +10,10 @@
#include "GrBatchFlushState.h"
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrMeshDrawOp.h"
#include "GrPrimitiveProcessor.h"
-#include "GrResourceProvider.h"
#include "GrQuad.h"
-#include "GrVertexBatch.h"
+#include "GrResourceProvider.h"
#include "SkMatrixPriv.h"
@@ -71,7 +71,7 @@ static void tesselate(intptr_t vertices,
}
}
-class NonAAFillRectBatch : public GrVertexBatch {
+class NonAAFillRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -187,7 +187,7 @@ private:
GrXPOverridesForBatch fOverrides;
SkSTArray<1, RectInfo, true> fRects;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrNonAAFillRectBatch {
diff --git a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
index dddd23c2df..8698e8fdf7 100644
--- a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
@@ -10,10 +10,10 @@
#include "GrBatchFlushState.h"
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrMeshDrawOp.h"
#include "GrPrimitiveProcessor.h"
-#include "GrResourceProvider.h"
#include "GrQuad.h"
-#include "GrVertexBatch.h"
+#include "GrResourceProvider.h"
static const int kVertsPerInstance = 4;
static const int kIndicesPerInstance = 6;
@@ -90,7 +90,7 @@ static void tesselate(intptr_t vertices,
}
// We handle perspective in the local matrix or viewmatrix with special batches
-class GrNonAAFillRectPerspectiveBatch : public GrVertexBatch {
+class GrNonAAFillRectPerspectiveBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -229,7 +229,7 @@ private:
SkMatrix fLocalMatrix;
SkMatrix fViewMatrix;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrNonAAFillRectBatch {
diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
index 9017b8056b..4649edf047 100644
--- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp
@@ -7,11 +7,11 @@
#include "GrNonAAStrokeRectBatch.h"
-#include "GrBatchTest.h"
#include "GrBatchFlushState.h"
+#include "GrBatchTest.h"
#include "GrColor.h"
#include "GrDefaultGeoProcFactory.h"
-#include "GrVertexBatch.h"
+#include "GrMeshDrawOp.h"
#include "SkRandom.h"
/* create a triangle strip that strokes the specified rect. There are 8
@@ -45,7 +45,7 @@ inline static bool allowed_stroke(const SkStrokeRec& stroke) {
(stroke.getJoin() == SkPaint::kMiter_Join && stroke.getMiter() > SK_ScalarSqrt2);
}
-class NonAAStrokeRectBatch : public GrVertexBatch {
+class NonAAStrokeRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -183,8 +183,7 @@ private:
const static int kVertsPerHairlineRect = 5;
const static int kVertsPerStrokeRect = 10;
-
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrNonAAStrokeRectBatch {
diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp
index 1cccc10018..f233cccd8d 100644
--- a/src/gpu/batches/GrPLSPathRenderer.cpp
+++ b/src/gpu/batches/GrPLSPathRenderer.cpp
@@ -7,27 +7,27 @@
#include "GrPLSPathRenderer.h"
-#include "SkChunkAlloc.h"
-#include "SkGeometry.h"
-#include "SkPathPriv.h"
-#include "SkString.h"
-#include "SkTSort.h"
-#include "SkTraceEvent.h"
#include "GrBatchFlushState.h"
#include "GrBatchTest.h"
#include "GrCaps.h"
#include "GrContext.h"
#include "GrDefaultGeoProcFactory.h"
-#include "GrPLSGeometryProcessor.h"
#include "GrInvariantOutput.h"
+#include "GrPLSGeometryProcessor.h"
#include "GrPathUtils.h"
-#include "GrProcessor.h"
#include "GrPipelineBuilder.h"
+#include "GrProcessor.h"
#include "GrStyle.h"
#include "GrTessellator.h"
-#include "batches/GrVertexBatch.h"
-#include "glsl/GrGLSLGeometryProcessor.h"
+#include "SkChunkAlloc.h"
+#include "SkGeometry.h"
+#include "SkPathPriv.h"
+#include "SkString.h"
+#include "SkTSort.h"
+#include "SkTraceEvent.h"
+#include "batches/GrMeshDrawOp.h"
#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLPLSPathRendering.h"
GrPLSPathRenderer::GrPLSPathRenderer() {
@@ -763,7 +763,7 @@ bool GrPLSPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
path.getFillType() == SkPath::FillType::kWinding_FillType;
}
-class PLSPathBatch : public GrVertexBatch {
+class PLSPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
PLSPathBatch(GrColor color, const SkPath& path, const SkMatrix& viewMatrix)
@@ -924,7 +924,7 @@ private:
GrColor fColor;
SkPath fPath;
SkMatrix fViewMatrix;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
SkDEBUGCODE(bool inPLSDraw = false;)
diff --git a/src/gpu/batches/GrRegionBatch.cpp b/src/gpu/batches/GrRegionBatch.cpp
index d7bef06a68..5f9877e788 100644
--- a/src/gpu/batches/GrRegionBatch.cpp
+++ b/src/gpu/batches/GrRegionBatch.cpp
@@ -7,10 +7,10 @@
#include "GrRegionBatch.h"
-#include "GrDefaultGeoProcFactory.h"
#include "GrBatchFlushState.h"
+#include "GrDefaultGeoProcFactory.h"
+#include "GrMeshDrawOp.h"
#include "GrResourceProvider.h"
-#include "GrVertexBatch.h"
#include "SkMatrixPriv.h"
#include "SkRegion.h"
@@ -50,7 +50,7 @@ static void tesselate_region(intptr_t vertices,
}
}
-class RegionBatch : public GrVertexBatch {
+class RegionBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -155,7 +155,7 @@ private:
GrXPOverridesForBatch fOverrides;
SkSTArray<1, RegionInfo, true> fRegions;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
namespace GrRegionBatch {
diff --git a/src/gpu/batches/GrShadowRRectBatch.cpp b/src/gpu/batches/GrShadowRRectBatch.cpp
index ba5c629536..84e2a157dd 100755
--- a/src/gpu/batches/GrShadowRRectBatch.cpp
+++ b/src/gpu/batches/GrShadowRRectBatch.cpp
@@ -59,7 +59,7 @@ static const uint16_t* circle_type_to_indices(bool stroked) {
///////////////////////////////////////////////////////////////////////////////
-class ShadowCircleBatch : public GrVertexBatch {
+class ShadowCircleBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -399,7 +399,7 @@ private:
int fVertCount;
int fIndexCount;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -504,7 +504,7 @@ static const uint16_t* rrect_type_to_indices(RRectType type) {
// each vertex is also given the normalized x & y distance from the interior rect's edge
// the GP takes the min of those depths +1 to get the normalized distance to the outer edge
-class ShadowCircularRRectBatch : public GrVertexBatch {
+class ShadowCircularRRectBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -828,7 +828,7 @@ private:
int fVertCount;
int fIndexCount;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index eaa0b8436a..6e78c11bd2 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -20,7 +20,7 @@
#include "GrTessellator.h"
#include "SkGeometry.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include <stdio.h>
@@ -103,12 +103,8 @@ private:
class DynamicVertexAllocator : public GrTessellator::VertexAllocator {
public:
- DynamicVertexAllocator(size_t stride, GrVertexBatch::Target* target)
- : VertexAllocator(stride)
- , fTarget(target)
- , fVertexBuffer(nullptr)
- , fVertices(nullptr) {
- }
+ DynamicVertexAllocator(size_t stride, GrMeshDrawOp::Target* target)
+ : VertexAllocator(stride), fTarget(target), fVertexBuffer(nullptr), fVertices(nullptr) {}
void* lock(int vertexCount) override {
fVertexCount = vertexCount;
fVertices = fTarget->makeVertexSpace(stride(), vertexCount, &fVertexBuffer, &fFirstVertex);
@@ -121,7 +117,7 @@ public:
const GrBuffer* vertexBuffer() const { return fVertexBuffer; }
int firstVertex() const { return fFirstVertex; }
private:
- GrVertexBatch::Target* fTarget;
+ GrMeshDrawOp::Target* fTarget;
const GrBuffer* fVertexBuffer;
int fVertexCount;
int fFirstVertex;
@@ -160,7 +156,7 @@ bool GrTessellatingPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) cons
return true;
}
-class TessellatingPathBatch : public GrVertexBatch {
+class TessellatingPathBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
@@ -354,7 +350,7 @@ private:
bool fAntiAlias;
GrXPOverridesForBatch fPipelineInfo;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
diff --git a/src/gpu/batches/GrTestBatch.h b/src/gpu/batches/GrTestBatch.h
index 9d76c439ec..700e1c8a99 100644
--- a/src/gpu/batches/GrTestBatch.h
+++ b/src/gpu/batches/GrTestBatch.h
@@ -11,13 +11,13 @@
#include "GrBatchFlushState.h"
#include "GrGeometryProcessor.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
/*
* A simple solid color batch only for testing purposes which actually doesn't batch at all. It
* saves having to fill out some boiler plate methods.
*/
-class GrTestBatch : public GrVertexBatch {
+class GrTestBatch : public GrMeshDrawOp {
public:
virtual const char* name() const override = 0;
@@ -60,7 +60,7 @@ private:
GrColor fColor;
Optimizations fOptimizations;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
#endif
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index f3a6323c1a..311bad3b40 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -10,15 +10,15 @@
#include "GrBatchFlushState.h"
#include "GrBatchTest.h"
#include "GrCaps.h"
-#include "GrGeometryProcessor.h"
#include "GrContext.h"
#include "GrCoordTransform.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrGeometryProcessor.h"
#include "GrInvariantOutput.h"
#include "GrProcessor.h"
#include "GrStyle.h"
#include "SkGr.h"
-#include "batches/GrVertexBatch.h"
+#include "batches/GrMeshDrawOp.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -238,7 +238,7 @@ static sk_sp<GrGeometryProcessor> make_dash_gp(GrColor,
const SkMatrix& localMatrix,
bool usesLocalCoords);
-class DashBatch : public GrVertexBatch {
+class DashBatch : public GrMeshDrawOp {
public:
DEFINE_OP_CLASS_ID
struct Geometry {
@@ -704,7 +704,7 @@ private:
BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
- typedef GrVertexBatch INHERITED;
+ typedef GrMeshDrawOp INHERITED;
};
GrDrawOp* GrDashingEffect::CreateDashLineBatch(GrColor color,