summaryrefslogtreecommitdiff
path: root/shaders/skia/763.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/skia/763.shader_test')
-rw-r--r--shaders/skia/763.shader_test215
1 files changed, 215 insertions, 0 deletions
diff --git a/shaders/skia/763.shader_test b/shaders/skia/763.shader_test
new file mode 100644
index 0000000..52b3ee6
--- /dev/null
+++ b/shaders/skia/763.shader_test
@@ -0,0 +1,215 @@
+[require]
+GLSL >= 1.40
+
+[fragment shader]
+#version 140
+
+uniform float ucornerRadius_Stage1_c0_c0;
+uniform vec4 uproxyRect_Stage1_c0_c0;
+uniform float ublurRadius_Stage1_c0_c0;
+uniform vec4 ucolor_Stage1_c1_c0;
+uniform vec4 urectH_Stage2;
+uniform float uinvSixSigma_Stage2;
+uniform vec4 uscale0_1_Stage3_c2_c0_c1_c0;
+uniform vec4 uscale2_3_Stage3_c2_c0_c1_c0;
+uniform vec4 uscale4_5_Stage3_c2_c0_c1_c0;
+uniform vec4 uscale6_7_Stage3_c2_c0_c1_c0;
+uniform vec4 ubias0_1_Stage3_c2_c0_c1_c0;
+uniform vec4 ubias2_3_Stage3_c2_c0_c1_c0;
+uniform vec4 ubias4_5_Stage3_c2_c0_c1_c0;
+uniform vec4 ubias6_7_Stage3_c2_c0_c1_c0;
+uniform vec4 uthresholds1_7_Stage3_c2_c0_c1_c0;
+uniform vec4 uthresholds9_13_Stage3_c2_c0_c1_c0;
+uniform float uPixelSize_Stage4;
+uniform vec2 uRange_Stage4;
+uniform float ucornerRadius_Stage5;
+uniform vec4 uproxyRect_Stage5;
+uniform float ublurRadius_Stage5;
+uniform sampler2D uTextureSampler_0_Stage1;
+uniform sampler2D uTextureSampler_0_Stage2;
+uniform sampler2D uTextureSampler_0_Stage4;
+uniform sampler2D uTextureSampler_0_Stage5;
+noperspective in vec4 vcolor_Stage0;
+noperspective in vec2 vTransformedCoords_0_Stage0;
+noperspective in vec2 vTransformedCoords_1_Stage0;
+noperspective in float vinCoverage_Stage0;
+vec4 RRectBlurEffect_Stage1_c0_c0(vec4 _input) {
+ vec4 _output;
+ vec2 translatedFragPos = gl_FragCoord.xy - uproxyRect_Stage1_c0_c0.xy;
+ float threshold = ucornerRadius_Stage1_c0_c0 + 2.0 * ublurRadius_Stage1_c0_c0;
+ vec2 middle = (uproxyRect_Stage1_c0_c0.zw - uproxyRect_Stage1_c0_c0.xy) - 2.0 * threshold;
+ if (translatedFragPos.x >= threshold && translatedFragPos.x < middle.x + threshold) {
+ translatedFragPos.x = threshold;
+ } else if (translatedFragPos.x >= middle.x + threshold) {
+ translatedFragPos.x -= middle.x - 1.0;
+ }
+ if (translatedFragPos.y > threshold && translatedFragPos.y < middle.y + threshold) {
+ translatedFragPos.y = threshold;
+ } else if (translatedFragPos.y >= middle.y + threshold) {
+ translatedFragPos.y -= middle.y - 1.0;
+ }
+ vec2 proxyDims = vec2(2.0 * threshold + 1.0);
+ vec2 texCoord = translatedFragPos / proxyDims;
+ _output = _input * texture(uTextureSampler_0_Stage1, texCoord);
+ return _output;
+}
+vec4 ConstColorProcessor_Stage1_c1_c0(vec4 _input) {
+ vec4 _output;
+ {
+ _output = _input * ucolor_Stage1_c1_c0;
+ }
+ return _output;
+}
+vec4 LinearGradientLayout_Stage3_c2_c0_c0_c0(vec4 _input) {
+ vec4 _output;
+ float t = vTransformedCoords_0_Stage0.x + 9.9999997473787516e-06;
+ _output = vec4(t, 1.0, 0.0, 0.0);
+ return _output;
+}
+vec4 UnrolledBinaryGradientColorizer_Stage3_c2_c0_c1_c0(vec4 _input) {
+ vec4 _output;
+ float t = _input.x;
+ vec4 scale, bias;
+ {
+ if (t < uthresholds1_7_Stage3_c2_c0_c1_c0.y) {
+ if (t < uthresholds1_7_Stage3_c2_c0_c1_c0.x) {
+ scale = uscale0_1_Stage3_c2_c0_c1_c0;
+ bias = ubias0_1_Stage3_c2_c0_c1_c0;
+ } else {
+ scale = uscale2_3_Stage3_c2_c0_c1_c0;
+ bias = ubias2_3_Stage3_c2_c0_c1_c0;
+ }
+ } else {
+ if (t < uthresholds1_7_Stage3_c2_c0_c1_c0.z) {
+ scale = uscale4_5_Stage3_c2_c0_c1_c0;
+ bias = ubias4_5_Stage3_c2_c0_c1_c0;
+ } else {
+ scale = uscale6_7_Stage3_c2_c0_c1_c0;
+ bias = ubias6_7_Stage3_c2_c0_c1_c0;
+ }
+ }
+ }
+ _output = t * scale + bias;
+ return _output;
+}
+vec4 TiledGradientEffect_Stage3_c2_c0(vec4 _input) {
+ vec4 _output;
+ vec4 t = LinearGradientLayout_Stage3_c2_c0_c0_c0(vec4(1.0));
+ {
+ {
+ float t_1 = t.x - 1.0;
+ float tiled_t = (t_1 - 2.0 * floor(t_1 * 0.5)) - 1.0;
+ t.x = abs(tiled_t);
+ }
+ _output = UnrolledBinaryGradientColorizer_Stage3_c2_c0_c1_c0(t);
+ }
+ {
+ _output.xyz *= _output.w;
+ }
+ 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 blend_src_in(vec4 src, vec4 dst) {
+ return src * dst.w;
+}
+vec4 blend_dst_in(vec4 src, vec4 dst) {
+ return blend_src_in(dst, src);
+}
+void main() {
+ vec4 outputCoverage_Stage0;
+ {
+ float alpha = 1.0;
+ alpha = vinCoverage_Stage0;
+ outputCoverage_Stage0 = vec4(alpha);
+ }
+ vec4 output_Stage1;
+ {
+ vec4 inputColor = vec4(outputCoverage_Stage0.xyz, 1.0);
+ output_Stage1 = blend_color_burn(RRectBlurEffect_Stage1_c0_c0(inputColor), ConstColorProcessor_Stage1_c1_c0(inputColor));
+ output_Stage1 *= outputCoverage_Stage0.w;
+ }
+ vec4 output_Stage2;
+ {
+ float xCoverage, yCoverage;
+ {
+ float x, y;
+ {
+ x = max(urectH_Stage2.x - gl_FragCoord.x, gl_FragCoord.x - urectH_Stage2.z);
+ y = max(urectH_Stage2.y - gl_FragCoord.y, gl_FragCoord.y - urectH_Stage2.w);
+ }
+ xCoverage = texture(uTextureSampler_0_Stage2, vec2(x * uinvSixSigma_Stage2, 0.5)).w;
+ yCoverage = texture(uTextureSampler_0_Stage2, vec2(y * uinvSixSigma_Stage2, 0.5)).w;
+ output_Stage2 = (output_Stage1 * xCoverage) * yCoverage;
+ }
+ output_Stage2 = (output_Stage1 * xCoverage) * yCoverage;
+ }
+ vec4 output_Stage3;
+ {
+ output_Stage3 = blend_dst_in(output_Stage2, TiledGradientEffect_Stage3_c2_c0(vec4(1.0)));
+ }
+ vec4 output_Stage4;
+ {
+ output_Stage4 = vec4(1.0, 1.0, 1.0, 1.0);
+ vec2 coord = vTransformedCoords_1_Stage0;
+ coord.x -= 3.0 * uPixelSize_Stage4;
+ for (int i = 0;i < 7; i++) {
+ output_Stage4 = min(output_Stage4, texture(uTextureSampler_0_Stage4, coord));
+ coord.x += uPixelSize_Stage4;
+ }
+ output_Stage4 *= output_Stage3;
+ }
+ {
+ vec2 translatedFragPos = gl_FragCoord.xy - uproxyRect_Stage5.xy;
+ float threshold = ucornerRadius_Stage5 + 2.0 * ublurRadius_Stage5;
+ vec2 middle = (uproxyRect_Stage5.zw - uproxyRect_Stage5.xy) - 2.0 * threshold;
+ if (translatedFragPos.x >= threshold && translatedFragPos.x < middle.x + threshold) {
+ translatedFragPos.x = threshold;
+ } else if (translatedFragPos.x >= middle.x + threshold) {
+ translatedFragPos.x -= middle.x - 1.0;
+ }
+ if (translatedFragPos.y > threshold && translatedFragPos.y < middle.y + threshold) {
+ translatedFragPos.y = threshold;
+ } else if (translatedFragPos.y >= middle.y + threshold) {
+ translatedFragPos.y -= middle.y - 1.0;
+ }
+ }
+}
+
+[vertex shader]
+#version 140
+
+uniform vec4 sk_RTAdjust;
+uniform mat3 uCoordTransformMatrix_0_Stage0;
+uniform mat3 uCoordTransformMatrix_1_Stage0;
+in vec2 inPosition;
+in vec4 inColor;
+in float inCoverage;
+noperspective out vec4 vcolor_Stage0;
+noperspective out vec2 vTransformedCoords_0_Stage0;
+noperspective out vec2 vTransformedCoords_1_Stage0;
+noperspective out float vinCoverage_Stage0;
+void main() {
+ vec4 color = inColor;
+ vcolor_Stage0 = color;
+ vec2 pos2 = inPosition;
+ vTransformedCoords_0_Stage0 = (uCoordTransformMatrix_0_Stage0 * vec3(inPosition, 1.0)).xy;
+ vTransformedCoords_1_Stage0 = (uCoordTransformMatrix_1_Stage0 * vec3(inPosition, 1.0)).xy;
+ vinCoverage_Stage0 = inCoverage;
+ 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);
+}
+