GrDrawVerticesOp::GrDrawVerticesOp(sk_sp<SkVertices> vertices, GrPrimitiveType primitiveType,
GrColor color,
GrRenderTargetContext::ColorArrayType colorArrayType,
- const SkMatrix& viewMatrix, uint32_t flags)
+ const SkMatrix& viewMatrix)
: INHERITED(ClassID()), fColorArrayType(colorArrayType) {
SkASSERT(vertices);
mesh.fColor = color;
mesh.fViewMatrix = viewMatrix;
mesh.fVertices = std::move(vertices);
- mesh.fFlags = flags;
+ mesh.fIgnoreTexCoords = false;
+ mesh.fIgnoreColors = false;
fFlags = 0;
if (mesh.hasPerVertexColors()) {
GrColor overrideColor;
if (optimizations.getOverrideColorIfSet(&overrideColor)) {
fMeshes[0].fColor = overrideColor;
- fMeshes[0].fFlags |= kIgnoreColors_VerticesFlag;
+ fMeshes[0].fIgnoreColors = true;
fFlags &= ~kRequiresPerVertexColors_Flag;
fColorArrayType = GrRenderTargetContext::ColorArrayType::kPremulGrColor;
}
if (optimizations.readsLocalCoords()) {
fFlags |= kPipelineRequiresLocalCoords_Flag;
} else {
- fFlags |= kIgnoreTexCoords_VerticesFlag;
+ fMeshes[0].fIgnoreTexCoords = true;
fFlags &= ~kAnyMeshHasExplicitLocalCoords;
}
}
public:
DEFINE_OP_CLASS_ID
- enum {
- kIgnoreTexCoords_VerticesFlag = 1 << 0,
- kIgnoreColors_VerticesFlag = 1 << 1,
- };
-
/**
* The 'color' param is used if the 'colors' array is null. 'bounds' is the bounds of the
* 'positions' array (in local space prior to application of 'viewMatrix'). If 'indices' is null
private:
GrDrawVerticesOp(sk_sp<SkVertices>, GrPrimitiveType, GrColor,
- GrRenderTargetContext::ColorArrayType, const SkMatrix& viewMatrix,
- uint32_t flags = 0);
+ GrRenderTargetContext::ColorArrayType, const SkMatrix& viewMatrix);
void getProcessorAnalysisInputs(GrProcessorAnalysisColor* color,
GrProcessorAnalysisCoverage* coverage) const override;
GrColor fColor; // Used if this->hasPerVertexColors() is false.
sk_sp<SkVertices> fVertices;
SkMatrix fViewMatrix;
- uint32_t fFlags;
+ bool fIgnoreTexCoords;
+ bool fIgnoreColors;
bool hasExplicitLocalCoords() const {
- return fVertices->hasTexCoords() && !(kIgnoreTexCoords_VerticesFlag & fFlags);
+ return fVertices->hasTexCoords() && !fIgnoreTexCoords;
}
bool hasPerVertexColors() const {
- return fVertices->hasColors() && !(kIgnoreColors_VerticesFlag & fFlags);
+ return fVertices->hasColors() && !fIgnoreColors;
}
};