kMixedSamples
};
- /**
- * Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars,
- * but should be applicable to other shader languages.)
- */
+static inline bool GrAATypeIsHW(GrAAType type) {
+ switch (type) {
+ case GrAAType::kNone:
+ return false;
+ case GrAAType::kCoverage:
+ return false;
+ case GrAAType::kMSAA:
+ return true;
+ case GrAAType::kMixedSamples:
+ return true;
+ }
+ SkFAIL("Unknown AA Type");
+ return false;
+}
+
+/**
+ * Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars,
+ * but should be applicable to other shader languages.)
+ */
enum GrSLType {
kVoid_GrSLType,
kBool_GrSLType,
fXPFactory.reset(SkSafeRef(paint.getXPFactory()));
- this->setState(GrPipelineBuilder::kHWAntialias_Flag, GrAAType::kMSAA == aaType ||
- GrAAType::kMixedSamples == aaType);
+ this->setState(GrPipelineBuilder::kHWAntialias_Flag, GrAATypeIsHW(aaType));
this->setState(GrPipelineBuilder::kDisableOutputConversionToSRGB_Flag,
paint.getDisableOutputConversionToSRGB());
this->setState(GrPipelineBuilder::kAllowSRGBInputs_Flag,
// This time, allow SW renderer
pr = fDrawingManager->getPathRenderer(canDrawArgs, true, kType);
}
- if (!pr && (aaType == GrAAType::kMixedSamples || aaType == GrAAType::kMSAA)) {
+ if (!pr && GrAATypeIsHW(aaType)) {
// There are exceptional cases where we may wind up falling back to coverage based AA
// when the target is MSAA (e.g. through disabling path renderers via GrContextOptions).
aaType = GrAAType::kCoverage;
GrAAType aaType,
const SkMatrix& viewMatrix,
const GrPath* path) {
- bool useHWAA = (aaType == GrAAType::kMSAA || aaType == GrAAType::kMixedSamples);
+ bool useHWAA = GrAATypeIsHW(aaType);
// TODO: extract portions of checkDraw that are relevant to path stenciling.
SkASSERT(path);
SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport());