aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/listview/listview.pro29
-rw-r--r--tests/manual/listview/main.cpp103
-rw-r--r--tests/manual/listview/main.qml171
-rw-r--r--tests/manual/listview/qml.qrc5
-rwxr-xr-xtests/manual/nodetypes_ng/compile.bat (renamed from tests/manual/nodetypes_ng/buildshaders.bat)0
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass1.frag.qsbbin2218 -> 1822 bytes
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass2.frag.qsbbin2131 -> 1745 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble.frag.qsbbin2013 -> 1627 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble.vert.qsbbin2001 -> 1641 bytes
-rw-r--r--tests/manual/pointer/main.qml3
-rw-r--r--tests/manual/pointer/pointerDrag.qml65
-rw-r--r--tests/manual/pointer/qml.qrc5
-rw-r--r--tests/manual/pointer/resources/cursor-airbrush.pngbin0 -> 823 bytes
-rw-r--r--tests/manual/pointer/resources/cursor-eraser.pngbin0 -> 1454 bytes
-rw-r--r--tests/manual/pointer/resources/cursor-felt-marker.pngbin0 -> 513 bytes
-rw-r--r--tests/manual/pointer/resources/cursor-pencil.pngbin0 -> 1307 bytes
-rw-r--r--tests/manual/pointer/sidebar.qml7
-rw-r--r--tests/manual/pointer/tabletCanvasDrawing.qml242
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/activity/activity.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/basic/basic.qml8
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml11
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml11
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/attributes.qml65
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_1.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_16.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_2.qml19
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_4.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_8.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_1.qml18
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_2.qml19
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_1.qml18
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_2.qml20
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/image/async.qml12
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/image/source.qml10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_1.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_2.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_1.qml20
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_2.qml20
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/live/samesource.qml18
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/one-source.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/switch_2.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/switch_3.qml9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/two-sources.qml10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/visible_1.qml10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/source/visible_2.qml10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/texture/size.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/wrap/modes.qml17
-rw-r--r--tests/manual/scenegraph_lancelot/data/shape/shape_text.qml91
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.fragbin0 -> 813 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.fragbin0 -> 1923 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.fragbin0 -> 1238 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.fragbin0 -> 1831 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.fragbin0 -> 1061 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.fragbin0 -> 1064 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.fragbin0 -> 1059 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.fragbin0 -> 1057 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.fragbin0 -> 1050 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.fragbin0 -> 2041 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.fragbin0 -> 1122 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vertbin0 -> 1799 bytes
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/basic.frag5
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/basic_rhi.frag8
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk.frag14
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk_rhi.frag18
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/compile.bat13
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/culling.frag9
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/culling_rhi.frag13
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/edge.frag14
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/edge_rhi.frag23
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient.frag6
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2.frag6
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2_rhi.frag10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3.frag6
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3_rhi.frag10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4.frag6
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4_rhi.frag10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5.frag6
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5_rhi.frag10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/gradient_rhi.frag10
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/shadow.frag14
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/shadow_rhi.frag23
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/stencil.frag7
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/stencil_rhi.frag11
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/wave.vert12
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shaders/wave_rhi.vert18
-rw-r--r--tests/manual/scenegraph_lancelot/data/shared/shared.qrc28
-rw-r--r--tests/manual/scenegraph_lancelot/scenegrabber/scenegrabber.pro3
-rw-r--r--tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp2
-rw-r--r--tests/manual/tableview/abstracttablemodel/main.qml14
-rw-r--r--tests/manual/tableview/imagetiling/imageTiling.qml90
-rw-r--r--tests/manual/tableview/imagetiling/map.pdfbin0 -> 31904 bytes
-rw-r--r--tests/manual/tableview/imagetiling/map.pngbin0 -> 21101 bytes
-rw-r--r--tests/manual/tableview/imagetiling/map.svgzbin0 -> 27956 bytes
95 files changed, 1167 insertions, 446 deletions
diff --git a/tests/manual/listview/listview.pro b/tests/manual/listview/listview.pro
new file mode 100644
index 0000000000..a517b75079
--- /dev/null
+++ b/tests/manual/listview/listview.pro
@@ -0,0 +1,29 @@
+QT += quick
+CONFIG += c++11
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Refer to the documentation for the
+# deprecated API to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+ main.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# Additional import path used to resolve QML modules just for Qt Quick Designer
+QML_DESIGNER_IMPORT_PATH =
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
diff --git a/tests/manual/listview/main.cpp b/tests/manual/listview/main.cpp
new file mode 100644
index 0000000000..8b28b91ee8
--- /dev/null
+++ b/tests/manual/listview/main.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QAbstractTableModel>
+
+typedef QPair<QString, bool> CellData;
+
+class TestModel : public QAbstractListModel
+{
+ Q_OBJECT
+ Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount NOTIFY rowCountChanged)
+
+public:
+ TestModel(QObject *parent = nullptr) : QAbstractListModel(parent) { }
+
+ int rowCount(const QModelIndex & = QModelIndex()) const override { return m_rows; }
+ void setRowCount(int count) {
+ m_rows = count;
+ emit rowCountChanged();
+ }
+
+ QVariant data(const QModelIndex &index, int role) const override
+ {
+ if (!index.isValid())
+ return QVariant();
+
+ switch (role) {
+ case Qt::DisplayRole:
+ return index.row() % 2 ? QStringLiteral("type2") : QStringLiteral("type1");
+ default:
+ break;
+ }
+
+ return QVariant();
+ }
+
+ QHash<int, QByteArray> roleNames() const override
+ {
+ return {
+ {Qt::DisplayRole, "delegateType"},
+ };
+ }
+
+signals:
+ void rowCountChanged();
+
+private:
+ int m_rows = 0;
+};
+
+#include "main.moc"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+
+ QGuiApplication app(argc, argv);
+
+ qmlRegisterType<TestModel>("TestModel", 0, 1, "TestModel");
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/manual/listview/main.qml b/tests/manual/listview/main.qml
new file mode 100644
index 0000000000..723e10ac05
--- /dev/null
+++ b/tests/manual/listview/main.qml
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.5
+import Qt.labs.qmlmodels 1.0
+import TestModel 0.1
+
+Window {
+ id: root
+ visible: true
+ width: 640
+ height: 480
+
+ property int rows: 500
+ property int columns: 20
+ property real delegateHeight: 10
+ property real delegateWidth: 50
+
+ CheckBox {
+ id: reuseItemsBox
+ text: "Reuse items"
+ checked: true
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 10
+ anchors.topMargin: reuseItemsBox.height + 10
+ color: "lightgray"
+
+ ListView {
+ id: listView
+ anchors.fill: parent
+
+ reuseItems: reuseItemsBox.checked
+
+ cacheBuffer: 0
+ contentWidth: columns * delegateWidth
+ contentHeight: rows * delegateHeight
+ flickableDirection: Flickable.HorizontalAndVerticalFlick
+ clip: true
+
+ model: TestModel {
+ rowCount: root.rows
+ }
+
+ ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }
+ ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AlwaysOn }
+
+ delegate: DelegateChooser {
+ role: "delegateType"
+
+ DelegateChoice {
+ roleValue: "type1"
+
+ Item {
+ width: listView.contentWidth
+ height: delegateHeight
+ property int reusedCount: 0
+
+ ListView.onReused: reusedCount++
+
+ Text {
+ id: text1
+ text: "Reused count:" + reusedCount
+ font.pixelSize: 9
+ }
+
+ Row {
+ id: choice1
+ width: listView.contentWidth
+ height: delegateHeight
+ anchors.left: text1.right
+ anchors.leftMargin: 5
+ property color color: Qt.rgba(0.6, 0.6, 0.8, 1)
+
+ Component.onCompleted: {
+ for (var i = 0; i < columns; ++i)
+ cellComponent.createObject(choice1, {column: i, color: color})
+ }
+ }
+ }
+ }
+
+ DelegateChoice {
+ roleValue: "type2"
+
+ Item {
+ width: listView.contentWidth
+ height: delegateHeight
+ property int reusedCount: 0
+
+ ListView.onReused: reusedCount++
+
+ Text {
+ id: text2
+ text: "Reused count:" + reusedCount
+ font.pixelSize: 9
+ }
+
+ Row {
+ id: choice2
+ width: listView.contentWidth
+ height: delegateHeight
+ anchors.left: text2.right
+ anchors.leftMargin: 5
+ property color color: Qt.rgba(0.3, 0.3, 0.8, 1)
+
+ Component.onCompleted: {
+ for (var i = 0; i < columns; ++i)
+ cellComponent.createObject(choice2, {column: i, color: color})
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ Component {
+ id: cellComponent
+ Rectangle {
+ height: delegateHeight
+ width: delegateWidth
+ property int column
+ Text {
+ text: "Lorem ipsum dolor sit amet"
+ font.pixelSize: 9
+ }
+ }
+ }
+}
diff --git a/tests/manual/listview/qml.qrc b/tests/manual/listview/qml.qrc
new file mode 100644
index 0000000000..5f6483ac33
--- /dev/null
+++ b/tests/manual/listview/qml.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/nodetypes_ng/buildshaders.bat b/tests/manual/nodetypes_ng/compile.bat
index 328b216c07..328b216c07 100755
--- a/tests/manual/nodetypes_ng/buildshaders.bat
+++ b/tests/manual/nodetypes_ng/compile.bat
diff --git a/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
index f3370caee2..4c913fee08 100644
--- a/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
+++ b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
index cbf9569373..4f6e6634e7 100644
--- a/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
+++ b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble.frag.qsb b/tests/manual/nodetypes_ng/wobble.frag.qsb
index 9d3b80fad8..f1766f4363 100644
--- a/tests/manual/nodetypes_ng/wobble.frag.qsb
+++ b/tests/manual/nodetypes_ng/wobble.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble.vert.qsb b/tests/manual/nodetypes_ng/wobble.vert.qsb
index 0f44e87feb..2715c84616 100644
--- a/tests/manual/nodetypes_ng/wobble.vert.qsb
+++ b/tests/manual/nodetypes_ng/wobble.vert.qsb
Binary files differ
diff --git a/tests/manual/pointer/main.qml b/tests/manual/pointer/main.qml
index d382d8b23d..83e1d3b2ba 100644
--- a/tests/manual/pointer/main.qml
+++ b/tests/manual/pointer/main.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the manual tests of the Qt Toolkit.
@@ -57,6 +57,7 @@ Window {
addExample("multibuttons", "TapHandler: gesturePolicy (99 red balloons)", Qt.resolvedUrl("multibuttons.qml"))
addExample("flickable with Handlers", "Flickable with buttons, sliders etc. implemented in various ways", Qt.resolvedUrl("flickableWithHandlers.qml"))
addExample("tap and drag", "Flickable with all possible combinations of TapHandler and DragHandler children", Qt.resolvedUrl("pointerDrag.qml"))
+ addExample("tablet canvas", "PointHandler and HoverHandler with a tablet: detect the stylus, and draw", Qt.resolvedUrl("tabletCanvasDrawing.qml"))
}
}
Item {
diff --git a/tests/manual/pointer/pointerDrag.qml b/tests/manual/pointer/pointerDrag.qml
index 79044eb0b4..2063d8fae2 100644
--- a/tests/manual/pointer/pointerDrag.qml
+++ b/tests/manual/pointer/pointerDrag.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the manual tests of the Qt Toolkit.
@@ -26,7 +26,7 @@
**
****************************************************************************/
-import QtQuick 2.12
+import QtQuick 2.15
import "content"
Rectangle {
@@ -74,7 +74,14 @@ Rectangle {
label: "DragHandler"
objectName: "dragSquircle1"
DragHandler {
-
+ dragThreshold: ckZeroDragThreshold1.checked ? 0 : undefined
+ }
+ CheckBox {
+ id: ckZeroDragThreshold1
+ label: " Zero threshold"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 20
+ checked: false
}
}
@@ -99,7 +106,16 @@ Rectangle {
id: tap2
gesturePolicy: root.globalGesturePolicy
}
- DragHandler { }
+ DragHandler {
+ dragThreshold: ckZeroDragThreshold2.checked ? 0 : undefined
+ }
+ CheckBox {
+ id: ckZeroDragThreshold2
+ label: " Zero threshold"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 32
+ checked: false
+ }
}
TextBox {
@@ -107,7 +123,16 @@ Rectangle {
width: 100; height: 100
label: "DragHandler\nTapHandler"
color: queryColor(tap3.pressed)
- DragHandler { }
+ DragHandler {
+ dragThreshold: ckZeroDragThreshold3.checked ? 0 : undefined
+ }
+ CheckBox {
+ id: ckZeroDragThreshold3
+ label: " Zero threshold"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 32
+ checked: false
+ }
TapHandler {
id: tap3
gesturePolicy: root.globalGesturePolicy
@@ -118,7 +143,16 @@ Rectangle {
x: 400; y: 0
width: 100; height: 100
label: "DragHandler"
- DragHandler { }
+ DragHandler {
+ dragThreshold: ckZeroDragThreshold4.checked ? 0 : undefined
+ }
+ CheckBox {
+ id: ckZeroDragThreshold4
+ label: " Zero threshold"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 20
+ checked: false
+ }
TextBox {
label: "TapHandler"
@@ -145,6 +179,13 @@ Rectangle {
label: " Greedy ↓"
checked: true
}
+ CheckBox {
+ id: ckZeroDragThreshold5
+ label: " Zero threshold"
+ x: 10
+ anchors.bottom: ckGreedyDrag.top
+ checked: false
+ }
TapHandler {
id: tap5
gesturePolicy: root.globalGesturePolicy
@@ -159,6 +200,7 @@ Rectangle {
DragHandler {
grabPermissions: ckGreedyDrag ? DragHandler.CanTakeOverFromAnything :
DragHandler.CanTakeOverFromItems | DragHandler.CanTakeOverFromHandlersOfDifferentType | DragHandler.ApprovesTakeOverByAnything
+ dragThreshold: ckZeroDragThreshold5.checked ? 0 : undefined
}
}
}
@@ -174,7 +216,16 @@ Rectangle {
label: "DragHandler"
x: (parent.width - width)/2
y: 60
- DragHandler { }
+ DragHandler {
+ dragThreshold: ckZeroDragThreshold6.checked ? 0 : undefined
+ }
+ }
+ CheckBox {
+ id: ckZeroDragThreshold6
+ label: " Zero threshold"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 20
+ checked: false
}
}
diff --git a/tests/manual/pointer/qml.qrc b/tests/manual/pointer/qml.qrc
index 95bece180a..20956fcbac 100644
--- a/tests/manual/pointer/qml.qrc
+++ b/tests/manual/pointer/qml.qrc
@@ -13,6 +13,7 @@
<file>pointerDrag.qml</file>
<file>singlePointHandlerProperties.qml</file>
<file>sidebar.qml</file>
+ <file>tabletCanvasDrawing.qml</file>
<file>tapHandler.qml</file>
<file>content/CheckBox.qml</file>
<file>content/FakeFlickable.qml</file>
@@ -30,6 +31,10 @@
<file>content/TouchpointFeedbackSprite.qml</file>
<file>resources/arrowhead.png</file>
<file>resources/balloon.png</file>
+ <file>resources/cursor-airbrush.png</file>
+ <file>resources/cursor-eraser.png</file>
+ <file>resources/cursor-felt-marker.png</file>
+ <file>resources/cursor-pencil.png</file>
<file>resources/fighter.png</file>
<file>resources/fingersprite.png</file>
<file>resources/grabbing-location.svg</file>
diff --git a/tests/manual/pointer/resources/cursor-airbrush.png b/tests/manual/pointer/resources/cursor-airbrush.png
new file mode 100644
index 0000000000..bea756ed6f
--- /dev/null
+++ b/tests/manual/pointer/resources/cursor-airbrush.png
Binary files differ
diff --git a/tests/manual/pointer/resources/cursor-eraser.png b/tests/manual/pointer/resources/cursor-eraser.png
new file mode 100644
index 0000000000..e5488a89f2
--- /dev/null
+++ b/tests/manual/pointer/resources/cursor-eraser.png
Binary files differ
diff --git a/tests/manual/pointer/resources/cursor-felt-marker.png b/tests/manual/pointer/resources/cursor-felt-marker.png
new file mode 100644
index 0000000000..132f09aa39
--- /dev/null
+++ b/tests/manual/pointer/resources/cursor-felt-marker.png
Binary files differ
diff --git a/tests/manual/pointer/resources/cursor-pencil.png b/tests/manual/pointer/resources/cursor-pencil.png
new file mode 100644
index 0000000000..cc2f447d02
--- /dev/null
+++ b/tests/manual/pointer/resources/cursor-pencil.png
Binary files differ
diff --git a/tests/manual/pointer/sidebar.qml b/tests/manual/pointer/sidebar.qml
index 827dbd1980..b7370a4fb7 100644
--- a/tests/manual/pointer/sidebar.qml
+++ b/tests/manual/pointer/sidebar.qml
@@ -26,7 +26,7 @@
**
****************************************************************************/
-import QtQuick 2.12
+import QtQuick 2.15
import "content"
Rectangle {
@@ -53,6 +53,7 @@ Rectangle {
id: buttonMA
objectName: "buttonMA"
hoverEnabled: true
+ cursorShape: Qt.UpArrowCursor
anchors.fill: parent
onClicked: console.log("clicked MA")
}
@@ -75,9 +76,11 @@ Rectangle {
id: buttonHH
objectName: "buttonHH"
acceptedDevices: PointerDevice.AllDevices
+ cursorShape: tapHandler.pressed ? Qt.BusyCursor : Qt.PointingHandCursor
}
TapHandler {
+ id: tapHandler
onTapped: tapFlash.start()
}
@@ -148,6 +151,7 @@ Rectangle {
HoverHandler {
id: topSidebarHH
objectName: "topSidebarHH"
+ cursorShape: Qt.OpenHandCursor
}
Loader {
@@ -173,6 +177,7 @@ Rectangle {
id: bottomSidebarMA
objectName: "bottomSidebarMA"
hoverEnabled: true
+ cursorShape: Qt.ClosedHandCursor
anchors.fill: parent
}
diff --git a/tests/manual/pointer/tabletCanvasDrawing.qml b/tests/manual/pointer/tabletCanvasDrawing.qml
new file mode 100644
index 0000000000..c340dee5f4
--- /dev/null
+++ b/tests/manual/pointer/tabletCanvasDrawing.qml
@@ -0,0 +1,242 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import "content"
+
+Rectangle {
+ width: 1024
+ height: 1024
+ color: "#444"
+
+ ColumnLayout {
+ x: -15; width: 80
+ height: parent.height
+ Slider {
+ id: hueSlider
+ width: 80; height: 200
+ Layout.fillHeight: true
+ label: "hue"
+ Rectangle {
+ color: "beige"
+ width: 30
+ height: 25
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ Rectangle {
+ border.color: "white"
+ color: canvas.drawingColor
+ anchors.fill: parent
+ }
+ }
+ }
+ Slider {
+ id: saturationSlider
+ width: 80; height: 200
+ Layout.fillHeight: true
+ label: "sat"
+ }
+ Slider {
+ id: lightnessSlider
+ width: 80; height: 200
+ Layout.fillHeight: true
+ label: "light"
+ }
+ }
+
+ ColumnLayout {
+ x: parent.width - 65; width: 80
+ height: parent.height
+ Slider {
+ id: widthSlider
+ width: 80; height: 200
+ Layout.fillHeight: true
+ label: "width"
+ }
+ Slider {
+ id: alphaSlider
+ width: 80; height: 200
+ Layout.fillHeight: true
+ label: "alpha"
+ }
+ }
+
+ Rectangle {
+ id: rect
+ width: 640
+ height: 480
+ color: "beige"
+ anchors {
+ fill: parent
+ margins: 10
+ leftMargin: 50
+ rightMargin: 50
+ }
+
+ Canvas {
+ id: canvas
+ anchors.fill: parent
+ antialiasing: true
+ renderTarget: Canvas.FramebufferObject
+ property color drawingColor: Qt.hsla(hueSlider.value / 100.0,
+ saturationSlider.value / 100.0,
+ lightnessSlider.value / 100.0,
+ alphaSlider.value / 100.0)
+ property var points: []
+ property var pressures: []
+ property var pointerType: PointerDevice.Pen
+ onPaint: {
+ if (points.length < 2)
+ return
+ var ctx = canvas.getContext('2d');
+ ctx.save()
+ ctx.strokeStyle = pointerType === PointerDevice.Pen ? drawingColor : "beige"
+ ctx.lineCap = "round"
+ if (pressures.length === points.length) {
+ for (var i = 1; i < points.length; i++) {
+ ctx.lineWidth = pressures[i] * widthSlider.value
+ ctx.beginPath()
+ ctx.moveTo(points[i - 1].x, points[i - 1].y)
+ ctx.lineTo(points[i].x, points[i].y)
+ ctx.stroke()
+ }
+ points = points.slice(points.length - 2, 1)
+ pressures = pressures.slice(pressures.length - 2, 1)
+ } else {
+ ctx.beginPath()
+ ctx.moveTo(points[0].x, points[0].y)
+ for (var i = 1; i < points.length; i++)
+ ctx.lineTo(points[i].x, points[i].y)
+ ctx.lineWidth = widthSlider
+ ctx.stroke()
+ points = points.slice(points.length - 2, 1)
+ pressures = []
+ }
+ ctx.restore()
+ }
+ }
+
+ PointHandler {
+ acceptedPointerTypes: PointerDevice.Pen
+ onActiveChanged:
+ if (active) {
+ canvas.pointerType = PointerDevice.Pen
+ } else {
+ canvas.points = []
+ canvas.pressures = []
+ }
+ onPointChanged:
+ if (active) {
+ canvas.points.push(point.position)
+ canvas.pressures.push(point.pressure)
+ canvas.requestPaint()
+ }
+ }
+
+ PointHandler {
+ acceptedPointerTypes: PointerDevice.Eraser
+ onActiveChanged:
+ if (active) {
+ canvas.pointerType = PointerDevice.Eraser
+ } else {
+ canvas.points = []
+ canvas.pressures = []
+ }
+ onPointChanged:
+ if (active) {
+ canvas.points.push(point.position)
+ canvas.pressures.push(point.pressure)
+ canvas.requestPaint()
+ }
+ }
+
+ HoverHandler {
+ id: stylusHandler
+ acceptedDevices: PointerDevice.Stylus
+ acceptedPointerTypes: PointerDevice.Pen
+ target: Image {
+ parent: rect
+ source: stylusHandler.point.rotation === 0 ?
+ "resources/cursor-pencil.png" : "resources/cursor-felt-marker.png"
+ visible: stylusHandler.hovered
+ rotation: stylusHandler.point.rotation
+ x: stylusHandler.point.position.x
+ y: stylusHandler.point.position.y
+ }
+ }
+
+ HoverHandler {
+ id: airbrushHandler
+ acceptedDevices: PointerDevice.Airbrush
+ acceptedPointerTypes: PointerDevice.Pen
+ target: Image {
+ parent: rect
+ source: "resources/cursor-airbrush.png"
+ visible: airbrushHandler.hovered
+ x: airbrushHandler.point.position.x
+ y: airbrushHandler.point.position.y
+ }
+ }
+
+ HoverHandler {
+ id: eraserHandler
+ acceptedPointerTypes: PointerDevice.Eraser
+ target: Image {
+ parent: rect
+ source: "resources/cursor-eraser.png"
+ visible: eraserHandler.hovered
+ x: eraserHandler.point.position.x
+ y: eraserHandler.point.position.y - 32
+ }
+ }
+ }
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/activity/activity.qml b/tests/manual/scenegraph_lancelot/data/shaders/activity/activity.qml
index d4ae526b5d..956b3d7d91 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/activity/activity.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/activity/activity.qml
@@ -23,13 +23,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/basic/basic.qml b/tests/manual/scenegraph_lancelot/data/shaders/basic/basic.qml
index f1bb03a4a9..24aa5db5e8 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/basic/basic.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/basic/basic.qml
@@ -6,12 +6,6 @@ Item {
ShaderEffect {
anchors.fill: parent;
- fragmentShader: "
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
- }
- "
+ fragmentShader: "qrc:shaders/basic.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml
index 76ce60fd7d..118de56098 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml
@@ -72,16 +72,7 @@ Rectangle {
cullMode: model.bar
property variant frontSource: front
property variant backSource: back
- fragmentShader: "
- varying highp vec2 qt_TexCoord0;
- uniform sampler2D frontSource;
- uniform sampler2D backSource;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = gl_FrontFacing
- ? texture2D(frontSource, qt_TexCoord0)
- : texture2D(backSource, qt_TexCoord0);
- }"
+ fragmentShader: "qrc:shaders/culling.frag"
transform: Rotation {
origin.x: 200
origin.y: 180 - 120 * index
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml
index 45f20dd5a4..7614451e05 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml
@@ -72,16 +72,7 @@ Rectangle {
cullMode: model.bar
property variant frontSource: front
property variant backSource: back
- fragmentShader: "
- varying highp vec2 qt_TexCoord0;
- uniform sampler2D frontSource;
- uniform sampler2D backSource;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = gl_FrontFacing
- ? texture2D(frontSource, qt_TexCoord0)
- : texture2D(backSource, qt_TexCoord0);
- }"
+ fragmentShader: "qrc:shaders/culling.frag"
transform: Rotation {
origin.x: 100
origin.y: 180 - 120 * index
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/attributes.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/attributes.qml
deleted file mode 100644
index 17d9aadf95..0000000000
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/attributes.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- width: 320
- height: 480
-
- Text {
- id: text
- font.pixelSize: 80
- text: "Shaderz!"
- }
-
- ShaderEffectSource {
- id: source
- sourceItem: text
- hideSource: true
- smooth: true
- }
- Column {
- ShaderEffect {
- width: 320
- height: 160
- property variant source: source
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- gl_Position = qt_Matrix * qt_Vertex;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
- }
- ShaderEffect {
- width: 320
- height: 160
- property variant source: source
- vertexShader: "
- attribute highp vec2 qt_MultiTexCoord0;
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- varying highp vec2 qt_TexCoord0;
- void main() {
- gl_Position = qt_Matrix * qt_Vertex;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
- }
- ShaderEffect {
- width: 320
- height: 160
- property variant source: source
- vertexShader: "
- attribute highp vec2 qt_MultiTexCoord0;
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- varying highp vec2 qt_TexCoord0;
- uniform highp float width;
- uniform highp float height;
- void main() {
- gl_Position = qt_Matrix * qt_Vertex;
- qt_TexCoord0 = qt_Vertex.xy / vec2(width, height);
- }"
- }
- }
-}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_1.qml
index ddea979124..7a743453ab 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_1.qml
@@ -6,8 +6,8 @@ Rectangle {
color: "skyblue"
ShaderEffect {
anchors.centerIn: parent
- width: 16 * 16
- height: 24 * 16
+ width: 22 * 12
+ height: 16 * 12
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
@@ -40,18 +40,7 @@ Rectangle {
}
smooth: true
}
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- pos.x += sin(qt_Vertex.y * 0.02) * 20.;
- pos.y += sin(qt_Vertex.x * 0.02) * 20.;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
+ vertexShader: "qrc:shaders/wave.vert"
mesh: GridMesh {
property int r: 1
resolution: Qt.size(r, r)
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_16.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_16.qml
index 971cda4f55..9e221d0887 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_16.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_16.qml
@@ -6,8 +6,8 @@ Rectangle {
color: "skyblue"
ShaderEffect {
anchors.centerIn: parent
- width: 16 * 16
- height: 24 * 16
+ width: 22 * 12
+ height: 16 * 12
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
@@ -40,18 +40,7 @@ Rectangle {
}
smooth: true
}
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- pos.x += sin(qt_Vertex.y * 0.02) * 20.;
- pos.y += sin(qt_Vertex.x * 0.02) * 20.;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
+ vertexShader: "qrc:shaders/wave.vert"
mesh: GridMesh {
property int r: 16
resolution: Qt.size(r, r)
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_2.qml
index d301ef089c..4dad42d182 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_2.qml
@@ -4,10 +4,10 @@ Rectangle {
width: 320
height: 480
color: "skyblue"
- ShaderEffect{
+ ShaderEffect {
anchors.centerIn: parent
- width: 16 * 16
- height: 24 * 16
+ width: 22 * 12
+ height: 16 * 12
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
@@ -40,18 +40,7 @@ Rectangle {
}
smooth: true
}
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- pos.x += sin(qt_Vertex.y * 0.02) * 20.;
- pos.y += sin(qt_Vertex.x * 0.02) * 20.;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
+ vertexShader: "qrc:shaders/wave.vert"
mesh: GridMesh {
property int r: 2
resolution: Qt.size(r, r)
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_4.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_4.qml
index 0043282efd..9d91da0bb2 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_4.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_4.qml
@@ -6,8 +6,8 @@ Rectangle {
color: "skyblue"
ShaderEffect {
anchors.centerIn: parent
- width: 16 * 16
- height: 24 * 16
+ width: 22 * 12
+ height: 16 * 12
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
@@ -40,18 +40,7 @@ Rectangle {
}
smooth: true
}
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- pos.x += sin(qt_Vertex.y * 0.02) * 20.;
- pos.y += sin(qt_Vertex.x * 0.02) * 20.;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
+ vertexShader: "qrc:shaders/wave.vert"
mesh: GridMesh {
property int r: 4
resolution: Qt.size(r, r)
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_8.qml b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_8.qml
index f9427a1f16..c436c0f8e4 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_8.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/gridmesh/resolution_8.qml
@@ -6,8 +6,8 @@ Rectangle {
color: "skyblue"
ShaderEffect {
anchors.centerIn: parent
- width: 16 * 16
- height: 24 * 16
+ width: 22 * 12
+ height: 16 * 12
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
@@ -40,18 +40,7 @@ Rectangle {
}
smooth: true
}
- vertexShader: "
- uniform highp mat4 qt_Matrix;
- attribute highp vec4 qt_Vertex;
- attribute highp vec2 qt_MultiTexCoord0;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec4 pos = qt_Vertex;
- pos.x += sin(qt_Vertex.y * 0.02) * 20.;
- pos.y += sin(qt_Vertex.x * 0.02) * 20.;
- gl_Position = qt_Matrix * pos;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }"
+ vertexShader: "qrc:shaders/wave.vert"
mesh: GridMesh {
property int r: 8
resolution: Qt.size(r, r)
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_1.qml
index 83469531b1..7c5b5efac5 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_1.qml
@@ -43,22 +43,6 @@ Item {
property variant offset: Qt.size(4 / width, 4 / height)
property variant delta: Qt.size(0.5 / width, 0.5 / height)
- fragmentShader: "
- uniform lowp sampler2D source;
- uniform highp vec2 offset;
- uniform highp vec2 delta;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 delta2 = vec2(delta.x, -delta.y);
- lowp float shadow = 0.25 * (texture2D(source, qt_TexCoord0 - offset + delta).a
- + texture2D(source, qt_TexCoord0 - offset - delta).a
- + texture2D(source, qt_TexCoord0 - offset + delta2).a
- + texture2D(source, qt_TexCoord0 - offset - delta2).a);
- lowp vec4 color = texture2D(source, qt_TexCoord0);
- gl_FragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
- }
- "
+ fragmentShader: "qrc:shaders/shadow.frag"
}
}
-
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_2.qml
index 160b89168e..64b950ace4 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/hiddensource_2.qml
@@ -43,23 +43,6 @@ Item {
property variant offset: Qt.size(4 / width, 4 / height)
property variant delta: Qt.size(0.5 / width, 0.5 / height)
- fragmentShader: "
- uniform lowp sampler2D source;
- uniform highp vec2 offset;
- uniform highp vec2 delta;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 delta2 = vec2(delta.x, -delta.y);
- lowp float shadow = 0.25 * (texture2D(source, qt_TexCoord0 - offset + delta).a
- + texture2D(source, qt_TexCoord0 - offset - delta).a
- + texture2D(source, qt_TexCoord0 - offset + delta2).a
- + texture2D(source, qt_TexCoord0 - offset - delta2).a);
- lowp vec4 color = texture2D(source, qt_TexCoord0);
- gl_FragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
- }
- "
+ fragmentShader: "qrc:shaders/shadow.frag"
}
}
-
-
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_1.qml
index 566edddedb..b071715cf2 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_1.qml
@@ -43,22 +43,6 @@ Item {
property variant offset: Qt.size(4 / width, 4 / height)
property variant delta: Qt.size(0.5 / width, 0.5 / height)
- fragmentShader: "
- uniform lowp sampler2D source;
- uniform highp vec2 offset;
- uniform highp vec2 delta;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 delta2 = vec2(delta.x, -delta.y);
- lowp float shadow = 0.25 * (texture2D(source, qt_TexCoord0 - offset + delta).a
- + texture2D(source, qt_TexCoord0 - offset - delta).a
- + texture2D(source, qt_TexCoord0 - offset + delta2).a
- + texture2D(source, qt_TexCoord0 - offset - delta2).a);
- lowp vec4 color = texture2D(source, qt_TexCoord0);
- gl_FragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
- }
- "
+ fragmentShader: "qrc:shaders/shadow.frag"
}
}
-
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_2.qml
index 0b8038e9ee..02ac70e69c 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/hiddensource/unhidden_2.qml
@@ -43,24 +43,6 @@ Item {
property variant offset: Qt.size(4 / width, 4 / height)
property variant delta: Qt.size(0.5 / width, 0.5 / height)
- fragmentShader: "
- uniform lowp sampler2D source;
- uniform highp vec2 offset;
- uniform highp vec2 delta;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 delta2 = vec2(delta.x, -delta.y);
- lowp float shadow = 0.25 * (texture2D(source, qt_TexCoord0 - offset + delta).a
- + texture2D(source, qt_TexCoord0 - offset - delta).a
- + texture2D(source, qt_TexCoord0 - offset + delta2).a
- + texture2D(source, qt_TexCoord0 - offset - delta2).a);
- lowp vec4 color = texture2D(source, qt_TexCoord0);
- gl_FragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
- }
- "
+ fragmentShader: "qrc:shaders/shadow.frag"
}
}
-
-
-
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/image/async.qml b/tests/manual/scenegraph_lancelot/data/shaders/image/async.qml
index 132f160a26..c4cf4cc1e4 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/image/async.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/image/async.qml
@@ -6,7 +6,7 @@ Item {
Image {
id: image;
- source: "./face-smile.png"
+ source: "face-smile.png"
visible: false
asynchronous: true
}
@@ -14,15 +14,7 @@ Item {
ShaderEffect {
anchors.fill: image
property variant source: image
-
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 0, 1) + texture2D(source, qt_TexCoord0);
- }
- "
+ fragmentShader: "qrc:shaders/gradient2.frag"
visible: image.status == Image.Ready
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/image/source.qml b/tests/manual/scenegraph_lancelot/data/shaders/image/source.qml
index 878eddeda5..04406829b3 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/image/source.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/image/source.qml
@@ -13,14 +13,6 @@ Item {
ShaderEffect {
anchors.fill: image
property variant source: image
-
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 0, 1) + texture2D(source, qt_TexCoord0);
- }
- "
+ fragmentShader: "qrc:shaders/gradient2.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_1.qml
index 0383feaf91..97b5760854 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_1.qml
@@ -32,13 +32,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient3.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_2.qml
index 2e7074c65d..ea3456838c 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/live/liveonce_2.qml
@@ -32,13 +32,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient3.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_1.qml
index 3793e655c7..9f0162ccd3 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_1.qml
@@ -16,7 +16,7 @@ Item {
height: 50
color: "red"
anchors.centerIn: parent
- transform: Rotation{ angle: 45}
+ transform: Rotation{ angle: 45 }
}
}
@@ -38,14 +38,7 @@ Item {
property variant source: source1
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(1, qt_TexCoord0.y, 0, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient4.frag"
}
ShaderEffect {
@@ -55,14 +48,7 @@ Item {
property variant source: source2
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient3.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_2.qml
index 2d8a4b6c09..e0c218ca69 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/live/livetwice_2.qml
@@ -16,7 +16,7 @@ Item {
height: 50
color: "red"
anchors.centerIn: parent
- transform: Rotation{ angle: 90}
+ transform: Rotation{ angle: 90 }
}
}
@@ -38,14 +38,7 @@ Item {
property variant source: source1
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(1, qt_TexCoord0.y, 0, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient4.frag"
}
ShaderEffect {
@@ -55,14 +48,7 @@ Item {
property variant source: source2
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient3.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/live/samesource.qml b/tests/manual/scenegraph_lancelot/data/shaders/live/samesource.qml
index 67e0cc36ad..5b1f15c01c 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/live/samesource.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/live/samesource.qml
@@ -24,14 +24,7 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient3.frag"
}
ShaderEffect {
@@ -41,13 +34,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient5.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/one-source.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/one-source.qml
index d57f7c5dfb..309db50ba2 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/one-source.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/one-source.qml
@@ -23,13 +23,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml
index e2a3ca7a0c..f473207235 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/rect.qml
@@ -22,14 +22,7 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
Rectangle {
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml
index 9df6b13c1e..2b04b76482 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_1.qml
@@ -47,14 +47,7 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_2.qml
index f997630d30..0ce09cda18 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_2.qml
@@ -47,14 +47,7 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_3.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_3.qml
index 0d3c1fc4ee..c02dfba9e2 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/switch_3.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/switch_3.qml
@@ -47,14 +47,7 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
+ fragmentShader: "qrc:shaders/gradient.frag"
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/two-sources.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/two-sources.qml
index 1fadabe5b6..dbb82a278e 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/two-sources.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/two-sources.qml
@@ -44,14 +44,6 @@ Item {
property variant colorSource: colorSource
property variant maskSource: maskSource;
- fragmentShader: "
- uniform lowp sampler2D maskSource;
- uniform lowp sampler2D colorSource;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx);
- }
- "
+ fragmentShader: "qrc:shaders/stencil.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/visible_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/visible_1.qml
index 7a3bf9fd36..309028807f 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/visible_1.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/visible_1.qml
@@ -27,14 +27,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
-
+ fragmentShader: "qrc:shaders/gradient.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/source/visible_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/source/visible_2.qml
index d60dbaee3d..df05c8f087 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/source/visible_2.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/source/visible_2.qml
@@ -27,14 +27,6 @@ Item {
property variant source: source
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
- }
- "
-
+ fragmentShader: "qrc:shaders/gradient.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/texture/size.qml b/tests/manual/scenegraph_lancelot/data/shaders/texture/size.qml
index ab8db47009..5738da5e8d 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/texture/size.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/texture/size.qml
@@ -18,22 +18,7 @@ Item {
property variant textureSize: source.textureSize
property color color: "black"
- fragmentShader: "
- uniform lowp sampler2D source;
- varying highp vec2 qt_TexCoord0;
- uniform highp vec2 textureSize;
- uniform lowp vec4 color;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 dx = vec2(0.5 / textureSize.x, 0.);
- highp vec2 dy = vec2(0., 0.5 / textureSize.y);
- gl_FragColor = color * 0.25
- * (texture2D(source, qt_TexCoord0 + dx + dy).a
- + texture2D(source, qt_TexCoord0 + dx - dy).a
- + texture2D(source, qt_TexCoord0 - dx + dy).a
- + texture2D(source, qt_TexCoord0 - dx - dy).a);
- }
- "
+ fragmentShader: "qrc:shaders/edge.frag"
}
Text {
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/wrap/modes.qml b/tests/manual/scenegraph_lancelot/data/shaders/wrap/modes.qml
index c008114810..baa002dc50 100644
--- a/tests/manual/scenegraph_lancelot/data/shaders/wrap/modes.qml
+++ b/tests/manual/scenegraph_lancelot/data/shaders/wrap/modes.qml
@@ -48,21 +48,6 @@ Item {
property variant yellow: repeat
property variant black: clamp
- fragmentShader: "
- uniform lowp sampler2D cyan;
- uniform lowp sampler2D magenta;
- uniform lowp sampler2D yellow;
- uniform lowp sampler2D black;
- varying highp vec2 qt_TexCoord0;
- uniform lowp float qt_Opacity;
- void main() {
- highp vec2 t = qt_TexCoord0 * 3. - 1.;
- lowp float c = texture2D(cyan, t + vec2(.05, .09)).a;
- lowp float m = texture2D(magenta, t + vec2(.04, -.10)).a;
- lowp float y = texture2D(yellow, t + vec2(-.10, .01)).a;
- lowp float k = texture2D(black, t).a;
- gl_FragColor = 1. - vec4(c + k, m + k, y + k, 0.);
- }
- "
+ fragmentShader: "qrc:shaders/cmyk.frag"
}
}
diff --git a/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml b/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml
new file mode 100644
index 0000000000..37367054b5
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shape/shape_text.qml
@@ -0,0 +1,91 @@
+import QtQuick 2.15
+import QtQuick.Shapes 1.0
+
+Item {
+ width: 320
+ height: 480
+
+ Column {
+ Item {
+ width: 200
+ height: 160
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillColor: "transparent"
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ strokeWidth: 4
+
+ PathText {
+ x: 96
+ y: 10
+ font.pixelSize: 120
+ text: "Qt"
+ }
+ }
+ }
+ }
+
+ Item {
+ width: 200
+ height: 160
+
+ Rectangle {
+ anchors.fill: parent
+ color: "blue"
+ }
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillColor: "red"
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ capStyle: ShapePath.RoundCap
+ strokeWidth: 8
+
+ PathText {
+ x: 96; y: 10
+ font.pixelSize: 150
+ text: "Qt"
+ }
+ }
+ }
+ }
+
+ Item {
+ width: 200
+ height: 160
+
+ Shape {
+ anchors.fill: parent
+ vendorExtensionsEnabled: false
+
+ ShapePath {
+ fillGradient: LinearGradient {
+ x1: 0; x2: 200; y1: 0; y2: 160
+ spread: ShapeGradient.PadSpread
+ GradientStop { position: 0.0; color: "red"; }
+ GradientStop { position: 1.0; color: "green"; }
+ }
+ strokeColor: "blue"
+ strokeStyle: ShapePath.DashLine
+ joinStyle: ShapePath.RoundJoin
+ strokeWidth: 4
+
+ PathText {
+ x: 96; y: 10
+ font.pixelSize: 150
+ text: "Qt"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag
new file mode 100644
index 0000000000..15459ffdb9
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/basic.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag
new file mode 100644
index 0000000000..5ef0333b6b
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/cmyk.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag
new file mode 100644
index 0000000000..edf2d11a93
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/culling.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag
new file mode 100644
index 0000000000..aecaa621ef
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/edge.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag
new file mode 100644
index 0000000000..ef7a9c10ca
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag
new file mode 100644
index 0000000000..ca58580786
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient2.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag
new file mode 100644
index 0000000000..e1fc8b0ce8
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient3.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag
new file mode 100644
index 0000000000..2e0b809d7d
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient4.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag
new file mode 100644
index 0000000000..106c2c5515
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/gradient5.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag
new file mode 100644
index 0000000000..788a047ab0
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/shadow.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag
new file mode 100644
index 0000000000..e3907a90d2
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/stencil.frag
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert
new file mode 100644
index 0000000000..14cb4e768f
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/+qsb/wave.vert
Binary files differ
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/basic.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/basic.frag
new file mode 100644
index 0000000000..6b3a881174
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/basic.frag
@@ -0,0 +1,5 @@
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/basic_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/basic_rhi.frag
new file mode 100644
index 0000000000..aa850af449
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/basic_rhi.frag
@@ -0,0 +1,8 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+void main() {
+ fragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk.frag
new file mode 100644
index 0000000000..d63a0fa6ee
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk.frag
@@ -0,0 +1,14 @@
+uniform lowp sampler2D cyan;
+uniform lowp sampler2D magenta;
+uniform lowp sampler2D yellow;
+uniform lowp sampler2D black;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ highp vec2 t = qt_TexCoord0 * 3. - 1.;
+ lowp float c = texture2D(cyan, t + vec2(.05, .09)).a;
+ lowp float m = texture2D(magenta, t + vec2(.04, -.10)).a;
+ lowp float y = texture2D(yellow, t + vec2(-.10, .01)).a;
+ lowp float k = texture2D(black, t).a;
+ gl_FragColor = 1. - vec4(c + k, m + k, y + k, 0.);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk_rhi.frag
new file mode 100644
index 0000000000..5d528e1d7a
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/cmyk_rhi.frag
@@ -0,0 +1,18 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D cyan;
+layout(binding = 2) uniform sampler2D magenta;
+layout(binding = 3) uniform sampler2D yellow;
+layout(binding = 4) uniform sampler2D black;
+
+void main() {
+ vec2 t = qt_TexCoord0 * 3. - 1.;
+ lowp float c = texture(cyan, t + vec2(.05, .09)).a;
+ lowp float m = texture(magenta, t + vec2(.04, -.10)).a;
+ lowp float y = texture(yellow, t + vec2(-.10, .01)).a;
+ lowp float k = texture(black, t).a;
+ fragColor = 1. - vec4(c + k, m + k, y + k, 0.);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/compile.bat b/tests/manual/scenegraph_lancelot/data/shared/shaders/compile.bat
new file mode 100644
index 0000000000..13435f76b6
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/compile.bat
@@ -0,0 +1,13 @@
+qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/wave.vert wave_rhi.vert
+
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/basic.frag basic_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/cmyk.frag cmyk_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/culling.frag culling_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/edge.frag edge_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/gradient.frag gradient_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/gradient2.frag gradient2_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/gradient3.frag gradient3_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/gradient4.frag gradient4_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/gradient5.frag gradient5_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/shadow.frag shadow_rhi.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/stencil.frag stencil_rhi.frag
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/culling.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/culling.frag
new file mode 100644
index 0000000000..1b12df7c6d
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/culling.frag
@@ -0,0 +1,9 @@
+varying highp vec2 qt_TexCoord0;
+uniform sampler2D frontSource;
+uniform sampler2D backSource;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = gl_FrontFacing
+ ? texture2D(frontSource, qt_TexCoord0)
+ : texture2D(backSource, qt_TexCoord0);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/culling_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/culling_rhi.frag
new file mode 100644
index 0000000000..8399bc0282
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/culling_rhi.frag
@@ -0,0 +1,13 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D frontSource;
+layout(binding = 1) uniform sampler2D backSource;
+
+void main() {
+ fragColor = gl_FrontFacing
+ ? texture(frontSource, qt_TexCoord0)
+ : texture(backSource, qt_TexCoord0);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/edge.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/edge.frag
new file mode 100644
index 0000000000..8cb616f3e0
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/edge.frag
@@ -0,0 +1,14 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform highp vec2 textureSize;
+uniform lowp vec4 color;
+uniform lowp float qt_Opacity;
+void main() {
+ highp vec2 dx = vec2(0.5 / textureSize.x, 0.);
+ highp vec2 dy = vec2(0., 0.5 / textureSize.y);
+ gl_FragColor = color * 0.25
+ * (texture2D(source, qt_TexCoord0 + dx + dy).a
+ + texture2D(source, qt_TexCoord0 + dx - dy).a
+ + texture2D(source, qt_TexCoord0 - dx + dy).a
+ + texture2D(source, qt_TexCoord0 - dx - dy).a);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/edge_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/edge_rhi.frag
new file mode 100644
index 0000000000..77d7b47499
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/edge_rhi.frag
@@ -0,0 +1,23 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+ vec2 textureSize;
+ vec4 color;
+} ubuf;
+
+void main() {
+ vec2 dx = vec2(0.5 / ubuf.textureSize.x, 0.);
+ vec2 dy = vec2(0., 0.5 / ubuf.textureSize.y);
+ fragColor = ubuf.color * 0.25
+ * (texture(source, qt_TexCoord0 + dx + dy).a
+ + texture(source, qt_TexCoord0 + dx - dy).a
+ + texture(source, qt_TexCoord0 - dx + dy).a
+ + texture(source, qt_TexCoord0 - dx - dy).a);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient.frag
new file mode 100644
index 0000000000..c581cc0c73
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient.frag
@@ -0,0 +1,6 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2.frag
new file mode 100644
index 0000000000..5f07e56d4a
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2.frag
@@ -0,0 +1,6 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 0, 1) + texture2D(source, qt_TexCoord0);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2_rhi.frag
new file mode 100644
index 0000000000..b08e6339b3
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient2_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 0, 1) + texture(source, qt_TexCoord0);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3.frag
new file mode 100644
index 0000000000..61c9d46f94
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3.frag
@@ -0,0 +1,6 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3_rhi.frag
new file mode 100644
index 0000000000..2e523c2879
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient3_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4.frag
new file mode 100644
index 0000000000..81d96ce126
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4.frag
@@ -0,0 +1,6 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(1, qt_TexCoord0.y, 0, 1) * texture2D(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4_rhi.frag
new file mode 100644
index 0000000000..a100ba2cd7
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient4_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(1, qt_TexCoord0.y, 0, 1) * texture(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5.frag
new file mode 100644
index 0000000000..33485542af
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5.frag
@@ -0,0 +1,6 @@
+uniform lowp sampler2D source;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5_rhi.frag
new file mode 100644
index 0000000000..4ec104bd14
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient5_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient_rhi.frag
new file mode 100644
index 0000000000..84eee1dbfe
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/gradient_rhi.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+void main() {
+ fragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture(source, qt_TexCoord0).a;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow.frag
new file mode 100644
index 0000000000..0a6cdf3044
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow.frag
@@ -0,0 +1,14 @@
+uniform lowp sampler2D source;
+uniform highp vec2 offset;
+uniform highp vec2 delta;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ highp vec2 delta2 = vec2(delta.x, -delta.y);
+ lowp float shadow = 0.25 * (texture2D(source, qt_TexCoord0 - offset + delta).a
+ + texture2D(source, qt_TexCoord0 - offset - delta).a
+ + texture2D(source, qt_TexCoord0 - offset + delta2).a
+ + texture2D(source, qt_TexCoord0 - offset - delta2).a);
+ lowp vec4 color = texture2D(source, qt_TexCoord0);
+ gl_FragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow_rhi.frag
new file mode 100644
index 0000000000..6a2d8dc122
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/shadow_rhi.frag
@@ -0,0 +1,23 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D source;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+ vec2 offset;
+ vec2 delta;
+} ubuf;
+
+void main() {
+ vec2 delta2 = vec2(ubuf.delta.x, -ubuf.delta.y);
+ float shadow = 0.25 * (texture(source, qt_TexCoord0 - ubuf.offset + ubuf.delta).a
+ + texture(source, qt_TexCoord0 - ubuf.offset - ubuf.delta).a
+ + texture(source, qt_TexCoord0 - ubuf.offset + delta2).a
+ + texture(source, qt_TexCoord0 - ubuf.offset - delta2).a);
+ vec4 color = texture(source, qt_TexCoord0);
+ fragColor = mix(vec4(vec3(0.), 0.5 * shadow), color, color.a);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil.frag
new file mode 100644
index 0000000000..33c6cee064
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil.frag
@@ -0,0 +1,7 @@
+uniform lowp sampler2D maskSource;
+uniform lowp sampler2D colorSource;
+varying highp vec2 qt_TexCoord0;
+uniform lowp float qt_Opacity;
+void main() {
+ gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil_rhi.frag b/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil_rhi.frag
new file mode 100644
index 0000000000..734be73fdb
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/stencil_rhi.frag
@@ -0,0 +1,11 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D maskSource;
+layout(binding = 2) uniform sampler2D colorSource;
+
+void main() {
+ fragColor = texture(maskSource, qt_TexCoord0).a * texture(colorSource, qt_TexCoord0.yx);
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/wave.vert b/tests/manual/scenegraph_lancelot/data/shared/shaders/wave.vert
new file mode 100644
index 0000000000..38e523c06b
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/wave.vert
@@ -0,0 +1,12 @@
+uniform highp mat4 qt_Matrix;
+attribute highp vec4 qt_Vertex;
+attribute highp vec2 qt_MultiTexCoord0;
+varying highp vec2 qt_TexCoord0;
+
+void main() {
+ highp vec4 pos = qt_Vertex;
+ pos.x += sin(qt_Vertex.y * 0.02) * 20.;
+ pos.y += sin(qt_Vertex.x * 0.02) * 20.;
+ gl_Position = qt_Matrix * pos;
+ qt_TexCoord0 = qt_MultiTexCoord0;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shaders/wave_rhi.vert b/tests/manual/scenegraph_lancelot/data/shared/shaders/wave_rhi.vert
new file mode 100644
index 0000000000..38f6173773
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shaders/wave_rhi.vert
@@ -0,0 +1,18 @@
+#version 440
+
+layout(location = 0) in vec4 qt_Vertex;
+layout(location = 1) in vec2 qt_MultiTexCoord0;
+
+layout(location = 0) out vec2 qt_TexCoord0;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+} ubuf;
+
+void main() {
+ vec4 pos = qt_Vertex;
+ pos.x += sin(qt_Vertex.y * 0.02) * 20.;
+ pos.y += sin(qt_Vertex.x * 0.02) * 20.;
+ gl_Position = ubuf.qt_Matrix * pos;
+ qt_TexCoord0 = qt_MultiTexCoord0;
+}
diff --git a/tests/manual/scenegraph_lancelot/data/shared/shared.qrc b/tests/manual/scenegraph_lancelot/data/shared/shared.qrc
new file mode 100644
index 0000000000..3618fc8b94
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shared/shared.qrc
@@ -0,0 +1,28 @@
+<RCC>
+ <qresource prefix="/">
+ <file>shaders/basic.frag</file>
+ <file>shaders/cmyk.frag</file>
+ <file>shaders/culling.frag</file>
+ <file>shaders/edge.frag</file>
+ <file>shaders/gradient.frag</file>
+ <file>shaders/gradient2.frag</file>
+ <file>shaders/gradient3.frag</file>
+ <file>shaders/gradient4.frag</file>
+ <file>shaders/gradient5.frag</file>
+ <file>shaders/shadow.frag</file>
+ <file>shaders/stencil.frag</file>
+ <file>shaders/wave.vert</file>
+ <file>shaders/+qsb/basic.frag</file>
+ <file>shaders/+qsb/cmyk.frag</file>
+ <file>shaders/+qsb/culling.frag</file>
+ <file>shaders/+qsb/edge.frag</file>
+ <file>shaders/+qsb/gradient.frag</file>
+ <file>shaders/+qsb/gradient2.frag</file>
+ <file>shaders/+qsb/gradient3.frag</file>
+ <file>shaders/+qsb/gradient4.frag</file>
+ <file>shaders/+qsb/gradient5.frag</file>
+ <file>shaders/+qsb/shadow.frag</file>
+ <file>shaders/+qsb/stencil.frag</file>
+ <file>shaders/+qsb/wave.vert</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/scenegraph_lancelot/scenegrabber/scenegrabber.pro b/tests/manual/scenegraph_lancelot/scenegrabber/scenegrabber.pro
index 704acd0aca..3ecb1f8ac1 100644
--- a/tests/manual/scenegraph_lancelot/scenegrabber/scenegrabber.pro
+++ b/tests/manual/scenegraph_lancelot/scenegrabber/scenegrabber.pro
@@ -5,3 +5,6 @@ CONFIG += console
QT += quick
SOURCES += main.cpp
+
+RESOURCES += \
+ ../data/shared/shared.qrc
diff --git a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp
index 3cc83e94da..a65bde1002 100644
--- a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp
+++ b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp
@@ -152,7 +152,7 @@ void tst_Scenegraph::testNoTextRendering()
void tst_Scenegraph::testRendering_data()
{
- setupTestSuite(usingRhi ? "shaders/" : ""); // on RHI, skip shader effects tests for now
+ setupTestSuite();
consecutiveErrors = 0;
aborted = false;
}
diff --git a/tests/manual/tableview/abstracttablemodel/main.qml b/tests/manual/tableview/abstracttablemodel/main.qml
index 4b9158f03c..9d849f2c8f 100644
--- a/tests/manual/tableview/abstracttablemodel/main.qml
+++ b/tests/manual/tableview/abstracttablemodel/main.qml
@@ -52,12 +52,6 @@ Window {
property int selectedX: -1
property int selectedY: -1
- TestTableModel {
- id: tableModel
- rowCount: 200
- columnCount: 200
- }
-
Rectangle {
anchors.fill: parent
anchors.margins: 10
@@ -72,19 +66,19 @@ Window {
spacing: 1
Button {
text: "Add row"
- onClicked: tableModel.insertRows(selectedY, 1)
+ onClicked: tableView.model.insertRows(selectedY, 1)
}
Button {
text: "Remove row"
- onClicked: tableModel.removeRows(selectedY, 1)
+ onClicked: tableView.model.removeRows(selectedY, 1)
}
Button {
text: "Add column"
- onClicked: tableModel.insertColumns(selectedX, 1)
+ onClicked: tableView.model.insertColumns(selectedX, 1)
}
Button {
text: "Remove column"
- onClicked: tableModel.removeColumns(selectedX, 1)
+ onClicked: tableView.model.removeColumns(selectedX, 1)
}
}
diff --git a/tests/manual/tableview/imagetiling/imageTiling.qml b/tests/manual/tableview/imagetiling/imageTiling.qml
new file mode 100644
index 0000000000..5c9cdb9888
--- /dev/null
+++ b/tests/manual/tableview/imagetiling/imageTiling.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.15
+import Qt.labs.qmlmodels 1.0
+
+TableView {
+ id: root
+ width: 1024
+ height: 200
+ property int tileSize: 1024 / 8
+ rowSpacing: 1; columnSpacing: 1
+ model: TableModel {
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ TableModelColumn {}
+ columns: [0, 1, 2, 3, 4, 5, 6, 7]
+ rows: [0, 1, 2, 3]
+ }
+ delegate: Image {
+ id: image
+// source: "map.png" // unscaled because png doesn't support QImageIOHandler::ScaledClipRect
+// source: "map.svgz" // tiles offset incorrectly: see QTBUG-81044
+ source: "map.pdf" // ok if the qtpdf plugin is installed
+ fillMode: Image.Pad
+ sourceSize.width: 1024
+ sourceClipRect: Qt.rect(model.column * tileSize, model.row * tileSize, tileSize, tileSize)
+ cache: true
+ asynchronous: true
+ Text {
+ text: image.sourceClipRect.width + "x" + image.sourceClipRect.height +
+ " " + image.sourceClipRect.x + "," + image.sourceClipRect.y +
+ "\nfrom " + image.sourceSize.toString() + // inconsistency: if we don't set sourceSize, it ends up being sourceClipRect.size
+ "\nimplicit " + image.implicitWidth + "x" + image.implicitHeight
+ }
+ }
+ columnWidthProvider: function (c) { return tileSize } // workaround for QTBUG-81045
+ rowHeightProvider: function (r) { return tileSize }
+}
diff --git a/tests/manual/tableview/imagetiling/map.pdf b/tests/manual/tableview/imagetiling/map.pdf
new file mode 100644
index 0000000000..31e7b5225e
--- /dev/null
+++ b/tests/manual/tableview/imagetiling/map.pdf
Binary files differ
diff --git a/tests/manual/tableview/imagetiling/map.png b/tests/manual/tableview/imagetiling/map.png
new file mode 100644
index 0000000000..23a8342818
--- /dev/null
+++ b/tests/manual/tableview/imagetiling/map.png
Binary files differ
diff --git a/tests/manual/tableview/imagetiling/map.svgz b/tests/manual/tableview/imagetiling/map.svgz
new file mode 100644
index 0000000000..64d509c106
--- /dev/null
+++ b/tests/manual/tableview/imagetiling/map.svgz
Binary files differ