diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp index 03b3cdf957..8840abe3a3 100644 --- a/src/gpu/GrDefaultGeoProcFactory.cpp +++ b/src/gpu/GrDefaultGeoProcFactory.cpp @@ -36,7 +36,6 @@ enum GPFlag { class DefaultGeoProc : public GrGeometryProcessor { public: static GrGeometryProcessor* Make(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, uint32_t gpTypeFlags, const SkPMColor4f& color, sk_sp colorSpaceXform, @@ -44,9 +43,9 @@ public: const SkMatrix& localMatrix, bool localCoordsWillBeRead, uint8_t coverage) { - return arena->make(shaderCaps, gpTypeFlags, color, - std::move(colorSpaceXform), viewMatrix, localMatrix, - coverage, localCoordsWillBeRead); + return arena->make(gpTypeFlags, color, std::move(colorSpaceXform), + viewMatrix, localMatrix, coverage, + localCoordsWillBeRead); } const char* name() const override { return "DefaultGeometryProcessor"; } @@ -230,8 +229,7 @@ public: private: friend class ::SkArenaAlloc; // for access to ctor - DefaultGeoProc(const GrShaderCaps* shaderCaps, - uint32_t gpTypeFlags, + DefaultGeoProc(uint32_t gpTypeFlags, const SkPMColor4f& color, sk_sp colorSpaceXform, const SkMatrix& viewMatrix, @@ -302,7 +300,7 @@ GrGeometryProcessor* DefaultGeoProc::TestCreate(GrProcessorTestData* d) { flags |= kLocalCoordAttribute_GPFlag; } - return DefaultGeoProc::Make(d->allocator(), d->caps()->shaderCaps(), + return DefaultGeoProc::Make(d->allocator(), flags, SkPMColor4f::FromBytes_RGBA(GrRandomColor(d->fRandom)), GrTest::TestColorXform(d->fRandom), @@ -314,7 +312,6 @@ GrGeometryProcessor* DefaultGeoProc::TestCreate(GrProcessorTestData* d) { #endif GrGeometryProcessor* GrDefaultGeoProcFactory::Make(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, const Color& color, const Coverage& coverage, const LocalCoords& localCoords, @@ -338,7 +335,6 @@ GrGeometryProcessor* GrDefaultGeoProcFactory::Make(SkArenaAlloc* arena, bool localCoordsWillBeRead = localCoords.fType != LocalCoords::kUnused_Type; return DefaultGeoProc::Make(arena, - shaderCaps, flags, color.fColor, color.fColorSpaceXform, @@ -349,7 +345,6 @@ GrGeometryProcessor* GrDefaultGeoProcFactory::Make(SkArenaAlloc* arena, } GrGeometryProcessor* GrDefaultGeoProcFactory::MakeForDeviceSpace(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, const Color& color, const Coverage& coverage, const LocalCoords& localCoords, @@ -367,5 +362,5 @@ GrGeometryProcessor* GrDefaultGeoProcFactory::MakeForDeviceSpace(SkArenaAlloc* a } LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); - return Make(arena, shaderCaps, color, coverage, inverted, SkMatrix::I()); + return Make(arena, color, coverage, inverted, SkMatrix::I()); } diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h index 3f7fffa02f..8a12d1424b 100644 --- a/src/gpu/GrDefaultGeoProcFactory.h +++ b/src/gpu/GrDefaultGeoProcFactory.h @@ -10,7 +10,6 @@ #include "src/gpu/GrColorSpaceXform.h" #include "src/gpu/GrGeometryProcessor.h" -#include "src/gpu/GrShaderCaps.h" /* * A factory for creating default Geometry Processors which simply multiply position by the uniform @@ -77,7 +76,6 @@ namespace GrDefaultGeoProcFactory { }; GrGeometryProcessor* Make(SkArenaAlloc*, - const GrShaderCaps*, const Color&, const Coverage&, const LocalCoords&, @@ -89,7 +87,6 @@ namespace GrDefaultGeoProcFactory { * coordinates for GrFragmentProcessors. It may fail if the view matrix is not invertible. */ GrGeometryProcessor* MakeForDeviceSpace(SkArenaAlloc*, - const GrShaderCaps*, const Color&, const Coverage&, const LocalCoords&, diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp index 194e28e18a..5cc8339760 100644 --- a/src/gpu/GrTessellator.cpp +++ b/src/gpu/GrTessellator.cpp @@ -7,7 +7,6 @@ #include "src/gpu/GrTessellator.h" -#include "src/gpu/GrDefaultGeoProcFactory.h" #include "src/gpu/GrEagerVertexAllocator.h" #include "src/gpu/GrVertexWriter.h" #include "src/gpu/geometry/GrPathUtils.h" diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 55969de22a..a8dbbce63f 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -944,7 +944,6 @@ GrGeometryProcessor* AAHairlineOp::makeLineGP(const GrCaps& caps, SkArenaAlloc* localCoords.fMatrix = geometryProcessorLocalM; GrGeometryProcessor* lineGP = GrDefaultGeoProcFactory::Make(arena, - caps.shaderCaps(), color, Coverage::kAttribute_Type, localCoords, diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index c306f0ba6a..f1dac6a072 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -97,7 +97,6 @@ static void extract_verts(const GrAAConvexTessellator& tess, } static GrGeometryProcessor* create_lines_only_gp(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, bool tweakAlphaForCoverage, const SkMatrix& viewMatrix, bool usesLocalCoords, @@ -111,8 +110,7 @@ static GrGeometryProcessor* create_lines_only_gp(SkArenaAlloc* arena, Color::Type colorType = wideColor ? Color::kPremulWideColorAttribute_Type : Color::kPremulGrColorAttribute_Type; - return MakeForDeviceSpace(arena, shaderCaps, colorType, coverageType, - localCoordsType, viewMatrix); + return MakeForDeviceSpace(arena, colorType, coverageType, localCoordsType, viewMatrix); } namespace { @@ -241,7 +239,6 @@ private: void onPrepareDraws(Target* target) override { // Setup GrGeometryProcessor GrGeometryProcessor* gp = create_lines_only_gp(target->allocator(), - target->caps().shaderCaps(), fHelper.compatibleWithCoverageAsAlpha(), this->viewMatrix(), fHelper.usesLocalCoords(), diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp index 9de95be9ff..c7f18b3769 100644 --- a/src/gpu/ops/GrDashOp.cpp +++ b/src/gpu/ops/GrDashOp.cpp @@ -345,7 +345,6 @@ private: LocalCoords::Type localCoordsType = fUsesLocalCoords ? LocalCoords::kUsePosition_Type : LocalCoords::kUnused_Type; gp = MakeForDeviceSpace(arena, - caps->shaderCaps(), color, Coverage::kSolid_Type, localCoordsType, diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index 329513e916..eb57608870 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -439,7 +439,6 @@ private: LocalCoords localCoords(fHelper.usesLocalCoords() ? LocalCoords::kUsePosition_Type : LocalCoords::kUnused_Type); gp = GrDefaultGeoProcFactory::Make(arena, - caps->shaderCaps(), color, coverage, localCoords, diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp index 9f0f50f611..88f646d1c3 100644 --- a/src/gpu/ops/GrDrawAtlasOp.cpp +++ b/src/gpu/ops/GrDrawAtlasOp.cpp @@ -93,7 +93,6 @@ private: }; static GrGeometryProcessor* make_gp(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, bool hasColors, const SkPMColor4f& color, const SkMatrix& viewMatrix) { @@ -103,7 +102,7 @@ static GrGeometryProcessor* make_gp(SkArenaAlloc* arena, gpColor.fType = Color::kPremulGrColorAttribute_Type; } - return GrDefaultGeoProcFactory::Make(arena, shaderCaps, gpColor, Coverage::kSolid_Type, + return GrDefaultGeoProcFactory::Make(arena, gpColor, Coverage::kSolid_Type, LocalCoords::kHasExplicit_Type, viewMatrix); } @@ -209,7 +208,6 @@ void DrawAtlasOp::onCreateProgramInfo(const GrCaps* caps, const GrXferProcessor::DstProxyView& dstProxyView) { // Setup geometry processor GrGeometryProcessor* gp = make_gp(arena, - caps->shaderCaps(), this->hasColors(), this->color(), this->viewMatrix()); diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 72354bd64a..2695ddae1c 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -65,7 +65,7 @@ private: void onPrepareDraws(Target*) override; void onExecute(GrOpFlushState*, const SkRect& chainBounds) override; - GrGeometryProcessor* makeGP(SkArenaAlloc*, const GrShaderCaps*); + GrGeometryProcessor* makeGP(SkArenaAlloc*); GrPrimitiveType primitiveType() const { return fPrimitiveType; } bool combinablePrimitive() const { @@ -218,7 +218,7 @@ GrProcessorSet::Analysis DrawVerticesOp::finalize( return result; } -GrGeometryProcessor* DrawVerticesOp::makeGP(SkArenaAlloc* arena, const GrShaderCaps* shaderCaps) { +GrGeometryProcessor* DrawVerticesOp::makeGP(SkArenaAlloc* arena) { using namespace GrDefaultGeoProcFactory; LocalCoords::Type localCoordsType; if (fHelper.usesLocalCoords()) { @@ -249,7 +249,6 @@ GrGeometryProcessor* DrawVerticesOp::makeGP(SkArenaAlloc* arena, const GrShaderC fFlags |= kWasCharacterized_Flag; return GrDefaultGeoProcFactory::Make(arena, - shaderCaps, color, Coverage::kSolid_Type, localCoordsType, @@ -261,7 +260,7 @@ void DrawVerticesOp::onCreateProgramInfo(const GrCaps* caps, const GrSurfaceProxyView* outputView, GrAppliedClip&& appliedClip, const GrXferProcessor::DstProxyView& dstProxyView) { - GrGeometryProcessor* gp = this->makeGP(arena, caps->shaderCaps()); + GrGeometryProcessor* gp = this->makeGP(arena); fProgramInfo = fHelper.createProgramInfo(caps, arena, outputView, std::move(appliedClip), dstProxyView, gp, this->primitiveType()); diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp index 4babb82386..78fc2a3c6c 100644 --- a/src/gpu/ops/GrLatticeOp.cpp +++ b/src/gpu/ops/GrLatticeOp.cpp @@ -9,7 +9,6 @@ #include "include/core/SkRect.h" #include "src/core/SkLatticeIter.h" #include "src/core/SkMatrixPriv.h" -#include "src/gpu/GrDefaultGeoProcFactory.h" #include "src/gpu/GrDrawOpTest.h" #include "src/gpu/GrGpu.h" #include "src/gpu/GrOpFlushState.h" diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp index 172d219fd8..74b264fbf9 100644 --- a/src/gpu/ops/GrRegionOp.cpp +++ b/src/gpu/ops/GrRegionOp.cpp @@ -20,13 +20,12 @@ #include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h" static GrGeometryProcessor* make_gp(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, const SkMatrix& viewMatrix, bool wideColor) { using namespace GrDefaultGeoProcFactory; Color::Type colorType = wideColor ? Color::kPremulWideColorAttribute_Type : Color::kPremulGrColorAttribute_Type; - return GrDefaultGeoProcFactory::Make(arena, shaderCaps, colorType, Coverage::kSolid_Type, + return GrDefaultGeoProcFactory::Make(arena, colorType, Coverage::kSolid_Type, LocalCoords::kUsePosition_Type, viewMatrix); } @@ -104,7 +103,7 @@ private: const GrSurfaceProxyView* outputView, GrAppliedClip&& appliedClip, const GrXferProcessor::DstProxyView& dstProxyView) override { - GrGeometryProcessor* gp = make_gp(arena, caps->shaderCaps(), fViewMatrix, fWideColor); + GrGeometryProcessor* gp = make_gp(arena, fViewMatrix, fWideColor); if (!gp) { SkDebugf("Couldn't create GrGeometryProcessor\n"); return; diff --git a/src/gpu/ops/GrStrokeRectOp.cpp b/src/gpu/ops/GrStrokeRectOp.cpp index d777c5a141..a4f0433a40 100644 --- a/src/gpu/ops/GrStrokeRectOp.cpp +++ b/src/gpu/ops/GrStrokeRectOp.cpp @@ -193,8 +193,7 @@ private: LocalCoords::Type localCoordsType = fHelper.usesLocalCoords() ? LocalCoords::kUsePosition_Type : LocalCoords::kUnused_Type; - gp = GrDefaultGeoProcFactory::Make(arena, caps->shaderCaps(), - color, Coverage::kSolid_Type, localCoordsType, + gp = GrDefaultGeoProcFactory::Make(arena, color, Coverage::kSolid_Type, localCoordsType, fViewMatrix); } @@ -348,7 +347,6 @@ static void compute_aa_rects(SkRect* devOutside, SkRect* devOutsideAssist, SkRec } static GrGeometryProcessor* create_aa_stroke_rect_gp(SkArenaAlloc* arena, - const GrShaderCaps* shaderCaps, bool tweakAlphaForCoverage, const SkMatrix& viewMatrix, bool usesLocalCoords, @@ -362,8 +360,7 @@ static GrGeometryProcessor* create_aa_stroke_rect_gp(SkArenaAlloc* arena, Color::Type colorType = wideColor ? Color::kPremulWideColorAttribute_Type: Color::kPremulGrColorAttribute_Type; - return MakeForDeviceSpace(arena, shaderCaps, colorType, coverageType, - localCoordsType, viewMatrix); + return MakeForDeviceSpace(arena, colorType, coverageType, localCoordsType, viewMatrix); } class AAStrokeRectOp final : public GrMeshDrawOp { @@ -541,7 +538,6 @@ void AAStrokeRectOp::onCreateProgramInfo(const GrCaps* caps, const GrXferProcessor::DstProxyView& dstProxyView) { GrGeometryProcessor* gp = create_aa_stroke_rect_gp(arena, - caps->shaderCaps(), fHelper.compatibleWithCoverageAsAlpha(), this->viewMatrix(), fHelper.usesLocalCoords(), diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp index 14c5709871..9fa75d2ee2 100644 --- a/src/gpu/ops/GrTessellatingPathRenderer.cpp +++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp @@ -345,12 +345,10 @@ private: coverageType = Coverage::kSolid_Type; } if (fAntiAlias) { - gp = GrDefaultGeoProcFactory::MakeForDeviceSpace(arena, caps->shaderCaps(), - color, coverageType, + gp = GrDefaultGeoProcFactory::MakeForDeviceSpace(arena, color, coverageType, localCoordsType, fViewMatrix); } else { - gp = GrDefaultGeoProcFactory::Make(arena, caps->shaderCaps(), - color, coverageType, localCoordsType, + gp = GrDefaultGeoProcFactory::Make(arena, color, coverageType, localCoordsType, fViewMatrix); } } diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp index eb425b93e0..a88a847a58 100644 --- a/tests/OnFlushCallbackTest.cpp +++ b/tests/OnFlushCallbackTest.cpp @@ -106,7 +106,6 @@ private: GrGeometryProcessor* gp = GrDefaultGeoProcFactory::Make( arena, - caps->shaderCaps(), Color::kPremulGrColorAttribute_Type, Coverage::kSolid_Type, fHasLocalRect ? LocalCoords::kHasExplicit_Type