2
* Copyright 2013 Canonical Ltd.
4
* This file is part of webbrowser-app.
6
* webbrowser-app is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* webbrowser-app is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
property real minimumValue
23
property real maximumValue
26
property alias source: __source.sourceItem
28
property color bgColor
29
property color fgColor
33
cullMode: ShaderEffect.BackFaceCulling
35
property var _source: ShaderEffectSource {
39
property real _progress: value / (maximumValue - minimumValue)
42
varying highp vec2 qt_TexCoord0;
43
uniform sampler2D _source;
44
uniform highp vec4 bgColor;
45
uniform highp vec4 fgColor;
46
uniform lowp float qt_Opacity;
47
uniform lowp float _progress;
49
highp vec4 color = texture2D(_source, qt_TexCoord0);
50
if (qt_TexCoord0.x <= _progress) {
51
highp float luminance = dot(vec3(0.2126, 0.7152, 0.0722), color.rgb);
52
gl_FragColor = mix(fgColor, bgColor, luminance) * color.a * qt_Opacity;
54
gl_FragColor = color * qt_Opacity;