skia2/tests/sksl/blend/golden
John Stiles 1a49a5334c Restructure blend functions to allow for smarter inlining.
Early returns can cause the inliner to generate suboptimal code. We
control our built-ins, so let's avoid them where we can.

Patterns like this challenge the inliner:
    if (x) return y;
    return z;

But this can be replaced by equivalent code that inlines better:
    return x ? y : z;

Or, if a ternary can't be used, this also does a better job:
    if (x) return y;
    else return z;

In several cases, this allows the inliner to avoid generating a
do-while(false) block for control flow.

Change-Id: I921c929122297c40476ff15b4da631fc1581e308
Bug: skia:10737
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318211
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-21 22:42:01 +00:00
..
BlendClear.glsl
BlendClearStandaloneSettings.glsl
BlendColor.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendColorBurn.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendColorBurnStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendColorDodge.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendColorDodgeStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendColorStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendDarken.glsl
BlendDarkenStandaloneSettings.glsl
BlendDifference.glsl
BlendDifferenceStandaloneSettings.glsl
BlendDst.glsl
BlendDstAtop.glsl
BlendDstAtopStandaloneSettings.glsl
BlendDstIn.glsl
BlendDstInStandaloneSettings.glsl
BlendDstOut.glsl
BlendDstOutStandaloneSettings.glsl
BlendDstOver.glsl
BlendDstOverStandaloneSettings.glsl
BlendDstStandaloneSettings.glsl
BlendExclusion.glsl
BlendExclusionStandaloneSettings.glsl
BlendHardLight.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendHardLightStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendHue.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendHueStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendLighten.glsl
BlendLightenStandaloneSettings.glsl
BlendLuminosity.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendLuminosityStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendModulate.glsl
BlendModulateStandaloneSettings.glsl
BlendMultiply.glsl
BlendMultiplyStandaloneSettings.glsl
BlendOverlap.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendOverlapStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendPlus.glsl
BlendPlusStandaloneSettings.glsl
BlendSaturation.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendSaturationStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendScreen.glsl
BlendScreenStandaloneSettings.glsl
BlendSoftLight.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendSoftLightStandaloneSettings.glsl Restructure blend functions to allow for smarter inlining. 2020-09-21 22:42:01 +00:00
BlendSrc.glsl
BlendSrcAtop.glsl
BlendSrcAtopStandaloneSettings.glsl
BlendSrcIn.glsl
BlendSrcInStandaloneSettings.glsl
BlendSrcOut.glsl
BlendSrcOutStandaloneSettings.glsl
BlendSrcOver.glsl
BlendSrcOverStandaloneSettings.glsl
BlendSrcStandaloneSettings.glsl
BlendXor.glsl
BlendXorStandaloneSettings.glsl