skia2/include/gpu
cdalton 9a70920db2 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:

Review URL: https://codereview.chromium.org/1124373002
2015-05-22 11:36:57 -07:00
..
effects Implement Porter Duff XP with a blend table 2015-05-22 11:36:57 -07:00
gl Make mixed samples contingent on auxiliary extensions 2015-05-21 08:27:44 -07:00
GrCaps.h Remove init from GrGLContextInfo and caps classes 2015-05-22 10:37:30 -07:00
GrClip.h Remove rect clip type from grclip. 2015-03-06 08:21:39 -08:00
GrColor.h Implement Porter Duff XP with a blend table 2015-05-22 11:36:57 -07:00
GrConfig.h Add flag to force gpu trace markers to be used and printed out for debugging. 2015-03-05 12:19:17 -08:00
GrContext.h add option to supress prints on context 2015-05-12 12:03:50 -07:00
GrCoordTransform.h some utils for rect and matrix 2015-03-13 06:08:28 -07:00
GrFragmentProcessor.h Pull out shader-specific caps into GrShaderCaps and GrGLSLCaps 2015-04-29 11:18:05 -07:00
GrFragmentStage.h removing coord change matrices 2014-12-29 09:04:40 -08:00
GrGpuResource.h Add mechanism to proactively purge old resources in GrResourceCache. 2015-04-08 11:01:55 -07:00
GrGpuResourceRef.h Simplify SkInstCnt 2015-01-13 08:22:44 -08:00
GrInvariantOutput.h Add constant color GrFP. 2015-04-02 11:12:09 -07:00
GrPaint.h Use SkXfermode as public facing enum for GrPorterDuffXP 2015-02-17 07:34:43 -08:00
GrPathRendererChain.h Extract gpu line dashing to GrDashLinePathRenderer 2015-04-26 23:18:50 -07:00
GrProcessor.h Remove GP from drawstate, revision of invariant output for GP 2014-12-11 15:44:02 -08:00
GrProcessorUnitTest.h rename GrDrawTargetCaps to GrCaps 2015-05-19 09:29:46 -07:00
GrProgramElement.h Simplify SkInstCnt 2015-01-13 08:22:44 -08:00
GrRect.h Begin atlasing 2014-06-30 08:26:50 -07:00
GrRenderTarget.h Rename GrStencilBuffer to GrStencilAttachment 2015-04-16 11:22:42 -07:00
GrResourceKey.h Make GrResourceCache perf less sensitive to key length change 2015-05-18 22:47:33 -07:00
GrShaderVar.h Refactor position computation to enable device space "nudge" 2015-01-18 08:14:14 -08:00
GrSurface.h Make uncached textures uncached from the get go. 2015-01-14 10:42:08 -08:00
GrTestUtils.h GLProgramsTest 3.0 2015-05-13 08:51:50 -07:00
GrTexture.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GrTextureAccess.h Simplify SkInstCnt 2015-01-13 08:22:44 -08:00
GrTextureProvider.h Revert of Refactor GrBufferAllocPools to use resource cache (patchset #9 id:160001 of https://codereview.chromium.org/1139753002/) 2015-05-14 05:24:53 -07:00
GrTypes.h Add RGBA half float texture format. 2015-05-21 08:12:27 -07:00
GrTypesPriv.h add option to supress prints on context 2015-05-12 12:03:50 -07:00
GrUserConfig.h Replace GrResourceCache with GrResourceCache2. 2014-11-14 12:10:15 -08:00
GrXferProcessor.h Implement Porter Duff XP with a blend table 2015-05-22 11:36:57 -07:00
SkGr.h new image from backend desc 2015-05-07 15:36:18 -07:00
SkGrPixelRef.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SkGrTexturePixelRef.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00