skia2/tests/sksl/blend/BlendHardLight.glsl
Brian Osman 3e4ef49890 Remove SkBlendMode from SkSL
We've lived without this for a long time. It bloats sksl_gpu (inhibits
some inlining!), and if things go according to plan, we'll be removing
enum support from SkSL entirely soon.

Change-Id: If844bbe5fdae41df7930d5c8ea9b832f9dd1b922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419099
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-16 21:01:30 +00:00

13 lines
546 B
GLSL

#version 400
out vec4 sk_FragColor;
uniform vec4 src;
uniform vec4 dst;
float _blend_overlay_component_hh2h2(vec2 s, vec2 d) {
return 2.0 * d.x <= d.y ? (2.0 * s.x) * d.x : s.y * d.y - (2.0 * (d.y - d.x)) * (s.y - s.x);
}
void main() {
vec4 _0_result = vec4(_blend_overlay_component_hh2h2(dst.xw, src.xw), _blend_overlay_component_hh2h2(dst.yw, src.yw), _blend_overlay_component_hh2h2(dst.zw, src.zw), dst.w + (1.0 - dst.w) * src.w);
_0_result.xyz += src.xyz * (1.0 - dst.w) + dst.xyz * (1.0 - src.w);
sk_FragColor = _0_result;
}