Update invariant output computation for various texture effects.
Update various effects that read in textures to check whether or not the texture is alpha only.
This allows us to use a more specific mulByUnKnownAlpha instead of the more general mulByUnknownColor
BUG=skia:
Review URL: https://codereview.chromium.org/759653004
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index bff8772..c01dd97 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -229,7 +229,9 @@
}
void AlphaThresholdEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
- if (GrPixelConfigIsOpaque(this->texture(0)->config()) && fOuterThreshold >= 1.f) {
+ if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
+ inout->mulByUnknownAlpha();
+ } else if (GrPixelConfigIsOpaque(this->texture(0)->config()) && fOuterThreshold >= 1.f) {
inout->mulByUnknownOpaqueColor();
} else {
inout->mulByUnknownColor();