diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2020-05-14 11:20:51 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2020-05-18 09:35:21 +0200 |
commit | 33941cb8a036145fbf0ef386680b4f98bbbe0fc1 (patch) | |
tree | 79b83e078d4af98ee5bb7a0cf612d2dafcffa4bd /tests/manual | |
parent | 304891f65b998f2d859146a94a276783a76d0d1a (diff) |
Make the test actually test something
Have some source rects that are inside the source, so the shader
effect will have something to work with. Also get rid of the
MouseArea, since that is completely pointless for a lancelot test.
Task-number: QTBUG-83975
Pick-to: 5.15
Change-Id: I23e6eb0d2bdf05704124a5dc83816e923413c031
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml index f473207235..75a0d2a151 100644 --- a/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml +++ b/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml @@ -8,40 +8,30 @@ Item { id: text anchors.centerIn: parent font.pixelSize: 80 - text: "Shaderz!" + text: "Shaderz\nroolz!" + horizontalAlignment: Text.AlignHCenter } - ShaderEffectSource { - id: source - sourceItem: text - sourceRect: Qt.rect(rect.x - text.x, rect.y - text.y, rect.width, rect.height) + ListModel { + id: rects + ListElement {x0: 50; y0: 50; w: 100; h: 100} + ListElement {x0: 50; y0: 200; w: 100; h: 100} + ListElement {x0: 180; y0: 50; w: 150; h: 380} } - ShaderEffect { - anchors.fill: rect + Repeater { + model: rects - property variant source: source - - fragmentShader: "qrc:shaders/gradient.frag" - } - - Rectangle { - id: rect - x: 100 - y: 100 - width: 100 - height: 100 - color: "transparent" - border.width: 2 - border.color: "red" - MouseArea { - anchors.fill: parent - drag.target: parent - drag.axis: Drag.XAndYAxis - drag.minimumX: 0 - drag.maximumX: parent.parent.width - width - drag.minimumY: 0 - drag.maximumY: parent.parent.height - height + ShaderEffect { + x: x0 + y: y0 + width: w + height: h + property variant source: ShaderEffectSource { + sourceItem: text + sourceRect: Qt.rect(x0 - text.x, y0 - text.y, w, h) + } + fragmentShader: "qrc:shaders/gradient.frag" } } } |