summaryrefslogtreecommitdiff
path: root/shaders/skia/1735.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/skia/1735.shader_test')
-rw-r--r--shaders/skia/1735.shader_test146
1 files changed, 146 insertions, 0 deletions
diff --git a/shaders/skia/1735.shader_test b/shaders/skia/1735.shader_test
new file mode 100644
index 0000000..2005217
--- /dev/null
+++ b/shaders/skia/1735.shader_test
@@ -0,0 +1,146 @@
+[require]
+GLSL >= 1.40
+
+[fragment shader]
+#version 140
+
+out vec4 sk_FragColor;
+uniform vec4 ucircleData_Stage1_c1_c0_c0_c0;
+uniform vec4 uinnerRect_Stage1_c1_c0_c1_c0;
+uniform vec2 uinvRadiiXY_Stage1_c1_c0_c1_c0;
+uniform sampler2D uTextureSampler_0_Stage1;
+noperspective in vec2 vEllipseOffsets_Stage0;
+noperspective in vec4 vEllipseRadii_Stage0;
+noperspective in vec4 vinColor_Stage0;
+vec4 ConfigConversionEffect_Stage1_c0_c0_c0_c0(vec4 _input) {
+ vec4 _output;
+ _output = floor(_input * 255.0 + 0.5) / 255.0;
+ {
+ _output.xyz = _output.w <= 0.0 ? vec3(0.0) : floor((_output.xyz / _output.w) * 255.0 + 0.5) / 255.0;
+ }
+ return _output;
+}
+vec4 ConfigConversionEffect_Stage1_c0_c0_c1_c0(vec4 _input) {
+ vec4 _output;
+ _output = floor(_input * 255.0 + 0.5) / 255.0;
+ {
+ _output.xyz = _output.w <= 0.0 ? vec3(0.0) : floor((_output.xyz / _output.w) * 255.0 + 0.5) / 255.0;
+ }
+ return _output;
+}
+vec4 blend_modulate(vec4 src, vec4 dst) {
+ return src * dst;
+}
+vec4 ComposeTwo_Stage1_c0_c0(vec4 _input) {
+ vec4 _output;
+ vec4 inputColor = vec4(_input.xyz, 1.0);
+ _output = blend_modulate(ConfigConversionEffect_Stage1_c0_c0_c0_c0(inputColor), ConfigConversionEffect_Stage1_c0_c0_c1_c0(inputColor));
+ _output *= _input.w;
+ return _output;
+}
+vec4 CircleBlurFragmentProcessor_Stage1_c1_c0_c0_c0(vec4 _input) {
+ vec4 _output;
+ vec2 vec = vec2((gl_FragCoord.x - ucircleData_Stage1_c1_c0_c0_c0.x) * ucircleData_Stage1_c1_c0_c0_c0.w, (gl_FragCoord.y - ucircleData_Stage1_c1_c0_c0_c0.y) * ucircleData_Stage1_c1_c0_c0_c0.w);
+ float dist = length(vec) + (0.5 - ucircleData_Stage1_c1_c0_c0_c0.z) * ucircleData_Stage1_c1_c0_c0_c0.w;
+ _output = _input * texture(uTextureSampler_0_Stage1, vec2(dist, 0.5)).w;
+ return _output;
+}
+vec4 EllipticalRRect_Stage1_c1_c0_c1_c0(vec4 _input) {
+ vec4 _output;
+ vec2 dxy0 = uinnerRect_Stage1_c1_c0_c1_c0.xy - gl_FragCoord.xy;
+ vec2 dxy1 = gl_FragCoord.xy - uinnerRect_Stage1_c1_c0_c1_c0.zw;
+ vec2 dxy = max(max(dxy0, dxy1), 0.0);
+ vec2 Z = dxy * uinvRadiiXY_Stage1_c1_c0_c1_c0;
+ float implicit = dot(Z, dxy) - 1.0;
+ float grad_dot = 4.0 * dot(Z, Z);
+ grad_dot = max(grad_dot, 9.9999997473787516e-05);
+ float approx_dist = implicit * inversesqrt(grad_dot);
+ float alpha = clamp(0.5 - approx_dist, 0.0, 1.0);
+ _output = _input * alpha;
+ return _output;
+}
+float _guarded_divide(float n, float d) {
+ return n / d;
+}
+float _color_burn_component(float sc, float sa, float dc, float da) {
+ if (da == dc) {
+ return (sa * da + sc * (1.0 - da)) + dc * (1.0 - sa);
+ } else if (sc == 0.0) {
+ return dc * (1.0 - sa);
+ }
+ float d = max(0.0, da - _guarded_divide((da - dc) * sa, sc));
+ return (d * sa + sc * (1.0 - da)) + dc * (1.0 - sa);
+}
+vec4 blend_color_burn(vec4 src, vec4 dst) {
+ return vec4(_color_burn_component(src.x, src.w, dst.x, dst.w), _color_burn_component(src.y, src.w, dst.y, dst.w), _color_burn_component(src.z, src.w, dst.z, dst.w), src.w + (1.0 - src.w) * dst.w);
+}
+vec4 ComposeTwo_Stage1_c1_c0(vec4 _input) {
+ vec4 _output;
+ vec4 inputColor = vec4(_input.xyz, 1.0);
+ _output = blend_color_burn(CircleBlurFragmentProcessor_Stage1_c1_c0_c0_c0(inputColor), EllipticalRRect_Stage1_c1_c0_c1_c0(inputColor));
+ _output *= _input.w;
+ return _output;
+}
+float _blend_overlay_component(float sc, float sa, float dc, float da) {
+ if (2.0 * dc <= da) {
+ return (2.0 * sc) * dc;
+ }
+ return sa * da - (2.0 * (da - dc)) * (sa - sc);
+}
+vec4 blend_overlay(vec4 src, vec4 dst) {
+ vec4 result = vec4(_blend_overlay_component(src.x, src.w, dst.x, dst.w), _blend_overlay_component(src.y, src.w, dst.y, dst.w), _blend_overlay_component(src.z, src.w, dst.z, dst.w), src.w + (1.0 - src.w) * dst.w);
+ result.xyz += dst.xyz * (1.0 - src.w) + src.xyz * (1.0 - dst.w);
+ return result;
+}
+void main() {
+ vec4 outputColor_Stage0;
+ vec4 outputCoverage_Stage0;
+ {
+ outputColor_Stage0 = vinColor_Stage0;
+ vec2 offset = vEllipseOffsets_Stage0;
+ offset *= vEllipseRadii_Stage0.xy;
+ float test = dot(offset, offset) - 1.0;
+ vec2 grad = (2.0 * offset) * vEllipseRadii_Stage0.xy;
+ float grad_dot = dot(grad, grad);
+ grad_dot = max(grad_dot, 1.1754999560161448e-38);
+ float invlen = inversesqrt(grad_dot);
+ float edgeAlpha = clamp(0.5 - test * invlen, 0.0, 1.0);
+ offset = vEllipseOffsets_Stage0 * vEllipseRadii_Stage0.zw;
+ test = dot(offset, offset) - 1.0;
+ grad = (2.0 * offset) * vEllipseRadii_Stage0.zw;
+ grad_dot = dot(grad, grad);
+ invlen = inversesqrt(grad_dot);
+ edgeAlpha *= clamp(0.5 + test * invlen, 0.0, 1.0);
+ outputCoverage_Stage0 = vec4(edgeAlpha);
+ }
+ vec4 output_Stage1;
+ {
+ vec4 inputColor = vec4(outputColor_Stage0.xyz, 1.0);
+ output_Stage1 = blend_overlay(ComposeTwo_Stage1_c0_c0(inputColor), ComposeTwo_Stage1_c1_c0(inputColor));
+ output_Stage1 *= outputColor_Stage0.w;
+ }
+ {
+ sk_FragColor = (vec4(1.0) - output_Stage1) * outputCoverage_Stage0;
+ }
+}
+
+[vertex shader]
+#version 140
+
+uniform vec4 sk_RTAdjust;
+in vec2 inPosition;
+in vec4 inColor;
+in vec2 inEllipseOffset;
+in vec4 inEllipseRadii;
+noperspective out vec2 vEllipseOffsets_Stage0;
+noperspective out vec4 vEllipseRadii_Stage0;
+noperspective out vec4 vinColor_Stage0;
+void main() {
+ vEllipseOffsets_Stage0 = inEllipseOffset;
+ vEllipseRadii_Stage0 = inEllipseRadii;
+ vinColor_Stage0 = inColor;
+ vec2 pos2 = inPosition;
+ gl_Position = vec4(pos2.x, pos2.y, 0.0, 1.0);
+ gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
+}
+