aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-04-23 09:40:59 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-07-04 10:44:26 +0200
commit341ab7708049b1a3f559b76f16393e688951a938 (patch)
tree0203da53d1adf5025fa85ecc38e0e37bce35c46f /tests
parent1f01b44d20471a7f4a5029a4c0049e8296749fef (diff)
Add the graphics api independent scenegraph port
Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/drawingmodes/tst_drawingmodes.cpp25
-rw-r--r--tests/auto/quick/nodes/tst_nodestest.cpp7
-rw-r--r--tests/auto/quick/nokeywords/tst_nokeywords.cpp9
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp27
-rw-r--r--tests/auto/quick/scenegraph/data/render_bug37422.frag9
-rw-r--r--tests/auto/quick/scenegraph/data/render_bug37422.frag.qsbbin0 -> 864 bytes
-rw-r--r--tests/auto/quick/scenegraph/data/render_bug37422.qml6
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp71
-rw-r--r--tests/manual/nodetypes_ng/AtlasedImages.qml101
-rw-r--r--tests/manual/nodetypes_ng/CompressedImages.qml78
-rw-r--r--tests/manual/nodetypes_ng/DistanceFieldText.qml84
-rw-r--r--tests/manual/nodetypes_ng/Images.qml128
-rw-r--r--tests/manual/nodetypes_ng/Layers.qml174
-rw-r--r--tests/manual/nodetypes_ng/LotsOfNodes.qml70
-rw-r--r--tests/manual/nodetypes_ng/LotsOfRects.qml260
-rw-r--r--tests/manual/nodetypes_ng/MoreWindows.qml105
-rw-r--r--tests/manual/nodetypes_ng/MultiClipRects.qml142
-rw-r--r--tests/manual/nodetypes_ng/Painter.qml94
-rw-r--r--tests/manual/nodetypes_ng/Rects.qml147
-rw-r--r--tests/manual/nodetypes_ng/ShaderEffect.qml174
-rw-r--r--tests/manual/nodetypes_ng/ShaderEffectNoAnim.qml85
-rw-r--r--tests/manual/nodetypes_ng/ShaderEffectSource.qml80
-rw-r--r--tests/manual/nodetypes_ng/SimpleRect.qml68
-rw-r--r--tests/manual/nodetypes_ng/Text.qml84
-rw-r--r--tests/manual/nodetypes_ng/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--tests/manual/nodetypes_ng/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--tests/manual/nodetypes_ng/blacknwhite.pngbin0 -> 156 bytes
-rwxr-xr-xtests/manual/nodetypes_ng/buildshaders.bat4
-rw-r--r--tests/manual/nodetypes_ng/car_etc2_nomips.ktxbin0 -> 11908 bytes
-rw-r--r--tests/manual/nodetypes_ng/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--tests/manual/nodetypes_ng/main.qml102
-rw-r--r--tests/manual/nodetypes_ng/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--tests/manual/nodetypes_ng/nodetypes_ng.cpp318
-rw-r--r--tests/manual/nodetypes_ng/nodetypes_ng.pro11
-rw-r--r--tests/manual/nodetypes_ng/nodetypes_ng.qrc38
-rw-r--r--tests/manual/nodetypes_ng/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--tests/manual/nodetypes_ng/qt.pngbin0 -> 11917 bytes
-rw-r--r--tests/manual/nodetypes_ng/qt_bc1_10mips.ktxbin0 -> 174912 bytes
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass1.frag23
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass1.frag.qsbbin0 -> 2218 bytes
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass1_legacy_gl.frag11
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass2.frag23
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass2.frag.qsbbin0 -> 2131 bytes
-rw-r--r--tests/manual/nodetypes_ng/shadow_pass2_legacy_gl.frag12
-rw-r--r--tests/manual/nodetypes_ng/wobble.frag20
-rw-r--r--tests/manual/nodetypes_ng/wobble.frag.qsbbin0 -> 2013 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble.vert22
-rw-r--r--tests/manual/nodetypes_ng/wobble.vert.qsbbin0 -> 2001 bytes
-rw-r--r--tests/manual/nodetypes_ng/wobble_legacy_gl.frag10
-rw-r--r--tests/manual/nodetypes_ng/wobble_legacy_gl.vert8
50 files changed, 2600 insertions, 30 deletions
diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
index afc66948b0..f3825b350f 100644
--- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
+++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
@@ -69,6 +69,9 @@ private slots:
void triangles();
void triangleStrip();
void triangleFan();
+
+private:
+ bool isRunningOnRhi() const;
};
class DrawingModeItem : public QQuickItem
@@ -260,6 +263,9 @@ void tst_drawingmodes::lineLoop()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms");
+ if (isRunningOnRhi())
+ QSKIP("Line loops are not supported by some modern graphics APIs - skipping test");
+
QImage fb = runTest("DrawingModes.qml");
QCOMPARE(fb.width(), 200);
@@ -350,6 +356,9 @@ void tst_drawingmodes::triangleFan()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms");
+ if (isRunningOnRhi())
+ QSKIP("Triangle fans are not supported by some modern graphics APIs - skipping test");
+
QImage fb = runTest("DrawingModes.qml");
QCOMPARE(fb.width(), 200);
@@ -368,6 +377,22 @@ void tst_drawingmodes::triangleFan()
QVERIFY(!hasPixelAround(fb, 37, 100));
}
+bool tst_drawingmodes::isRunningOnRhi() const
+{
+ static bool retval = false;
+ static bool decided = false;
+ if (!decided) {
+ decided = true;
+ QQuickView dummy;
+ dummy.show();
+ QTest::qWaitForWindowExposed(&dummy);
+ QSGRendererInterface::GraphicsApi api = dummy.rendererInterface()->graphicsApi();
+ retval = QSGRendererInterface::isApiRhiBased(api);
+ dummy.hide();
+ }
+ return retval;
+}
+
QTEST_MAIN(tst_drawingmodes)
diff --git a/tests/auto/quick/nodes/tst_nodestest.cpp b/tests/auto/quick/nodes/tst_nodestest.cpp
index 79a9e5f757..bd5e6c6383 100644
--- a/tests/auto/quick/nodes/tst_nodestest.cpp
+++ b/tests/auto/quick/nodes/tst_nodestest.cpp
@@ -39,7 +39,7 @@
#include <QtQuick/qsgsimplerectnode.h>
#include <QtQuick/qsgsimpletexturenode.h>
-#include <QtQuick/private/qsgtexture_p.h>
+#include <QtQuick/private/qsgplaintexture_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
@@ -99,7 +99,10 @@ void NodesTest::initTestCase()
auto rc = renderLoop->createRenderContext(renderLoop->sceneGraphContext());
renderContext = static_cast<QSGDefaultRenderContext *>(rc);
QVERIFY(renderContext);
- renderContext->initialize(context);
+ QSGDefaultRenderContext::InitParams rcParams;
+ rcParams.openGLContext = context;
+ rcParams.initialSurfacePixelSize = QSize(512, 512); // dummy, make up something
+ renderContext->initialize(&rcParams);
QVERIFY(renderContext->isValid());
}
diff --git a/tests/auto/quick/nokeywords/tst_nokeywords.cpp b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
index e6655589a3..c0b66f1c3f 100644
--- a/tests/auto/quick/nokeywords/tst_nokeywords.cpp
+++ b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
@@ -49,7 +49,7 @@
#include <QtQuick/private/qsgcontext_p.h>
#include <QtQuick/private/qsgcontextplugin_p.h>
#if QT_CONFIG(opengl)
-#include <QtQuick/private/qsgdefaultdistancefieldglyphcache_p.h>
+#include <QtQuick/private/qsgopengldistancefieldglyphcache_p.h>
#include <QtQuick/private/qsgdefaultglyphnode_p.h>
#include <QtQuick/private/qsgdefaultinternalimagenode_p.h>
#include <QtQuick/private/qsgdefaultinternalrectanglenode_p.h>
@@ -65,9 +65,16 @@
#include <QtQuick/private/qsgrendernode_p.h>
#include <QtQuick/private/qsgtexturematerial_p.h>
#include <QtQuick/private/qsgtexture_p.h>
+#include <QtQuick/private/qsgplaintexture_p.h>
#include <QtQuick/private/qsgthreadedrenderloop_p.h>
#include <QtQuick/private/qsgwindowsrenderloop_p.h>
+#include <QtQuick/private/qsgrhiatlastexture_p.h>
+#include <QtQuick/private/qsgrhidistancefieldglyphcache_p.h>
+#include <QtQuick/private/qsgrhilayer_p.h>
+#include <QtQuick/private/qsgrhishadereffectnode_p.h>
+#include <QtQuick/private/qsgrhitextureglyphcache_p.h>
+
#undef signals
#undef slots
#undef emit
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 0e06ee6f50..d862e51dfa 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -61,6 +61,9 @@ private slots:
void renderOrder();
void messUpState();
void matrix();
+
+private:
+ bool isRunningOnRhi() const;
};
class ClearNode : public QSGRenderNode
@@ -218,6 +221,9 @@ void tst_rendernode::renderOrder()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms");
+ if (isRunningOnRhi())
+ QSKIP("Render nodes not yet supported with QRhi");
+
QImage fb = runTest("RenderOrder.qml");
const qreal scaleFactor = QGuiApplication::primaryScreen()->devicePixelRatio();
@@ -247,6 +253,9 @@ void tst_rendernode::messUpState()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms");
+ if (isRunningOnRhi())
+ QSKIP("Render nodes not yet supported with QRhi");
+
QImage fb = runTest("MessUpState.qml");
int x1 = 0;
int x2 = fb.width() / 2;
@@ -304,6 +313,9 @@ void tst_rendernode::matrix()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms");
+ if (isRunningOnRhi())
+ QSKIP("Render nodes not yet supported with QRhi");
+
qmlRegisterType<StateRecordingRenderNodeItem>("RenderNode", 1, 0, "StateRecorder");
StateRecordingRenderNode::matrices.clear();
runTest("matrix.qml");
@@ -351,6 +363,21 @@ void tst_rendernode::matrix()
}
}
+bool tst_rendernode::isRunningOnRhi() const
+{
+ static bool retval = false;
+ static bool decided = false;
+ if (!decided) {
+ decided = true;
+ QQuickView dummy;
+ dummy.show();
+ QTest::qWaitForWindowExposed(&dummy);
+ QSGRendererInterface::GraphicsApi api = dummy.rendererInterface()->graphicsApi();
+ retval = QSGRendererInterface::isApiRhiBased(api);
+ dummy.hide();
+ }
+ return retval;
+}
QTEST_MAIN(tst_rendernode)
diff --git a/tests/auto/quick/scenegraph/data/render_bug37422.frag b/tests/auto/quick/scenegraph/data/render_bug37422.frag
new file mode 100644
index 0000000000..da157232ac
--- /dev/null
+++ b/tests/auto/quick/scenegraph/data/render_bug37422.frag
@@ -0,0 +1,9 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+void main()
+{
+ fragColor = vec4(1, 0, 0, 1);
+}
diff --git a/tests/auto/quick/scenegraph/data/render_bug37422.frag.qsb b/tests/auto/quick/scenegraph/data/render_bug37422.frag.qsb
new file mode 100644
index 0000000000..1233ccfbca
--- /dev/null
+++ b/tests/auto/quick/scenegraph/data/render_bug37422.frag.qsb
Binary files differ
diff --git a/tests/auto/quick/scenegraph/data/render_bug37422.qml b/tests/auto/quick/scenegraph/data/render_bug37422.qml
index c1b47eddb8..09661d8ccb 100644
--- a/tests/auto/quick/scenegraph/data/render_bug37422.qml
+++ b/tests/auto/quick/scenegraph/data/render_bug37422.qml
@@ -26,7 +26,7 @@
**
****************************************************************************/
-import QtQuick 2.2
+import QtQuick 2.12
/*
The test verifies that batching does not interfere with overlapping
@@ -71,7 +71,9 @@ RenderTestBase
width: 100
height: 9
y: 10
- fragmentShader: "varying highp vec2 qt_TexCoord0; void main() { gl_FragColor = vec4(1, 0, 0, 1); }"
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL
+ ? "varying highp vec2 qt_TexCoord0; void main() { gl_FragColor = vec4(1, 0, 0, 1); }"
+ : "file:data/render_bug37422.frag.qsb"
Rectangle {
width: 5
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index b4abdd6fe2..c15f1e941e 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -70,16 +70,17 @@ public:
QColor color() const { return m_color; }
- QSGNode *updatePaintNode(QSGNode *old, UpdatePaintNodeData *)
+ QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
{
- if (old)
- delete old;
-
- QSGNode *node = new QSGNode();
-
- for (int y=0; y<height(); ++y) {
- for (int x=0; x<width(); ++x) {
- QSGSimpleRectNode *rn = new QSGSimpleRectNode();
+ delete node;
+ node = new QSGNode;
+
+ const int w = width();
+ const int h = height();
+ QQuickWindow *win = window();
+ for (int y = 0; y < h; ++y) {
+ for (int x = 0; x < w; ++x) {
+ QSGRectangleNode *rn = win->createRectangleNode();
rn->setRect(x, y, 1, 1);
rn->setColor(m_color);
node->appendChildNode(rn);
@@ -90,7 +91,7 @@ public:
}
Q_SIGNALS:
- void colorChanged(const QColor &c );
+ void colorChanged(const QColor &c);
private:
QColor m_color;
@@ -117,7 +118,8 @@ private slots:
private:
bool m_brokenMipmapSupport;
QQuickView *createView(const QString &file, QWindow *parent = nullptr, int x = -1, int y = -1, int w = -1, int h = -1);
- bool isRunningOnOpenGL();
+ bool isRunningOnOpenGLDirectly();
+ bool isRunningOnRhi();
};
template <typename T> class ScopedList : public QList<T> {
@@ -402,7 +404,7 @@ void tst_SceneGraph::render_data()
<< "render_bug37422.qml"
<< "render_OpacityThroughBatchRoot.qml";
if (!m_brokenMipmapSupport)
- files << "render_Mipmap.qml";
+ files << "render_Mipmap.qml";
QRegExp sampleCount("#samples: *(\\d+)");
// X:int Y:int R:float G:float B:float Error:float
@@ -444,8 +446,8 @@ void tst_SceneGraph::render_data()
void tst_SceneGraph::render()
{
- if (!isRunningOnOpenGL())
- QSKIP("Skipping complex rendering tests due to not running with OpenGL");
+ if (!isRunningOnOpenGLDirectly() && !isRunningOnRhi())
+ QSKIP("Skipping complex rendering tests due to not running with OpenGL or QRhi");
QFETCH(QString, file);
QFETCH(QList<Sample>, baseStage);
@@ -495,7 +497,7 @@ void tst_SceneGraph::render()
// current on the other window.
void tst_SceneGraph::hideWithOtherContext()
{
- if (!isRunningOnOpenGL())
+ if (!isRunningOnOpenGLDirectly())
QSKIP("Skipping OpenGL context test due to not running with OpenGL");
QWindow window;
@@ -559,18 +561,37 @@ void tst_SceneGraph::createTextureFromImage()
QCOMPARE(texture->hasAlphaChannel(), expectedAlpha);
}
-bool tst_SceneGraph::isRunningOnOpenGL()
+bool tst_SceneGraph::isRunningOnOpenGLDirectly()
+{
+ static bool retval = false;
+ static bool decided = false;
+ if (!decided) {
+ decided = true;
+ QQuickView dummy;
+ dummy.show();
+ QTest::qWaitForWindowExposed(&dummy);
+ retval = dummy.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
+ dummy.hide();
+ }
+ return retval;
+}
+
+bool tst_SceneGraph::isRunningOnRhi()
{
- bool retval = false;
- QQuickView dummy;
- dummy.show();
- if (!QTest::qWaitForWindowExposed(&dummy)) {
- [](){ QFAIL("Could not show a QQuickView"); }();
- return false;
+ static bool retval = false;
+ static bool decided = false;
+ if (!decided) {
+ decided = true;
+ QQuickView dummy;
+ dummy.show();
+ if (!QTest::qWaitForWindowExposed(&dummy)) {
+ [](){ QFAIL("Could not show a QQuickView"); }();
+ return false;
+ }
+ QSGRendererInterface::GraphicsApi api = dummy.rendererInterface()->graphicsApi();
+ retval = QSGRendererInterface::isApiRhiBased(api);
+ dummy.hide();
}
- if (dummy.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL)
- retval = true;
- dummy.hide();
return retval;
}
diff --git a/tests/manual/nodetypes_ng/AtlasedImages.qml b/tests/manual/nodetypes_ng/AtlasedImages.qml
new file mode 100644
index 0000000000..5cb5451dfd
--- /dev/null
+++ b/tests/manual/nodetypes_ng/AtlasedImages.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.8
+
+// The images here should result in a single draw call that uses an atlas
+// texture. The ShaderEffect is then another one (and exercises having an
+// effect on an Image backed by an atlased texture).
+
+Item {
+ Row {
+ Image {
+ source: "qrc:/qt.png"
+ sourceSize: Qt.size(64, 64)
+ }
+ Image {
+ source: "qrc:/face-smile.png"
+ }
+ Image {
+ source: "qrc:/arrow-down.png"
+ }
+ Image {
+ source: "qrc:/arrow-up.png"
+ NumberAnimation on rotation {
+ from: 0; to: 360; duration: 3000
+ loops: Animation.Infinite
+ }
+ }
+ Image {
+ id: minusSign
+ source: "qrc:/minus-sign.png"
+ }
+ // Using a ShaderEffectSource would go through an extra render target
+ // texture. By specifying the Image directly as the source, no extra
+ // texture is created. However, when the source Image is atlased, extra
+ // steps are taken internally to create a non-atlased texture for the
+ // effect.
+ ShaderEffect {
+ id: eff
+ width: minusSign.width
+ height: minusSign.height
+ property variant source: minusSign
+ property real amplitude: 0.05
+ property real frequency: 20
+ property real time: 0
+ NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
+ vertexShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.vert" : "qrc:/wobble.vert.qsb"
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.frag" : "qrc:/wobble.frag.qsb"
+ }
+ Image {
+ source: "qrc:/plus-sign.png"
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/CompressedImages.qml b/tests/manual/nodetypes_ng/CompressedImages.qml
new file mode 100644
index 0000000000..b05baf8ccb
--- /dev/null
+++ b/tests/manual/nodetypes_ng/CompressedImages.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ border.color: "red"
+ border.width: 4
+ width: im1.sourceSize.width + 8
+ height: im1.sourceSize.height + 8
+ Image {
+ id: im1
+ source: "qrc:/car_etc2_nomips.ktx"
+ anchors.centerIn: parent
+ }
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ border.color: "red"
+ border.width: 4
+ width: im2.sourceSize.width + 8
+ height: im2.sourceSize.height + 8
+ Image {
+ id: im2
+ source: "qrc:/qt_bc1_10mips.ktx"
+ anchors.centerIn: parent
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/DistanceFieldText.qml b/tests/manual/nodetypes_ng/DistanceFieldText.qml
new file mode 100644
index 0000000000..3a6eb4186e
--- /dev/null
+++ b/tests/manual/nodetypes_ng/DistanceFieldText.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Text {
+ id: text1
+ renderType: Text.QtRendering
+ anchors.top: parent.top
+ text: "árvíztűrő tükörfúrógép\nÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP"
+ }
+ Text {
+ renderType: Text.QtRendering
+ anchors.bottom: parent.bottom
+ text: "the quick brown fox jumps over the lazy dog\nTHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
+ color: "red"
+ }
+ Text {
+ renderType: Text.QtRendering
+ anchors.centerIn: parent
+ text: "rotate rotate rotate"
+ font.bold: true
+ font.pointSize: 20
+ color: "green"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Row {
+ anchors.top: text1.bottom
+ anchors.margins: 10
+ Text { renderType: Text.QtRendering; font.pointSize: 24; text: "Normal" }
+ Text { renderType: Text.QtRendering; font.pointSize: 24; text: "Raised"; style: Text.Raised; styleColor: "#AAAAAA" }
+ Text { renderType: Text.QtRendering; font.pointSize: 24; text: "Outline"; style: Text.Outline; styleColor: "red" }
+ Text { renderType: Text.QtRendering; font.pointSize: 24; text: "Sunken"; style: Text.Sunken; styleColor: "#AAAAAA" }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/Images.qml b/tests/manual/nodetypes_ng/Images.qml
new file mode 100644
index 0000000000..809a6dc74d
--- /dev/null
+++ b/tests/manual/nodetypes_ng/Images.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.3
+
+Item {
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Image {
+ id: im
+ source: "qrc:/qt.png"
+ mipmap: true
+
+ // Changing the mipmap property results in...nothing but a warning, but
+ // regardless, enable the following to test.
+// Timer {
+// interval: 5000
+// onTriggered: {
+// if (im.mipmap) {
+// console.log("disabling mipmap");
+// im.mipmap = false;
+// } else {
+// console.log("enabling mipmap");
+// im.mipmap = true;
+// }
+// }
+// running: true
+// repeat: true
+// }
+
+ SequentialAnimation on scale {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 1.0
+ to: 4.0
+ duration: 2000
+ }
+ NumberAnimation {
+ from: 4.0
+ to: 0.1
+ duration: 3000
+ }
+ NumberAnimation {
+ from: 0.1
+ to: 1.0
+ duration: 1000
+ }
+ }
+
+ Image {
+ anchors.centerIn: parent
+ source: "qrc:/face-smile.png"
+ }
+ }
+
+ Image {
+ source: "qrc:/face-smile.png"
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ antialiasing: true // trigger smooth texture material
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Item {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ scale: 20
+ width: 20
+ Image { x: 0; source: "blacknwhite.png"; smooth: false } // solid black
+ Image { x: 2; source: "blacknwhite.png"; smooth: true } // fade to white on right
+ Image { x: 4; source: "blacknwhite.png"; smooth: false } // solid black
+ Image { x: 6; source: "blacknwhite.png"; smooth: true } // fade to white on right
+ }
+}
diff --git a/tests/manual/nodetypes_ng/Layers.qml b/tests/manual/nodetypes_ng/Layers.qml
new file mode 100644
index 0000000000..defab85f7e
--- /dev/null
+++ b/tests/manual/nodetypes_ng/Layers.qml
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ color: "lightGray"
+ anchors.fill: parent
+ anchors.margins: 10
+
+ Column {
+ anchors.fill: parent
+ spacing: 10
+
+ Row {
+ width: parent.width
+ Rectangle {
+ color: "red"
+ width: 300
+ height: 100
+ layer.enabled: true
+ Text { text: "this is in a layer, going through an offscreen render target" }
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 50
+ height: 50
+ x: 275
+ y: 75
+ }
+ }
+ Rectangle {
+ color: "white"
+ width: 300
+ height: 100
+ Text { text: "this is not a layer" }
+ }
+ Rectangle {
+ color: "green"
+ width: 300
+ height: 100
+ layer.enabled: true
+ Text { text: "this is another layer" }
+ Rectangle {
+ border.width: 4
+ border.color: "black"
+ anchors.centerIn: parent
+ width: 150
+ height: 50
+ layer.enabled: true
+ Text {
+ anchors.centerIn: parent
+ text: "layer in a layer"
+ }
+ }
+ Image {
+ source: "qrc:/face-smile.png"
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+ }
+ }
+
+ Row {
+ width: parent.width
+ Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 4
+ width: 300
+ height: 100
+ layer.enabled: true
+ layer.smooth: true // sets min/mag filter in the sampler to Linear
+ layer.textureSize: Qt.size(width * 2, height * 2)
+ Text { x: 10; y: 10; text: "supersampled layer\n(rendered at 2x, sampled with linear min/mag)" }
+ Rectangle {
+ width: 30
+ height: 30
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+ }
+ Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 4
+ width: 300
+ height: 100
+ layer.enabled: true
+ layer.samples: 4 // 4x MSAA
+ Text { x: 10; y: 10; text: "4x MSAA layer\n(rendered into multisample texture/renderbuffer,\nthen resolved into non-msaa texture)" }
+ Rectangle {
+ width: 30
+ height: 30
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 10
+ color: "red"
+ NumberAnimation on rotation { from: 360; to: 0; duration: 2000; loops: Animation.Infinite; }
+ }
+ }
+ Rectangle {
+ color: "white"
+ border.color: "black"
+ border.width: 4
+ width: 300
+ height: 100
+ layer.enabled: true
+ layer.mipmap: true
+ Text { x: 10; y: 10; text: "Mipmapped layer" }
+ Rectangle {
+ width: 30
+ height: 30
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 10
+ color: "red"
+ NumberAnimation on rotation { from: 360; to: 0; duration: 2000; loops: Animation.Infinite; }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/LotsOfNodes.qml b/tests/manual/nodetypes_ng/LotsOfNodes.qml
new file mode 100644
index 0000000000..eee1828b96
--- /dev/null
+++ b/tests/manual/nodetypes_ng/LotsOfNodes.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+import Stuff 1.0
+
+Item {
+ id: root
+
+ Column {
+ width: 100
+ clip: true
+ PerPixelRect { width: 100; height: 100; color: "red" }
+ PerPixelRect { width: 100; height: 100; color: "blue" }
+ }
+
+ Column {
+ x: 100
+ width: 100
+ PerPixelRect { width: 100; height: 100; color: "black" }
+ PerPixelRect { width: 100; height: 100; color: "#00ff00" }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/LotsOfRects.qml b/tests/manual/nodetypes_ng/LotsOfRects.qml
new file mode 100644
index 0000000000..f20839d6c3
--- /dev/null
+++ b/tests/manual/nodetypes_ng/LotsOfRects.qml
@@ -0,0 +1,260 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ anchors.margins: 4
+ anchors.fill: parent
+
+ // Background
+ gradient: Gradient {
+ GradientStop { position: 0; color: "steelblue" }
+ GradientStop { position: 1; color: "black" }
+ }
+
+ // Animated gradient stops.
+ // NB! Causes a full buffer rebuild on every animated change due to the geometry change!
+ Row {
+ spacing: 10
+ Repeater {
+ model: 20
+ Rectangle {
+ width: 20
+ height: 20
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "red" }
+ GradientStop { NumberAnimation on position { from: 0.01; to: 0.99; duration: 5000; loops: Animation.Infinite } color: "yellow" }
+ GradientStop { position: 1.0; color: "green" }
+ }
+ }
+ }
+ }
+
+ // Rounded rects with border (smooth material)
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "blue"
+ width: 100
+ height: 50
+ y: 50
+ radius: 16
+ border.color: "red"
+ border.width: 4
+
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 50
+ to: 150
+ duration: 7000
+ }
+ NumberAnimation {
+ from: 150
+ to: 50
+ duration: 3000
+ }
+ }
+ }
+ }
+ }
+
+ // Clip using scissor
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "green"
+ width: 100
+ height: 100
+ y: 150
+ NumberAnimation on y {
+ from: 150
+ to: 200
+ duration: 2000
+ loops: Animation.Infinite
+ }
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 50
+ height: 50
+ x: 75
+ y: 75
+ }
+ }
+ }
+ }
+
+ // Clip using scissor
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "green"
+ width: 100
+ height: 100
+ y: 300
+ NumberAnimation on y {
+ from: 300
+ to: 400
+ duration: 2000
+ loops: Animation.Infinite
+ }
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 50
+ height: 50
+ x: 75
+ y: 75
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+ }
+ }
+ }
+
+ // Clip using stencil
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "green"
+ width: 100
+ height: 100
+ y: 450
+ NumberAnimation on y {
+ from: 450
+ to: 550
+ duration: 2000
+ loops: Animation.Infinite
+ }
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 50
+ height: 50
+ x: 75
+ y: 75
+ }
+ }
+ }
+ }
+
+ // The signature red square with another item with animated opacity blended on top
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+
+ Rectangle {
+ color: "gray"
+ width: 50
+ height: 50
+ anchors.centerIn: parent
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 1.0
+ to: 0.0
+ duration: 4000
+ }
+ NumberAnimation {
+ from: 0.0
+ to: 1.0
+ duration: 4000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+
+ // Animated size and color.
+ // NB! Causes a full buffer rebuild on every animated change due to the geometry change!
+ Rectangle {
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ width: 10
+ height: 100
+ ColorAnimation on color {
+ from: "blue"
+ to: "purple"
+ duration: 5000
+ loops: Animation.Infinite
+ }
+ NumberAnimation on width {
+ from: 10
+ to: 300
+ duration: 5000
+ loops: Animation.Infinite
+ }
+ }
+
+ // Semi-transparent rect on top.
+ Rectangle {
+ anchors.centerIn: parent
+ opacity: 0.2
+ color: "black"
+ anchors.fill: parent
+ anchors.margins: 10
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/MoreWindows.qml b/tests/manual/nodetypes_ng/MoreWindows.qml
new file mode 100644
index 0000000000..1144572ebe
--- /dev/null
+++ b/tests/manual/nodetypes_ng/MoreWindows.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+import QtQuick.Window 2.12
+
+Item {
+ Rectangle {
+ x: 20
+ y: 20
+ width: 300
+ height: 120
+ color: "red"
+ border.color: "black"
+ border.width: 2
+ Text {
+ text: "Click to toggle window visibility\n(switch to another test to destroy)"
+ font.bold: true
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: win.visible = !win.visible
+ }
+ }
+
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "green"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Window {
+ id: win
+ width: 640
+ height: 480
+
+ Rectangle {
+ color: "lightGray"
+ anchors.fill: parent
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+ Text {
+ text: "Another QQuickWindow"
+ anchors.top: parent.top
+ anchors.margins: 20
+ ColorAnimation on color { from: "red"; to: "green"; duration: 2000; loops: Animation.Infinite }
+ }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/MultiClipRects.qml b/tests/manual/nodetypes_ng/MultiClipRects.qml
new file mode 100644
index 0000000000..793ebeae93
--- /dev/null
+++ b/tests/manual/nodetypes_ng/MultiClipRects.qml
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ anchors.margins: 4
+ anchors.fill: parent
+
+ // Background
+ gradient: Gradient {
+ GradientStop { position: 0; color: "steelblue" }
+ GradientStop { position: 1; color: "black" }
+ }
+
+ // Clip using scissor, 2 levels.
+ // This means that the lightGreen-yellow-blue batch's clip list will have two clips.
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "green"
+ width: 150
+ height: 150
+ y: 200
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 150
+ height: 150
+ x: 25
+ y: 25
+ clip: true
+
+ Rectangle {
+ color: "yellow"
+ width: 50
+ height: 50
+ x: 100
+ y: 100
+ NumberAnimation on rotation { from: 360; to: 0; duration: 5000; loops: Animation.Infinite; }
+ }
+
+ Rectangle {
+ color: "blue"
+ width: 50
+ height: 50
+ x: -25
+ y: 100
+ NumberAnimation on rotation { from: 360; to: 0; duration: 5000; loops: Animation.Infinite; }
+ }
+ }
+ }
+ }
+ }
+
+ // Clip using stencil, 2 levels.
+ // This means that the lightGreen-yellow batch's clip list will have two clips
+ // and so two stencil draw calls before drawing the actual content.
+ Row {
+ spacing: 10
+ Repeater {
+ model: 5
+ Rectangle {
+ color: "green"
+ width: 200
+ height: 200
+ y: 450
+ NumberAnimation on rotation { from: 0; to: 360; duration: 5000; loops: Animation.Infinite; }
+ clip: true
+ Rectangle {
+ color: "lightGreen"
+ width: 150
+ height: 150
+ x: 50
+ y: 50
+ rotation: 30
+ clip: true
+
+ Rectangle {
+ color: "yellow"
+ width: 100
+ height: 100
+ x: 75
+ y: 75
+ NumberAnimation on rotation { from: 360; to: 0; duration: 5000; loops: Animation.Infinite; }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/Painter.qml b/tests/manual/nodetypes_ng/Painter.qml
new file mode 100644
index 0000000000..c5db3496f8
--- /dev/null
+++ b/tests/manual/nodetypes_ng/Painter.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+import Stuff 1.0
+
+Item {
+ ListModel {
+ id: balloonModel
+ ListElement {
+ balloonWidth: 200
+ }
+ ListElement {
+ balloonWidth: 120
+ }
+ ListElement {
+ balloonWidth: 120
+ }
+ ListElement {
+ balloonWidth: 120
+ }
+ ListElement {
+ balloonWidth: 120
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ anchors.margins: 10
+ id: balloonView
+ model: balloonModel
+ spacing: 5
+ delegate: TextBalloon {
+ anchors.right: index % 2 == 0 ? undefined : parent.right
+ height: 60
+ rightAligned: index % 2 == 0 ? false : true
+ width: balloonWidth
+ innerAnim: model.index === 1
+ NumberAnimation on width {
+ from: 200
+ to: 300
+ duration: 5000
+ running: model.index === 0
+ }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/Rects.qml b/tests/manual/nodetypes_ng/Rects.qml
new file mode 100644
index 0000000000..b370fc7b27
--- /dev/null
+++ b/tests/manual/nodetypes_ng/Rects.qml
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+
+ Rectangle {
+ color: "gray"
+ width: 50
+ height: 50
+ anchors.centerIn: parent
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 1.0
+ to: 0.0
+ duration: 4000
+ }
+ NumberAnimation {
+ from: 0.0
+ to: 1.0
+ duration: 4000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ color: "green"
+ width: 100
+ height: 200
+ x: 0
+ y: 0
+
+ NumberAnimation on x {
+ from: 0
+ to: 300
+ duration: 5000
+ }
+ NumberAnimation on y {
+ from: 0
+ to: 50
+ duration: 2000
+ }
+
+ clip: true // scissor
+ Rectangle {
+ color: "lightGreen"
+ width: 50
+ height: 50
+ x: 75
+ y: 175
+ }
+ }
+
+ Rectangle {
+ color: "blue"
+ width: 200
+ height: 100
+ x: 100
+ y: 300
+ radius: 16
+ border.color: "red"
+ border.width: 4
+
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 300
+ to: 500
+ duration: 7000
+ }
+ NumberAnimation {
+ from: 500
+ to: 300
+ duration: 3000
+ }
+ }
+ }
+
+ Rectangle {
+ anchors.right: parent.right
+ width: 100
+ height: 100
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "red" }
+ GradientStop { position: 0.33; color: "yellow" }
+ GradientStop { position: 1.0; color: "green" }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/ShaderEffect.qml b/tests/manual/nodetypes_ng/ShaderEffect.qml
new file mode 100644
index 0000000000..cb2caf61a9
--- /dev/null
+++ b/tests/manual/nodetypes_ng/ShaderEffect.qml
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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$
+**
+****************************************************************************/
+
+// Use QtQuick 2.8 to get GraphicsInfo and others
+import QtQuick 2.8
+
+Item {
+ Rectangle {
+ color: "gray"
+ anchors.margins: 10
+ anchors.fill: parent
+ Image {
+ id: image1
+ source: "qrc:/qt.png"
+ }
+ ShaderEffectSource {
+ id: effectSource1
+ sourceItem: image1
+ hideSource: true
+ }
+ ShaderEffect { // wobble
+ id: eff
+ width: image1.width
+ height: image1.height
+ anchors.centerIn: parent
+
+ property variant source: effectSource1
+ property real amplitude: 0.04 * 0.2
+ property real frequency: 20
+ property real time: 0
+
+ NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
+
+ vertexShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.vert" : "qrc:/wobble.vert.qsb"
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.frag" : "qrc:/wobble.frag.qsb"
+ }
+
+ Image {
+ id: image2
+ source: "qrc:/face-smile.png"
+ }
+ ShaderEffectSource {
+ id: effectSource2
+ sourceItem: image2
+ hideSource: true
+ }
+ ShaderEffect { // dropshadow
+ id: eff2
+ width: image2.width
+ height: image2.height
+ scale: 2
+ x: 40
+ y: 40
+
+ property variant source: effectSource2
+
+ property variant shadow: ShaderEffectSource {
+ sourceItem: ShaderEffect {
+ width: eff2.width
+ height: eff2.height
+ property variant delta: Qt.size(0.0, 1.0 / height)
+ property variant source: ShaderEffectSource {
+ sourceItem: ShaderEffect {
+ id: innerEff
+ width: eff2.width
+ height: eff2.height
+ property variant delta: Qt.size(1.0 / width, 0.0)
+ property variant source: effectSource2
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/shadow_pass1_legacy_gl.frag" : "qrc:/shadow_pass1.frag.qsb"
+ }
+ }
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/shadow_pass1_legacy_gl.frag" : "qrc:/shadow_pass1.frag.qsb"
+ }
+ }
+ property real angle: 0
+ property variant offset: Qt.point(5.0 * Math.cos(angle), 5.0 * Math.sin(angle))
+ NumberAnimation on angle { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 6000 }
+ property variant delta: Qt.size(offset.x / width, offset.y / height)
+ property real darkness: 0.5
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/shadow_pass2_legacy_gl.frag" : "qrc:/shadow_pass2.frag.qsb"
+ }
+
+ Column {
+ anchors.bottom: parent.bottom
+ Text {
+ color: "yellow"
+ font.pointSize: 24
+ text: {
+ if (GraphicsInfo.api === GraphicsInfo.OpenGL)
+ "OpenGL";
+ else if (GraphicsInfo.api === GraphicsInfo.Software)
+ "Software";
+ else if (GraphicsInfo.api === GraphicsInfo.Direct3D12)
+ "D3D12";
+ else if (GraphicsInfo.api === GraphicsInfo.OpenVG)
+ "OpenVG";
+ else if (GraphicsInfo.api === GraphicsInfo.OpenGLRhi)
+ "OpenGL via QRhi";
+ else if (GraphicsInfo.api === GraphicsInfo.Direct3D11Rhi)
+ "D3D11 via QRhi";
+ else if (GraphicsInfo.api === GraphicsInfo.VulkanRhi)
+ "Vulkan via QRhi";
+ else if (GraphicsInfo.api === GraphicsInfo.MetalRhi)
+ "Metal via QRhi";
+ else if (GraphicsInfo.api === GraphicsInfo.Null)
+ "Null via QRhi";
+ else
+ "Unknown API";
+ }
+ }
+ Text {
+ color: "yellow"
+ font.pointSize: 24
+ text: "Shader effect is " + (GraphicsInfo.shaderType === GraphicsInfo.HLSL
+ ? "HLSL" : (GraphicsInfo.shaderType === GraphicsInfo.GLSL
+ ? "GLSL" : (GraphicsInfo.shaderType === GraphicsInfo.RhiShader
+ ? "QRhiShader" : "UNKNOWN"))) + " based";
+ }
+ Text {
+ text: GraphicsInfo.shaderType + " " + GraphicsInfo.shaderCompilationType + " " + GraphicsInfo.shaderSourceType
+ }
+ Text {
+ //text: eff.status + " " + eff.log
+ }
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/ShaderEffectNoAnim.qml b/tests/manual/nodetypes_ng/ShaderEffectNoAnim.qml
new file mode 100644
index 0000000000..638775bd2a
--- /dev/null
+++ b/tests/manual/nodetypes_ng/ShaderEffectNoAnim.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.8
+
+Item {
+ // make sure we render the scene continuously
+ Rectangle { color: "red"; width: 10; height: 10; NumberAnimation on rotation { from: 0; to: 360; loops: -1 } }
+
+ Rectangle {
+ color: "gray"
+ anchors.margins: 10
+ anchors.fill: parent
+ Image {
+ id: image1
+ source: "qrc:/qt.png"
+ }
+ ShaderEffectSource {
+ id: effectSource1
+ sourceItem: image1
+ hideSource: true
+ }
+ ShaderEffect { // wobble, no animation -> should not cause re-rendering into the texture
+ id: eff
+ width: image1.width
+ height: image1.height
+ anchors.centerIn: parent
+
+ property variant source: effectSource1
+ property real amplitude: 0.04 * 0.2
+ property real frequency: 20
+ property real time: 0
+
+ vertexShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.vert" : "qrc:/wobble.vert.qsb"
+ fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "qrc:/wobble_legacy_gl.frag" : "qrc:/wobble.frag.qsb"
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/ShaderEffectSource.qml b/tests/manual/nodetypes_ng/ShaderEffectSource.qml
new file mode 100644
index 0000000000..dee9477336
--- /dev/null
+++ b/tests/manual/nodetypes_ng/ShaderEffectSource.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Rectangle {
+ width: 200
+ height: 100
+ gradient: Gradient {
+ GradientStop { position: 0; color: "white" }
+ GradientStop { position: 1; color: "black" }
+ }
+ Row {
+ opacity: 0.5
+ Item {
+ id: foo
+ width: 100; height: 100
+ Rectangle { x: 5; y: 5; width: 60; height: 60; color: "red" }
+ Rectangle { x: 20; y: 20; width: 60; height: 60; color: "orange" }
+ Rectangle { x: 35; y: 35; width: 60; height: 60; color: "yellow" }
+ }
+ ShaderEffectSource {
+ width: 100; height: 100
+ sourceItem: foo
+ }
+ ShaderEffectSource {
+ width: 100; height: 100
+ sourceItem: foo
+ recursive: true
+ live: true
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/SimpleRect.qml b/tests/manual/nodetypes_ng/SimpleRect.qml
new file mode 100644
index 0000000000..d4aa3434ba
--- /dev/null
+++ b/tests/manual/nodetypes_ng/SimpleRect.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "red"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+
+ Rectangle {
+ color: "gray"
+ width: 50
+ height: 50
+ anchors.centerIn: parent
+ }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/Text.qml b/tests/manual/nodetypes_ng/Text.qml
new file mode 100644
index 0000000000..1741f7e5ab
--- /dev/null
+++ b/tests/manual/nodetypes_ng/Text.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ Text {
+ id: text1
+ renderType: Text.NativeRendering
+ anchors.top: parent.top
+ text: "árvíztűrő tükörfúrógép\nÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP"
+ }
+ Text {
+ renderType: Text.NativeRendering
+ anchors.bottom: parent.bottom
+ text: "the quick brown fox jumps over the lazy dog\nTHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
+ color: "red"
+ }
+ Text {
+ renderType: Text.NativeRendering
+ anchors.centerIn: parent
+ text: "rotate rotate rotate"
+ font.bold: true
+ font.pointSize: 20
+ color: "green"
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
+ }
+
+ Row {
+ anchors.top: text1.bottom
+ anchors.margins: 10
+ Text { renderType: Text.NativeRendering; font.pointSize: 24; text: "Normal" }
+ Text { renderType: Text.NativeRendering; font.pointSize: 24; text: "Raised"; style: Text.Raised; styleColor: "#AAAAAA" }
+ Text { renderType: Text.NativeRendering; font.pointSize: 24; text: "Outline"; style: Text.Outline; styleColor: "red" }
+ Text { renderType: Text.NativeRendering; font.pointSize: 24; text: "Sunken"; style: Text.Sunken; styleColor: "#AAAAAA" }
+ }
+}
diff --git a/tests/manual/nodetypes_ng/arrow-down.png b/tests/manual/nodetypes_ng/arrow-down.png
new file mode 100644
index 0000000000..29d1d4439a
--- /dev/null
+++ b/tests/manual/nodetypes_ng/arrow-down.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/arrow-up.png b/tests/manual/nodetypes_ng/arrow-up.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/tests/manual/nodetypes_ng/arrow-up.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/blacknwhite.png b/tests/manual/nodetypes_ng/blacknwhite.png
new file mode 100644
index 0000000000..efbc61e79d
--- /dev/null
+++ b/tests/manual/nodetypes_ng/blacknwhite.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/buildshaders.bat b/tests/manual/nodetypes_ng/buildshaders.bat
new file mode 100755
index 0000000000..328b216c07
--- /dev/null
+++ b/tests/manual/nodetypes_ng/buildshaders.bat
@@ -0,0 +1,4 @@
+qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o wobble.vert.qsb wobble.vert
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o wobble.frag.qsb wobble.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o shadow_pass1.frag.qsb shadow_pass1.frag
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o shadow_pass2.frag.qsb shadow_pass2.frag
diff --git a/tests/manual/nodetypes_ng/car_etc2_nomips.ktx b/tests/manual/nodetypes_ng/car_etc2_nomips.ktx
new file mode 100644
index 0000000000..2aefdd306b
--- /dev/null
+++ b/tests/manual/nodetypes_ng/car_etc2_nomips.ktx
Binary files differ
diff --git a/tests/manual/nodetypes_ng/face-smile.png b/tests/manual/nodetypes_ng/face-smile.png
new file mode 100644
index 0000000000..3d66d72578
--- /dev/null
+++ b/tests/manual/nodetypes_ng/face-smile.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/main.qml b/tests/manual/nodetypes_ng/main.qml
new file mode 100644
index 0000000000..938ae02c8f
--- /dev/null
+++ b/tests/manual/nodetypes_ng/main.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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.0
+
+Item {
+ focus: true
+
+ Loader {
+ anchors.fill: parent
+ id: loader
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_S)
+ loader.source = "";
+
+ if (event.key === Qt.Key_R)
+ loader.source = "qrc:/SimpleRect.qml";
+ if (event.key === Qt.Key_3)
+ loader.source = "qrc:/Rects.qml";
+ if (event.key === Qt.Key_4)
+ loader.source = "qrc:/LotsOfRects.qml";
+ if (event.key === Qt.Key_5)
+ loader.source = "qrc:/MultiClipRects.qml";
+ if (event.key === Qt.Key_I)
+ loader.source = "qrc:/Images.qml";
+ if (event.key === Qt.Key_A)
+ loader.source = "qrc:/AtlasedImages.qml";
+ if (event.key === Qt.Key_P)
+ loader.source = "qrc:/Painter.qml";
+ if (event.key === Qt.Key_C)
+ loader.source = "qrc:/CompressedImages.qml";
+ if (event.key === Qt.Key_T)
+ loader.source = "qrc:/Text.qml";
+ if (event.key === Qt.Key_D)
+ loader.source = "qrc:/DistanceFieldText.qml";
+ if (event.key === Qt.Key_L)
+ loader.source = "qrc:/Layers.qml";
+ if (event.key === Qt.Key_6)
+ loader.source = "qrc:/ShaderEffectSource.qml";
+ if (event.key === Qt.Key_E)
+ loader.source = "qrc:/ShaderEffect.qml";
+ if (event.key === Qt.Key_Z)
+ loader.source = "qrc:/ShaderEffectNoAnim.qml";
+ if (event.key === Qt.Key_G)
+ helper.testGrabWindow()
+ if (event.key === Qt.Key_F)
+ helper.testGrabItem(loader.item)
+ if (event.key === Qt.Key_W)
+ loader.source = "qrc:/MoreWindows.qml";
+ if (event.key === Qt.Key_N)
+ loader.source = "qrc:/LotsOfNodes.qml";
+ }
+}
diff --git a/tests/manual/nodetypes_ng/minus-sign.png b/tests/manual/nodetypes_ng/minus-sign.png
new file mode 100644
index 0000000000..d6f233d739
--- /dev/null
+++ b/tests/manual/nodetypes_ng/minus-sign.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/nodetypes_ng.cpp b/tests/manual/nodetypes_ng/nodetypes_ng.cpp
new file mode 100644
index 0000000000..829002b538
--- /dev/null
+++ b/tests/manual/nodetypes_ng/nodetypes_ng.cpp
@@ -0,0 +1,318 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications 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$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QThread>
+#include <QQuickView>
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QQuickPaintedItem>
+#include <QPainter>
+#include <QTimer>
+#include <QQuickItemGrabResult>
+#include <QSGRectangleNode>
+
+class Helper : public QObject
+{
+ Q_OBJECT
+
+public:
+ Helper(QQuickWindow *w) : m_window(w) { }
+
+ Q_INVOKABLE void sleep(int ms) {
+ QThread::msleep(ms);
+ }
+
+ Q_INVOKABLE void testGrabWindow() {
+ QImage img = m_window->grabWindow();
+ qDebug() << "Saving image to grab_window_result.png" << img;
+ img.save("grab_window_result.png");
+ }
+
+ Q_INVOKABLE void testGrabItem(QQuickItem *item) {
+ qDebug() << item;
+ if (!item)
+ return;
+
+ QSharedPointer<QQuickItemGrabResult> result = item->grabToImage();
+ if (!result)
+ return;
+
+ auto f = [](const QImage &image) {
+ qDebug() << "Saving image to grab_item_result.png" << image;
+ image.save("grab_item_result.png");
+ };
+ if (result->image().isNull()) {
+ connect(result.data(), &QQuickItemGrabResult::ready, [f, result] {
+ f(result->image());
+ });
+ } else {
+ f(result->image());
+ }
+ }
+
+ QQuickWindow *m_window;
+};
+
+class TextBalloon : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(bool rightAligned READ isRightAligned WRITE setRightAligned NOTIFY rightAlignedChanged)
+ Q_PROPERTY(bool innerAnim READ innerAnimEnabled WRITE setInnerAnimEnabled NOTIFY innerAnimChanged)
+
+public:
+ TextBalloon(QQuickItem *parent = nullptr) : QQuickPaintedItem(parent) {
+ connect(&m_timer, &QTimer::timeout, this, &TextBalloon::onAnim);
+ m_timer.setInterval(500);
+ }
+ void paint(QPainter *painter);
+
+ bool isRightAligned() { return m_rightAligned; }
+ void setRightAligned(bool rightAligned);
+
+ bool innerAnimEnabled() const { return m_innerAnim; }
+ void setInnerAnimEnabled(bool b);
+
+signals:
+ void rightAlignedChanged();
+ void innerAnimChanged();
+
+private slots:
+ void onAnim();
+
+private:
+ bool m_rightAligned = false;
+ bool m_innerAnim = false;
+ QTimer m_timer;
+ QRect m_animRect = QRect(10, 10, 50, 20);
+ int m_anim = 0;
+};
+
+void TextBalloon::paint(QPainter *painter)
+{
+ QBrush brush(QColor("#007430"));
+
+ painter->setBrush(brush);
+ painter->setPen(Qt::NoPen);
+ painter->setRenderHint(QPainter::Antialiasing);
+
+ painter->drawRoundedRect(0, 0, boundingRect().width(), boundingRect().height() - 10, 10, 10);
+
+ if (m_rightAligned) {
+ const QPointF points[3] = {
+ QPointF(boundingRect().width() - 10.0, boundingRect().height() - 10.0),
+ QPointF(boundingRect().width() - 20.0, boundingRect().height()),
+ QPointF(boundingRect().width() - 30.0, boundingRect().height() - 10.0),
+ };
+ painter->drawConvexPolygon(points, 3);
+ } else {
+ const QPointF points[3] = {
+ QPointF(10.0, boundingRect().height() - 10.0),
+ QPointF(20.0, boundingRect().height()),
+ QPointF(30.0, boundingRect().height() - 10.0),
+ };
+ painter->drawConvexPolygon(points, 3);
+ }
+
+ if (m_innerAnim) {
+ painter->fillRect(m_animRect, Qt::lightGray);
+ const int x = m_animRect.x() + m_anim;
+ const int y = m_animRect.y() + m_animRect.height() / 2;
+ painter->setPen(QPen(QBrush(Qt::SolidLine), 4));
+ painter->drawLine(x + 4, y, x + 10, y);
+ m_anim += 10;
+ if (m_anim > m_animRect.width())
+ m_anim = 0;
+ }
+}
+
+void TextBalloon::setRightAligned(bool rightAligned)
+{
+ if (m_rightAligned == rightAligned)
+ return;
+
+ m_rightAligned = rightAligned;
+ emit rightAlignedChanged();
+}
+
+void TextBalloon::setInnerAnimEnabled(bool b)
+{
+ if (m_innerAnim == b)
+ return;
+
+ m_innerAnim = b;
+ if (!b)
+ m_timer.stop();
+ else
+ m_timer.start();
+ emit innerAnimChanged();
+}
+
+void TextBalloon::onAnim()
+{
+ update(m_animRect);
+}
+
+class PerPixelRect : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+
+public:
+ PerPixelRect();
+ void setColor(const QColor &c);
+ QColor color() const { return m_color; }
+ QSGNode *updatePaintNode(QSGNode *old, UpdatePaintNodeData *);
+
+signals:
+ void colorChanged(const QColor &c);
+
+private:
+ QColor m_color;
+};
+
+PerPixelRect::PerPixelRect()
+{
+ setFlag(ItemHasContents);
+}
+
+void PerPixelRect::setColor(const QColor &c)
+{
+ if (c == m_color)
+ return;
+ m_color = c;
+ emit colorChanged(c);
+}
+
+QSGNode *PerPixelRect::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
+{
+ delete node;
+ node = new QSGNode;
+
+ const int w = width();
+ const int h = height();
+ QQuickWindow *win = window();
+ for (int y = 0; y < h; ++y) {
+ for (int x = 0; x < w; ++x) {
+ QSGRectangleNode *rn = win->createRectangleNode();
+ rn->setRect(x, y, 1, 1);
+ rn->setColor(m_color);
+ node->appendChildNode(rn);
+ }
+ }
+
+ return node;
+}
+
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
+
+ qDebug("Available tests:");
+ qDebug(" [R] - Simple rectangle (vertexcolor material)");
+ qDebug(" [3] - Rectangles (incl. smoothcolor material, scissor)");
+ qDebug(" [4] - A lot of rectangles (incl. stencil and scissor)");
+ qDebug(" [5] - Rectangles with multiple clip list entries");
+ qDebug(" [I] - Images");
+ qDebug(" [A] - Atlased images");
+ qDebug(" [P] - QQuickPaintedItem");
+ qDebug(" [C] - Compressed textures");
+ qDebug(" [T] - Text (native)");
+ qDebug(" [D] - Text (distance field)");
+ qDebug(" [L] - Layers");
+ qDebug(" [6] - ShaderEffectSource without ShaderEffect");
+ qDebug(" [E] - ShaderEffect (and GraphicsInfo)");
+ qDebug(" [Z] - ShaderEffect without animated properties");
+ qDebug(" [G] - Grab current window");
+ qDebug(" [F] - Grab item");
+ qDebug(" [W] - Multiple windows");
+ qDebug(" [N] - Lots of rectangle nodes");
+ qDebug("\nPress S to stop the currently running test\n");
+
+ QQuickView view;
+ Helper helper(&view);
+
+ const bool usingRhi = qEnvironmentVariableIntValue("QSG_RHI") != 0;
+ const QString rhiBackend = QString::fromLatin1(qgetenv("QSG_RHI_BACKEND"));
+ if (usingRhi)
+ view.setTitle(QLatin1String("RHI: ") + (rhiBackend.isEmpty() ? QLatin1String("default") : rhiBackend));
+ else
+ view.setTitle(QLatin1String("legacy OpenGL"));
+
+ if (app.arguments().contains(QLatin1String("--multisample"))) {
+ qDebug("Requesting sample count 4");
+ QSurfaceFormat fmt = view.format();
+ fmt.setSamples(4);
+ fmt.setDepthBufferSize(24);
+ fmt.setStencilBufferSize(8);
+ view.setFormat(fmt);
+ }
+ if (app.arguments().contains(QLatin1String("--coreprofile"))) {
+ qDebug("Requesting core profile (applicable only with OpenGL)");
+ QSurfaceFormat fmt = view.format();
+ fmt.setVersion(3, 2);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ view.setFormat(fmt);
+ }
+
+ view.engine()->rootContext()->setContextProperty(QLatin1String("helper"), &helper);
+
+ qmlRegisterType<TextBalloon>("Stuff", 1, 0, "TextBalloon");
+ qmlRegisterType<PerPixelRect>("Stuff", 1, 0, "PerPixelRect");
+
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.resize(1024, 768);
+ view.setSource(QUrl("qrc:/main.qml"));
+ view.show();
+
+ return app.exec();
+}
+
+#include "nodetypes_ng.moc"
diff --git a/tests/manual/nodetypes_ng/nodetypes_ng.pro b/tests/manual/nodetypes_ng/nodetypes_ng.pro
new file mode 100644
index 0000000000..68b9211c4f
--- /dev/null
+++ b/tests/manual/nodetypes_ng/nodetypes_ng.pro
@@ -0,0 +1,11 @@
+QT += qml quick
+
+SOURCES += nodetypes_ng.cpp
+
+RESOURCES += nodetypes_ng.qrc
+
+OTHER_FILES += \
+ main.qml \
+ SimpleRect.qml \
+ Rects.qml \
+ LotsOfRects.qml
diff --git a/tests/manual/nodetypes_ng/nodetypes_ng.qrc b/tests/manual/nodetypes_ng/nodetypes_ng.qrc
new file mode 100644
index 0000000000..47ad8d2677
--- /dev/null
+++ b/tests/manual/nodetypes_ng/nodetypes_ng.qrc
@@ -0,0 +1,38 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>SimpleRect.qml</file>
+ <file>Rects.qml</file>
+ <file>LotsOfRects.qml</file>
+ <file>MultiClipRects.qml</file>
+ <file>Images.qml</file>
+ <file>Painter.qml</file>
+ <file>CompressedImages.qml</file>
+ <file>Text.qml</file>
+ <file>DistanceFieldText.qml</file>
+ <file>Layers.qml</file>
+ <file>ShaderEffectSource.qml</file>
+ <file>AtlasedImages.qml</file>
+ <file>ShaderEffect.qml</file>
+ <file>ShaderEffectNoAnim.qml</file>
+ <file>MoreWindows.qml</file>
+ <file>LotsOfNodes.qml</file>
+ <file>qt.png</file>
+ <file>face-smile.png</file>
+ <file>car_etc2_nomips.ktx</file>
+ <file>qt_bc1_10mips.ktx</file>
+ <file>arrow-down.png</file>
+ <file>arrow-up.png</file>
+ <file>minus-sign.png</file>
+ <file>plus-sign.png</file>
+ <file>blacknwhite.png</file>
+ <file>wobble.vert.qsb</file>
+ <file>wobble.frag.qsb</file>
+ <file>shadow_pass1.frag.qsb</file>
+ <file>shadow_pass2.frag.qsb</file>
+ <file>wobble_legacy_gl.vert</file>
+ <file>wobble_legacy_gl.frag</file>
+ <file>shadow_pass1_legacy_gl.frag</file>
+ <file>shadow_pass2_legacy_gl.frag</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/nodetypes_ng/plus-sign.png b/tests/manual/nodetypes_ng/plus-sign.png
new file mode 100644
index 0000000000..40df1134f8
--- /dev/null
+++ b/tests/manual/nodetypes_ng/plus-sign.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/qt.png b/tests/manual/nodetypes_ng/qt.png
new file mode 100644
index 0000000000..f30eec0d4d
--- /dev/null
+++ b/tests/manual/nodetypes_ng/qt.png
Binary files differ
diff --git a/tests/manual/nodetypes_ng/qt_bc1_10mips.ktx b/tests/manual/nodetypes_ng/qt_bc1_10mips.ktx
new file mode 100644
index 0000000000..32c31bf6dc
--- /dev/null
+++ b/tests/manual/nodetypes_ng/qt_bc1_10mips.ktx
Binary files differ
diff --git a/tests/manual/nodetypes_ng/shadow_pass1.frag b/tests/manual/nodetypes_ng/shadow_pass1.frag
new file mode 100644
index 0000000000..14581eb80e
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass1.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 {
+ // The built-in vertex shader assumes the first 68 bytes are matrix and
+ // opacity so have them there even though the matrix is not used here.
+ mat4 qt_Matrix;
+ float qt_Opacity;
+ vec2 delta;
+} ubuf;
+
+void main()
+{
+ fragColor = (0.0538 * texture(source, qt_TexCoord0 - 3.182 * ubuf.delta)
+ + 0.3229 * texture(source, qt_TexCoord0 - 1.364 * ubuf.delta)
+ + 0.2466 * texture(source, qt_TexCoord0)
+ + 0.3229 * texture(source, qt_TexCoord0 + 1.364 * ubuf.delta)
+ + 0.0538 * texture(source, qt_TexCoord0 + 3.182 * ubuf.delta)) * ubuf.qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
new file mode 100644
index 0000000000..f3370caee2
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass1.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/shadow_pass1_legacy_gl.frag b/tests/manual/nodetypes_ng/shadow_pass1_legacy_gl.frag
new file mode 100644
index 0000000000..65ce0d956c
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass1_legacy_gl.frag
@@ -0,0 +1,11 @@
+uniform lowp float qt_Opacity;
+uniform sampler2D source;
+uniform highp vec2 delta;
+varying highp vec2 qt_TexCoord0;
+void main() {
+ gl_FragColor = (0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta)
+ + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta)
+ + 0.2466 * texture2D(source, qt_TexCoord0)
+ + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta)
+ + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta)) * qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/shadow_pass2.frag b/tests/manual/nodetypes_ng/shadow_pass2.frag
new file mode 100644
index 0000000000..fa11f873bb
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass2.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(binding = 2) uniform sampler2D shadow;
+
+layout(std140, binding = 0) uniform buf {
+ // The built-in vertex shader assumes the first 68 bytes are matrix and
+ // opacity so have them there even though the matrix is not used here.
+ mat4 qt_Matrix;
+ float qt_Opacity;
+ vec2 delta;
+ float darkness;
+} ubuf;
+
+void main()
+{
+ vec4 fg = texture(source, qt_TexCoord0);
+ vec4 bg = texture(shadow, qt_TexCoord0 + ubuf.delta);
+ fragColor = (fg + vec4(0., 0., 0., ubuf.darkness * bg.a) * (1. - fg.a)) * ubuf.qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
new file mode 100644
index 0000000000..cbf9569373
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass2.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/shadow_pass2_legacy_gl.frag b/tests/manual/nodetypes_ng/shadow_pass2_legacy_gl.frag
new file mode 100644
index 0000000000..2ea4cc8d89
--- /dev/null
+++ b/tests/manual/nodetypes_ng/shadow_pass2_legacy_gl.frag
@@ -0,0 +1,12 @@
+uniform lowp float qt_Opacity;
+uniform highp vec2 offset;
+uniform sampler2D source;
+uniform sampler2D shadow;
+uniform highp float darkness;
+uniform highp vec2 delta;
+varying highp vec2 qt_TexCoord0;
+void main() {
+ lowp vec4 fg = texture2D(source, qt_TexCoord0);
+ lowp vec4 bg = texture2D(shadow, qt_TexCoord0 + delta);
+ gl_FragColor = (fg + vec4(0., 0., 0., darkness * bg.a) * (1. - fg.a)) * qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/wobble.frag b/tests/manual/nodetypes_ng/wobble.frag
new file mode 100644
index 0000000000..a34481c2f2
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble.frag
@@ -0,0 +1,20 @@
+#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;
+ float amplitude;
+ float frequency;
+ float time;
+} ubuf;
+
+void main()
+{
+ vec2 p = sin(ubuf.time + ubuf.frequency * qt_TexCoord0);
+ fragColor = texture(source, qt_TexCoord0 + ubuf.amplitude * vec2(p.y, -p.x)) * ubuf.qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/wobble.frag.qsb b/tests/manual/nodetypes_ng/wobble.frag.qsb
new file mode 100644
index 0000000000..9d3b80fad8
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble.frag.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble.vert b/tests/manual/nodetypes_ng/wobble.vert
new file mode 100644
index 0000000000..a49b2d9a9f
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble.vert
@@ -0,0 +1,22 @@
+#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;
+ float qt_Opacity;
+ float amplitude;
+ float frequency;
+ float time;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = ubuf.qt_Matrix * qt_Vertex;
+}
diff --git a/tests/manual/nodetypes_ng/wobble.vert.qsb b/tests/manual/nodetypes_ng/wobble.vert.qsb
new file mode 100644
index 0000000000..0f44e87feb
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble.vert.qsb
Binary files differ
diff --git a/tests/manual/nodetypes_ng/wobble_legacy_gl.frag b/tests/manual/nodetypes_ng/wobble_legacy_gl.frag
new file mode 100644
index 0000000000..2961ca5f50
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble_legacy_gl.frag
@@ -0,0 +1,10 @@
+uniform sampler2D source;
+uniform highp float amplitude;
+uniform highp float frequency;
+uniform highp float time;
+uniform lowp float qt_Opacity;
+varying highp vec2 qt_TexCoord0;
+void main() {
+ highp vec2 p = sin(time + frequency * qt_TexCoord0);
+ gl_FragColor = texture2D(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x)) * qt_Opacity;
+}
diff --git a/tests/manual/nodetypes_ng/wobble_legacy_gl.vert b/tests/manual/nodetypes_ng/wobble_legacy_gl.vert
new file mode 100644
index 0000000000..b2f33ab402
--- /dev/null
+++ b/tests/manual/nodetypes_ng/wobble_legacy_gl.vert
@@ -0,0 +1,8 @@
+uniform highp mat4 qt_Matrix;
+attribute highp vec4 qt_Vertex;
+attribute highp vec2 qt_MultiTexCoord0;
+varying highp vec2 qt_TexCoord0;
+void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Matrix * qt_Vertex;
+}