aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrSingleTextureEffect.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-02-15 10:22:23 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-15 17:27:10 +0000
commitf3b995b628ef76bff28b9721dd1e182336156086 (patch)
treea0a0dcb7d12934495c445a73fe18bae9fda42bb7 /src/gpu/effects/GrSingleTextureEffect.h
parent2b512d00ef8d6a8eb200396ab0a64294e84c4fa4 (diff)
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>
Diffstat (limited to 'src/gpu/effects/GrSingleTextureEffect.h')
-rw-r--r--src/gpu/effects/GrSingleTextureEffect.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index 894334b751..74b25c7053 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -54,15 +54,17 @@ protected:
sk_sp<GrColorSpaceXform>, const SkMatrix&, const GrSamplerParams&);
/**
- * Can be used as a helper to implement subclass onOptimizationFlags(). It assumes that
- * the subclass output color will be a modulation of the input color with a value read from the
- * texture.
+ * Can be used as a helper to decide which fragment processor OptimizationFlags should be set.
+ * This assumes that the subclass output color will be a modulation of the input color with a
+ * value read from the texture and that the texture contains premultiplied color or alpha values
+ * that are in range.
*/
static OptimizationFlags ModulationFlags(GrPixelConfig config) {
if (GrPixelConfigIsOpaque(config)) {
- return kModulatesInput_OptimizationFlag | kPreservesOpaqueInput_OptimizationFlag;
+ return kCompatibleWithCoverageAsAlpha_OptimizationFlag |
+ kPreservesOpaqueInput_OptimizationFlag;
} else {
- return kModulatesInput_OptimizationFlag;
+ return kCompatibleWithCoverageAsAlpha_OptimizationFlag;
}
}