From 33941cb8a036145fbf0ef386680b4f98bbbe0fc1 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 14 May 2020 11:20:51 +0200 Subject: 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 --- .../data/shaders/source/rect.qml | 48 +++++++++------------- 1 file changed, 19 insertions(+), 29 deletions(-) (limited to 'tests/manual') 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" } } } -- cgit v1.2.3