1 /* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
12 property real radius: 16
15 uniform lowp float radius;
16 uniform lowp float height;
17 uniform lowp float width;
18 uniform lowp float qt_Opacity;
19 uniform lowp vec4 color;
20 varying highp vec2 qt_TexCoord0;
23 lowp vec2 dist = min(qt_TexCoord0, vec2(1.0) - qt_TexCoord0);
25 lowp float xval = smoothstep(0.0, radius, dist.x * width);
26 lowp float yval = smoothstep(0.0, radius, dist.y * height);
27 lowp float borderVal = sqrt(yval * xval) * 0.5 + 0.5;
29 lowp vec4 borderColor = mix(color, vec4(0.0, 0.0, 0.0, 1.0), borderVal);
30 gl_FragColor = borderColor * qt_Opacity;