aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrTypesPriv.h23
-rw-r--r--src/gpu/GrPipelineBuilder.cpp3
-rw-r--r--src/gpu/GrRenderTargetContext.cpp2
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp2
4 files changed, 22 insertions, 8 deletions
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index 53e71e74ab..a0e96a2a22 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -26,10 +26,25 @@ enum class GrAAType {
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,
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index f2dd1acc4e..6a0dd1992e 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -31,8 +31,7 @@ GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrAAType aaType)
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,
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 0fcd4ca37f..af50d873cc 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1562,7 +1562,7 @@ void GrRenderTargetContext::internalDrawPath(const GrClip& clip,
// 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;
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 460f4842f8..15d7b75d12 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -354,7 +354,7 @@ void GrRenderTargetOpList::stencilPath(GrRenderTargetContext* renderTargetContex
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());