diff options
Diffstat (limited to 'src/gpu/ops')
-rw-r--r-- | src/gpu/ops/GrAAFillRectOp.cpp | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrAAHairLinePathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp | 1 | ||||
-rw-r--r-- | src/gpu/ops/GrAAStrokeRectOp.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrAnalyticRectOp.cpp | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrClearOp.h | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrDefaultPathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawAtlasOp.cpp | 1 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawOp.h | 6 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawVerticesOp.cpp | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawVerticesOp.h | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrMeshDrawOp.h | 14 | ||||
-rw-r--r-- | src/gpu/ops/GrNonAAFillRectOp.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp | 14 | ||||
-rw-r--r-- | src/gpu/ops/GrNonAAStrokeRectOp.cpp | 6 | ||||
-rw-r--r-- | src/gpu/ops/GrOp.h | 15 | ||||
-rw-r--r-- | src/gpu/ops/GrOvalOpFactory.cpp | 6 | ||||
-rw-r--r-- | src/gpu/ops/GrRectOpFactory.h | 2 | ||||
-rw-r--r-- | src/gpu/ops/GrRegionOp.cpp | 2 | ||||
-rwxr-xr-x | src/gpu/ops/GrShadowRRectOp.cpp | 36 | ||||
-rw-r--r-- | src/gpu/ops/GrTestMeshDrawOp.h | 25 |
21 files changed, 77 insertions, 77 deletions
diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp index e00ed5599f..0158d60917 100644 --- a/src/gpu/ops/GrAAFillRectOp.cpp +++ b/src/gpu/ops/GrAAFillRectOp.cpp @@ -182,7 +182,7 @@ public: SkString dumpInfo() const override { SkString str; - str.appendf("# batched: %d\n", fRectCnt); + str.appendf("# combined: %d\n", fRectCnt); const RectInfo* info = this->first(); for (int i = 0; i < fRectCnt; ++i) { const SkRect& rect = info->rect(); diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 9228318519..affef55877 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -754,8 +754,8 @@ private: return false; } - // TODO we can actually batch hairlines if they are the same color in a kind of bulk method - // but we haven't implemented this yet + // TODO we can actually combine hairlines if they are the same color in a kind of bulk + // method but we haven't implemented this yet // TODO investigate going to vertex color and coverage? if (this->coverage() != that->coverage()) { return false; diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index 40d6083b50..b96e90ae62 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -189,7 +189,6 @@ private: } optimizations.getOverrideColorIfSet(&fPaths[0].fColor); - // setup batch properties fColor = fPaths[0].fColor; fUsesLocalCoords = optimizations.readsLocalCoords(); fCoverageIgnored = !optimizations.readsCoverage(); diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp index 711129fdcd..1c700599db 100644 --- a/src/gpu/ops/GrAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrAAStrokeRectOp.cpp @@ -385,13 +385,13 @@ bool AAStrokeRectOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) { return false; } - // TODO batch across miterstroke changes + // TODO combine across miterstroke changes if (this->miterStroke() != that->miterStroke()) { return false; } // We apply the viewmatrix to the rect points on the cpu. However, if the pipeline uses - // local coords then we won't be able to batch. We could actually upload the viewmatrix + // local coords then we won't be able to combine. We could actually upload the viewmatrix // using vertex attributes in these cases, but haven't investigated that if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->viewMatrix())) { return false; diff --git a/src/gpu/ops/GrAnalyticRectOp.cpp b/src/gpu/ops/GrAnalyticRectOp.cpp index cd4b6905bf..01e9e33d74 100644 --- a/src/gpu/ops/GrAnalyticRectOp.cpp +++ b/src/gpu/ops/GrAnalyticRectOp.cpp @@ -252,7 +252,7 @@ public: this->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kNo); } - const char* name() const override { return "AnalyticRectBatch"; } + const char* name() const override { return "AnalyticRectOp"; } SkString dumpInfo() const override { SkString string; diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h index f2baefd697..03722ca7f8 100644 --- a/src/gpu/ops/GrClearOp.h +++ b/src/gpu/ops/GrClearOp.h @@ -60,7 +60,7 @@ private: , fColor(color) { SkIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height()); if (fClip.scissorEnabled()) { - // Don't let scissors extend outside the RT. This may improve batching. + // Don't let scissors extend outside the RT. This may improve op combining. if (!fClip.intersect(rtRect)) { return; } diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index e6c6f31651..47c7adacad 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -620,8 +620,8 @@ DRAW_OP_TEST_DEFINE(DefaultPathOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrix(random); - // For now just hairlines because the other types of draws require two batches. - // TODO we should figure out a way to combine the stencil and cover steps into one batch + // For now just hairlines because the other types of draws require two ops. + // TODO we should figure out a way to combine the stencil and cover steps into one op. GrStyle style(SkStrokeRec::kHairline_InitStyle); SkPath path = GrTest::TestPath(random); diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp index 3ce079b9d5..eac8f96167 100644 --- a/src/gpu/ops/GrDrawAtlasOp.cpp +++ b/src/gpu/ops/GrDrawAtlasOp.cpp @@ -27,7 +27,6 @@ void GrDrawAtlasOp::applyPipelineOptimizations(const GrPipelineOptimizations& op } } - // setup batch properties fColorIgnored = !optimizations.readsColor(); fColor = fGeoData[0].fColor; // We'd like to assert this, but we can't because of GLPrograms test diff --git a/src/gpu/ops/GrDrawOp.h b/src/gpu/ops/GrDrawOp.h index 929513cc2f..ad8a545b78 100644 --- a/src/gpu/ops/GrDrawOp.h +++ b/src/gpu/ops/GrDrawOp.h @@ -5,8 +5,8 @@ * found in the LICENSE file. */ -#ifndef GrDrawBatch_DEFINED -#define GrDrawBatch_DEFINED +#ifndef GrDrawOp_DEFINED +#define GrDrawOp_DEFINED #include <functional> #include "GrOp.h" @@ -40,7 +40,7 @@ private: }; /** - * Base class for GrOps that draw. These batches have a GrPipeline installed by GrOpList. + * Base class for GrOps that draw. These ops have a GrPipeline installed by GrOpList. */ class GrDrawOp : public GrOp { public: diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 12c2a0bdbb..db505f9b42 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -175,7 +175,7 @@ bool GrDrawVerticesOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) { return false; } - if (!this->batchablePrimitiveType() || this->primitiveType() != that->primitiveType()) { + if (!this->combinablePrimitive() || this->primitiveType() != that->primitiveType()) { return false; } diff --git a/src/gpu/ops/GrDrawVerticesOp.h b/src/gpu/ops/GrDrawVerticesOp.h index 57215fca79..2c1580d4e5 100644 --- a/src/gpu/ops/GrDrawVerticesOp.h +++ b/src/gpu/ops/GrDrawVerticesOp.h @@ -54,7 +54,7 @@ private: void onPrepareDraws(Target*) const override; GrPrimitiveType primitiveType() const { return fPrimitiveType; } - bool batchablePrimitiveType() const { + bool combinablePrimitive() const { return kTriangles_GrPrimitiveType == fPrimitiveType || kLines_GrPrimitiveType == fPrimitiveType || kPoints_GrPrimitiveType == fPrimitiveType; diff --git a/src/gpu/ops/GrMeshDrawOp.h b/src/gpu/ops/GrMeshDrawOp.h index 6100166126..20e55c9d8a 100644 --- a/src/gpu/ops/GrMeshDrawOp.h +++ b/src/gpu/ops/GrMeshDrawOp.h @@ -5,8 +5,8 @@ * found in the LICENSE file. */ -#ifndef GrVertexBatch_DEFINED -#define GrVertexBatch_DEFINED +#ifndef GrMeshDrawOp_DEFINED +#define GrMeshDrawOp_DEFINED #include "GrDrawOp.h" #include "GrGeometryProcessor.h" @@ -28,7 +28,7 @@ public: 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. */ + space for the vertices and flushes the draws to the GrMeshDrawOp::Target. */ class InstancedHelper { public: InstancedHelper() {} @@ -37,7 +37,7 @@ protected: 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.*/ + /** Call after init() to issue draws to the GrMeshDrawOp::Target.*/ void recordDraw(Target*, const GrGeometryProcessor*); private: @@ -69,7 +69,7 @@ private: virtual void onPrepareDraws(Target*) const = 0; // A set of contiguous draws that share a draw token and primitive processor. The draws all use - // the batch's pipeline. The meshes for the draw are stored in the fMeshes array and each + // the op's pipeline. The meshes for the draw are stored in the fMeshes array and each // Queued draw uses fMeshCnt meshes from the fMeshes array. The reason for coallescing meshes // that share a primitive processor into a QueuedDraw is that it allows the Gpu object to setup // the shared state once and then issue draws for each mesh. @@ -78,8 +78,8 @@ private: GrPendingProgramElement<const GrGeometryProcessor> fGeometryProcessor; }; - // All draws in all the vertex batches have implicit tokens based on the order they are - // enqueued globally across all batches. This is the offset of the first entry in fQueuedDraws. + // All draws in all the GrMeshDrawOps have implicit tokens based on the order they are enqueued + // globally across all ops. This is the offset of the first entry in fQueuedDraws. // fQueuedDraws[i]'s token is fBaseDrawToken + i. GrDrawOpUploadToken fBaseDrawToken; diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp index 3995790d6f..afef8e6ba3 100644 --- a/src/gpu/ops/GrNonAAFillRectOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectOp.cpp @@ -20,7 +20,7 @@ static const int kVertsPerInstance = 4; static const int kIndicesPerInstance = 6; -/** We always use per-vertex colors so that rects can be batched across color changes. Sometimes +/** We always use per-vertex colors so that rects can be combined across color changes. Sometimes we have explicit local coords and sometimes not. We *could* always provide explicit local coords and just duplicate the positions when the caller hasn't provided a local coord rect, but we haven't seen a use case which frequently switches between local rect and no local @@ -98,7 +98,7 @@ public: SkString dumpInfo() const override { SkString str; - str.appendf("# batched: %d\n", fRects.count()); + str.appendf("# combined: %d\n", fRects.count()); for (int i = 0; i < fRects.count(); ++i) { const RectInfo& info = fRects[i]; str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", i, diff --git a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp index d58e52cd6d..9b6a857fea 100644 --- a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp @@ -18,7 +18,7 @@ static const int kVertsPerInstance = 4; static const int kIndicesPerInstance = 6; -/** We always use per-vertex colors so that rects can be batched across color changes. Sometimes +/** We always use per-vertex colors so that rects can be combined across color changes. Sometimes we have explicit local coords and sometimes not. We *could* always provide explicit local coords and just duplicate the positions when the caller hasn't provided a local coord rect, but we haven't seen a use case which frequently switches between local rect and no local @@ -88,7 +88,7 @@ static void tesselate(intptr_t vertices, } } -// We handle perspective in the local matrix or viewmatrix with special batches +// We handle perspective in the local matrix or viewmatrix with special ops. class NonAAFillRectPerspectiveOp final : public GrMeshDrawOp { public: DEFINE_OP_CLASS_ID @@ -111,11 +111,11 @@ public: this->setTransformedBounds(rect, viewMatrix, HasAABloat::kNo, IsZeroArea::kNo); } - const char* name() const override { return "NonAAFillRectPerspectiveBatch"; } + const char* name() const override { return "NonAAFillRectPerspectiveOp"; } SkString dumpInfo() const override { SkString str; - str.appendf("# batched: %d\n", fRects.count()); + str.appendf("# combined: %d\n", fRects.count()); for (int i = 0; i < fRects.count(); ++i) { const RectInfo& geo = fRects[0]; str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", i, @@ -189,7 +189,7 @@ private: return false; } - // We could batch across perspective vm changes if we really wanted to + // We could combine across perspective vm changes if we really wanted to. if (!fViewMatrix.cheapEqualTo(that->fViewMatrix)) { return false; } @@ -200,8 +200,8 @@ private: return false; } - // In the event of two batches, one who can tweak, one who cannot, we just fall back to - // not tweaking + // In the event of two ops, one who can tweak, one who cannot, we just fall back to not + // tweaking. if (fOptimizations.canTweakAlphaForCoverage() && !that->fOptimizations.canTweakAlphaForCoverage()) { fOptimizations = that->fOptimizations; diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp index 09eb656f10..160024131e 100644 --- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp @@ -49,7 +49,7 @@ class NonAAStrokeRectOp final : public GrMeshDrawOp { public: DEFINE_OP_CLASS_ID - const char* name() const override { return "NonAAStrokeRectBatch"; } + const char* name() const override { return "NonAAStrokeRectOp"; } SkString dumpInfo() const override { SkString string; @@ -165,8 +165,8 @@ private: } bool onCombineIfPossible(GrOp* t, const GrCaps&) override { - // NonAA stroke rects cannot batch right now - // TODO make these batchable + // NonAA stroke rects cannot combine right now + // TODO make these combinable. return false; } diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h index 827e58e77f..586d68598d 100644 --- a/src/gpu/ops/GrOp.h +++ b/src/gpu/ops/GrOp.h @@ -5,8 +5,8 @@ * found in the LICENSE file. */ -#ifndef GrBatch_DEFINED -#define GrBatch_DEFINED +#ifndef GrOp_DEFINED +#define GrOp_DEFINED #include "../private/SkAtomics.h" #include "GrGpuResource.h" @@ -22,10 +22,11 @@ class GrGpuCommandBuffer; class GrOpFlushState; /** - * GrOp is the base class for all Ganesh deferred GPU operations. To facilitate reorderable - * batching, Ganesh does not generate geometry inline with draw calls. Instead, it captures the - * arguments to the draw and then generates the geometry on demand. This gives GrOp subclasses - * complete freedom to decide how/what they can batch. + * GrOp is the base class for all Ganesh deferred GPU operations. To facilitate reordering and to + * minimize draw calls, Ganesh does not generate geometry inline with draw calls. Instead, it + * captures the arguments to the draw and then generates the geometry when flushing. This gives GrOp + * subclasses complete freedom to decide how/when to combine in order to produce fewer draw calls + * and minimize state changes. * * Ops of the same subclass may be merged using combineIfPossible. When two ops merge, one * takes on the union of the data and the other is left empty. The merged op becomes responsible @@ -126,7 +127,7 @@ public: /** Issues the op's commands to GrGpu. */ void draw(GrOpFlushState* state, const SkRect& bounds) { this->onDraw(state, bounds); } - /** Used to block batching across render target changes. Remove this once we store + /** Used to block combining across render target changes. Remove this once we store GrOps for different RTs in different targets. */ // TODO: this needs to be updated to return GrSurfaceProxy::UniqueID virtual GrGpuResource::UniqueID renderTargetUniqueID() const = 0; diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp index 321d15dbcc..5a9a077101 100644 --- a/src/gpu/ops/GrOvalOpFactory.cpp +++ b/src/gpu/ops/GrOvalOpFactory.cpp @@ -69,7 +69,7 @@ static inline bool circle_stays_circle(const SkMatrix& m) { return m.isSimilarit * Additional clip planes are supported for rendering circular arcs. The additional planes are * either intersected or unioned together. Up to three planes are supported (an initial plane, * a plane intersected with the initial plane, and a plane unioned with the first two). Only two - * are useful for any given arc, but having all three in one instance allows batching different + * are useful for any given arc, but having all three in one instance allows combining different * types of arcs. */ @@ -2275,8 +2275,8 @@ static sk_sp<GrDrawOp> make_rrect_op(GrColor color, SkASSERT(rrect.isSimple()); SkASSERT(!rrect.isOval()); - // RRect batchs only handle simple, but not too simple, rrects - // do any matrix crunching before we reset the draw state for device coords + // RRect ops only handle simple, but not too simple, rrects. + // Do any matrix crunching before we reset the draw state for device coords. const SkRect& rrectBounds = rrect.getBounds(); SkRect bounds; viewMatrix.mapRect(&bounds, rrectBounds); diff --git a/src/gpu/ops/GrRectOpFactory.h b/src/gpu/ops/GrRectOpFactory.h index 8d06cda19c..90263a00df 100644 --- a/src/gpu/ops/GrRectOpFactory.h +++ b/src/gpu/ops/GrRectOpFactory.h @@ -23,7 +23,7 @@ struct SkRect; class SkStrokeRec; /** - * A factory for returning batches which can draw rectangles. + * A factory for returning GrDrawOps which can draw rectangles. */ namespace GrRectOpFactory { diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp index 1128b927b2..4d45d80032 100644 --- a/src/gpu/ops/GrRegionOp.cpp +++ b/src/gpu/ops/GrRegionOp.cpp @@ -68,7 +68,7 @@ public: SkString dumpInfo() const override { SkString str; - str.appendf("# batched: %d\n", fRegions.count()); + str.appendf("# combined: %d\n", fRegions.count()); for (int i = 0; i < fRegions.count(); ++i) { const RegionInfo& info = fRegions[i]; str.appendf("%d: Color: 0x%08x, Region with %d rects\n", i, info.fColor, diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp index 5da8c29cac..b5829f4ba0 100755 --- a/src/gpu/ops/GrShadowRRectOp.cpp +++ b/src/gpu/ops/GrShadowRRectOp.cpp @@ -826,12 +826,12 @@ private: /////////////////////////////////////////////////////////////////////////////// -sk_sp<GrDrawOp> make_shadow_circle_batch(GrColor color, - const SkMatrix& viewMatrix, - const SkRect& oval, - SkScalar blurRadius, - const SkStrokeRec& stroke, - const GrShaderCaps* shaderCaps) { +sk_sp<GrDrawOp> make_shadow_circle_op(GrColor color, + const SkMatrix& viewMatrix, + const SkRect& oval, + SkScalar blurRadius, + const SkStrokeRec& stroke, + const GrShaderCaps* shaderCaps) { // we can only draw circles SkScalar width = oval.width(); SkASSERT(SkScalarNearlyEqual(width, oval.height()) && viewMatrix.isSimilarity()); @@ -840,17 +840,17 @@ sk_sp<GrDrawOp> make_shadow_circle_batch(GrColor color, GrStyle(stroke, nullptr)); } -static sk_sp<GrDrawOp> make_shadow_rrect_batch(GrColor color, - const SkMatrix& viewMatrix, - const SkRRect& rrect, - SkScalar blurRadius, - const SkStrokeRec& stroke) { +static sk_sp<GrDrawOp> make_shadow_rrect_op(GrColor color, + const SkMatrix& viewMatrix, + const SkRRect& rrect, + SkScalar blurRadius, + const SkStrokeRec& stroke) { SkASSERT(viewMatrix.rectStaysRect()); SkASSERT(rrect.isSimple()); SkASSERT(!rrect.isOval()); - // Shadow rrect batchs only handle simple circular rrects - // do any matrix crunching before we reset the draw state for device coords + // Shadow rrect ops only handle simple circular rrects. + // Do any matrix crunching before we reset the draw state for device coords. const SkRect& rrectBounds = rrect.getBounds(); SkRect bounds; viewMatrix.mapRect(&bounds, rrectBounds); @@ -909,15 +909,15 @@ sk_sp<GrDrawOp> Make(GrColor color, const SkStrokeRec& stroke, const GrShaderCaps* shaderCaps) { if (rrect.isOval()) { - return make_shadow_circle_batch(color, viewMatrix, rrect.getBounds(), blurRadius, stroke, - shaderCaps); + return make_shadow_circle_op(color, viewMatrix, rrect.getBounds(), blurRadius, stroke, + shaderCaps); } if (!viewMatrix.rectStaysRect() || !rrect.isSimple()) { return nullptr; } - return make_shadow_rrect_batch(color, viewMatrix, rrect, blurRadius, stroke); + return make_shadow_rrect_op(color, viewMatrix, rrect, blurRadius, stroke); } } /////////////////////////////////////////////////////////////////////////////// @@ -953,8 +953,8 @@ DRAW_OP_TEST_DEFINE(ShadowRRectOp) { GrColor color = GrRandomColor(random); const SkRRect& rrect = GrTest::TestRRectSimple(random); SkScalar blurRadius = random->nextSScalar1() * 72.f; - return make_shadow_rrect_batch(color, viewMatrix, rrect, blurRadius, - GrTest::TestStrokeRec(random)); + return make_shadow_rrect_op(color, viewMatrix, rrect, blurRadius, + GrTest::TestStrokeRec(random)); } #endif diff --git a/src/gpu/ops/GrTestMeshDrawOp.h b/src/gpu/ops/GrTestMeshDrawOp.h index 2878b6b103..7fc44e1593 100644 --- a/src/gpu/ops/GrTestMeshDrawOp.h +++ b/src/gpu/ops/GrTestMeshDrawOp.h @@ -14,8 +14,8 @@ #include "ops/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. + * A simple solid color GrMeshDrawOp for testing purposes which doesn't ever combine. Subclassing + * this in tests saves having to fill out some boiler plate methods. */ class GrTestMeshDrawOp : public GrMeshDrawOp { public: @@ -28,6 +28,17 @@ protected: this->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kYes); } + GrColor color() const { return fColor; } + + struct Optimizations { + bool fColorIgnored = false; + bool fUsesLocalCoords = false; + bool fCoverageIgnored = false; + }; + + const Optimizations optimizations() const { return fOptimizations; } + +private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { input->pipelineColorInput()->setKnownFourComponents(fColor); input->pipelineCoverageInput()->setUnknownSingleComponent(); @@ -41,16 +52,6 @@ protected: fOptimizations.fCoverageIgnored = !optimizations.readsCoverage(); } - struct Optimizations { - bool fColorIgnored = false; - bool fUsesLocalCoords = false; - bool fCoverageIgnored = false; - }; - - GrColor color() const { return fColor; } - const Optimizations optimizations() const { return fOptimizations; } - -private: bool onCombineIfPossible(GrOp*, const GrCaps&) override { return false; } GrColor fColor; |