~ubuntu-branches/ubuntu/trusty/qtdeclarative-opensource-src/trusty-updates

« back to all changes in this revision

Viewing changes to tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 14:17:19 UTC
  • Revision ID: package-import@ubuntu.com-20130205141719-qqeyml8wslpyez52
Tags: upstream-5.0.1
ImportĀ upstreamĀ versionĀ 5.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Item {
 
4
    width: 320
 
5
    height: 480
 
6
 
 
7
    Rectangle {
 
8
        id: rect1
 
9
        x: 10
 
10
        y: 10
 
11
        width: 80
 
12
        height: 80
 
13
        radius: 20
 
14
        color: "black"
 
15
    }
 
16
 
 
17
    Rectangle {
 
18
        id: rect2
 
19
        x: 100
 
20
        y: 10
 
21
        width: 80
 
22
        height: 80
 
23
        radius: 20
 
24
        color: "black"
 
25
    }
 
26
 
 
27
    Rectangle {
 
28
        id: rect3
 
29
        x: 190
 
30
        y: 10
 
31
        width: 80
 
32
        height: 80
 
33
        radius: 20
 
34
        color: "black"
 
35
    }
 
36
 
 
37
    ShaderEffectSource {
 
38
        id: source
 
39
        property int counter
 
40
        sourceItem: rect1
 
41
        hideSource: true
 
42
    }
 
43
 
 
44
    ShaderEffect {
 
45
        id: effect
 
46
        anchors.fill: source.sourceItem
 
47
 
 
48
        property variant source: source
 
49
 
 
50
        fragmentShader: "
 
51
        uniform lowp sampler2D source;
 
52
        varying highp vec2 qt_TexCoord0;
 
53
        uniform lowp float qt_Opacity;
 
54
        void main() {
 
55
            gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
 
56
        }
 
57
        "
 
58
    }
 
59
 
 
60
 
 
61
}