Clarify when tweak alpha for coverage optimizaton can occur.
Also refer to it directly rather than using the term "modulate"
Change-Id: Ifa44a4d46e1be11b567943f58ead24e38f10d03b
Reviewed-on: https://skia-review.googlesource.com/8488
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index 5433b67..8488fec 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -289,9 +289,12 @@
case SkBlendMode::kSrcIn:
case SkBlendMode::kDstIn:
case SkBlendMode::kModulate:
- flags = fp->preservesOpaqueInput()
- ? kPreservesOpaqueInput_OptimizationFlag | kModulatesInput_OptimizationFlag
- : kModulatesInput_OptimizationFlag;
+ if (fp->preservesOpaqueInput()) {
+ flags = kPreservesOpaqueInput_OptimizationFlag |
+ kCompatibleWithCoverageAsAlpha_OptimizationFlag;
+ } else {
+ flags = kCompatibleWithCoverageAsAlpha_OptimizationFlag;
+ }
break;
// Produces zero when both are opaque, indeterminate if one is opaque.