From f3b995b628ef76bff28b9721dd1e182336156086 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 15 Feb 2017 10:22:23 -0500 Subject: 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 Commit-Queue: Brian Salomon --- src/gpu/effects/GrSingleTextureEffect.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gpu/effects/GrSingleTextureEffect.h') 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, 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; } } -- cgit v1.2.3