aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrBlend.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-03-28 16:32:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-29 13:17:50 +0000
commit318538484f99253b6a2acf97d4d1b420e628b289 (patch)
treea698f31af79a873f16bad8847c50623bb44a19be /include/gpu/GrBlend.h
parent02bb6df0819d932a7a7ef8c6fb6914e3c5a0f4a2 (diff)
Remove GrXferProcessor::getOptimizations.
This replaces GrXferProcessor::getOptimizations with a new function on GrXPFactory. The results are made available via FragmentProcessorAnalysis. Bug: skia: Change-Id: I535985458c9d13ad858cac94e957e2fdbe332036 Reviewed-on: https://skia-review.googlesource.com/10218 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/GrBlend.h')
-rw-r--r--include/gpu/GrBlend.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/gpu/GrBlend.h b/include/gpu/GrBlend.h
index 5100bb0539..97a516650e 100644
--- a/include/gpu/GrBlend.h
+++ b/include/gpu/GrBlend.h
@@ -212,6 +212,9 @@ struct GrTBlendModifiesDst : skstd::bool_constant<
*
* By inspection we can see this will work as long as dstCoeff has a 1, and any other term in
* dstCoeff references S.
+ *
+ * Moreover, if the blend doesn't modify the dst at all then it is ok to arbitrarily modify the src
+ * color so folding in coverage is allowed.
*/
template<GrBlendEquation Equation, GrBlendCoeff SrcCoeff, GrBlendCoeff DstCoeff>
struct GrTBlendCanTweakAlphaForCoverage : skstd::bool_constant<
@@ -220,7 +223,8 @@ struct GrTBlendCanTweakAlphaForCoverage : skstd::bool_constant<
!GR_BLEND_COEFF_REFS_SRC(SrcCoeff) &&
(kOne_GrBlendCoeff == DstCoeff ||
kISC_GrBlendCoeff == DstCoeff ||
- kISA_GrBlendCoeff == DstCoeff))> {};
+ kISA_GrBlendCoeff == DstCoeff)) ||
+ !GrTBlendModifiesDst<Equation, SrcCoeff, DstCoeff>::value> {};
#define GR_BLEND_CAN_TWEAK_ALPHA_FOR_COVERAGE(EQUATION, SRC_COEFF, DST_COEFF) \
GrTBlendCanTweakAlphaForCoverage<EQUATION, SRC_COEFF, DST_COEFF>::value