aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrXferProcessor.h
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-05-22 17:55:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-22 17:55:26 -0700
commitc33db93d1b285923b5deef97ecb04d4d01e05dd5 (patch)
tree1dbb22f4cea24efb7c97c72041695d73b5ac14bf /include/gpu/GrXferProcessor.h
parentc319c80d09c6e9c681041f9e9db7b6bcbae542cc (diff)
Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)
Reason for revert: Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert ../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()" Original issue's description: > Implement Porter Duff XP with a blend table > > Removes the runtime logic used by PorterDuffXferProcessor to decide > blend coeffs and shader outputs, and instead uses a compile-time > constant table of pre-selected blend formulas. > > Introduces a new blend strategy for srcCoeff=0 that can apply coverage > with a reverse subtract blend equation instead of dual source > blending. > > Adds new macros in GrBlend.h to analyze blend formulas both runtime. > > Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no > longer used. > > Adds a GM that verifies all xfermodes, including arithmetic, with the > color/coverage invariants used by Porter Duff. > > Adds a unit test that verifies each Porter Duff formula with every > color/coverage invariant. > > Major changes: > > * Uses a reverse subtract blend equation for coverage when srcCoeff=0 > (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't > support dual source blending no longer require a dst copy for > dst-in and modulate. > > * Sets BlendInfo::fWriteColor to false when the blend does not modify > the dst. GrGLGpu will now use glColorMask instead of blending for > these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]). > > * Converts all SA blend coeffs to One for opaque inputs, and ISA to > Zero if there is also no coverage. (We keep ISA around when there > is coverage because we use it to tweak alpha for coverage.) > > * Abandons solid white optimizations for the sake of simplicity > (screen was the only mode that previous had solid white opts). > > Minor differences: > > * Inconsequential differences in opt flags (e.g. we now return > kCanTweakAlphaForCoverage_OptFlag even when there is no coverage). > > * Src coeffs when the shader outputs 0. > > * IS2C vs IS2A when the secondary output is scalar. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414 TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1153993002
Diffstat (limited to 'include/gpu/GrXferProcessor.h')
-rw-r--r--include/gpu/GrXferProcessor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index 85e5aa04ed..8458a620fe 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -51,6 +51,10 @@ enum GrBlendEquation {
static const int kGrBlendEquationCnt = kLast_GrBlendEquation + 1;
+inline bool GrBlendEquationIsAdvanced(GrBlendEquation equation) {
+ return equation >= kFirstAdvancedGrBlendEquation;
+}
+
/**
* Coeffecients for alpha-blending.
*/
@@ -139,6 +143,10 @@ public:
*/
kOverrideColor_OptFlag = 0x8,
/**
+ * Set CoverageDrawing_StateBit
+ */
+ kSetCoverageDrawing_OptFlag = 0x10,
+ /**
* Can tweak alpha for coverage. Currently this flag should only be used by a batch
*/
kCanTweakAlphaForCoverage_OptFlag = 0x20,