Remove (unused) shader caps from default GP factory functions

Change-Id: Id3313169be2fecfb8a11045f08a55490fbec9b9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276486
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Brian Osman 2020-03-12 09:28:44 -04:00 committed by Skia Commit-Bot
parent 9b449b73d3
commit f0aee749bf
14 changed files with 17 additions and 44 deletions

View File

@ -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<GrColorSpaceXform> colorSpaceXform,
@ -44,9 +43,9 @@ public:
const SkMatrix& localMatrix,
bool localCoordsWillBeRead,
uint8_t coverage) {
return arena->make<DefaultGeoProc>(shaderCaps, gpTypeFlags, color,
std::move(colorSpaceXform), viewMatrix, localMatrix,
coverage, localCoordsWillBeRead);
return arena->make<DefaultGeoProc>(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<GrColorSpaceXform> 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());
}

View File

@ -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&,

View File

@ -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"

View File

@ -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,

View File

@ -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(),

View File

@ -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,

View File

@ -439,7 +439,6 @@ private:
LocalCoords localCoords(fHelper.usesLocalCoords() ? LocalCoords::kUsePosition_Type
: LocalCoords::kUnused_Type);
gp = GrDefaultGeoProcFactory::Make(arena,
caps->shaderCaps(),
color,
coverage,
localCoords,

View File

@ -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());

View File

@ -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());

View File

@ -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"

View File

@ -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;

View File

@ -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(),

View File

@ -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);
}
}

View File

@ -106,7 +106,6 @@ private:
GrGeometryProcessor* gp = GrDefaultGeoProcFactory::Make(
arena,
caps->shaderCaps(),
Color::kPremulGrColorAttribute_Type,
Coverage::kSolid_Type,
fHasLocalRect ? LocalCoords::kHasExplicit_Type