diff options
Diffstat (limited to 'tests/auto/quick/qquickshadereffect/data')
9 files changed, 88 insertions, 179 deletions
diff --git a/tests/auto/quick/qquickshadereffect/data/+qsb/testprop.frag b/tests/auto/quick/qquickshadereffect/data/+qsb/testprop.frag Binary files differnew file mode 100644 index 0000000000..97d2430699 --- /dev/null +++ b/tests/auto/quick/qquickshadereffect/data/+qsb/testprop.frag diff --git a/tests/auto/quick/qquickshadereffect/data/MyIcon.qml b/tests/auto/quick/qquickshadereffect/data/MyIcon.qml index 0ed8f36580..f48b3698e1 100644 --- a/tests/auto/quick/qquickshadereffect/data/MyIcon.qml +++ b/tests/auto/quick/qquickshadereffect/data/MyIcon.qml @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Canonical Limited and/or its subsidiary(-ies). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Canonical Limited and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.4 diff --git a/tests/auto/quick/qquickshadereffect/data/compile.bat b/tests/auto/quick/qquickshadereffect/data/compile.bat index 6b276aea69..112acfb1c0 100644 --- a/tests/auto/quick/qquickshadereffect/data/compile.bat +++ b/tests/auto/quick/qquickshadereffect/data/compile.bat @@ -2,3 +2,5 @@ qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/test.vert test_rhi.ver qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/red.frag red_rhi.frag qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/test.frag test_rhi.frag + +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/testprop.frag testprop.frag diff --git a/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml b/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml index 95fdfee91a..eee1e212e7 100644 --- a/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml +++ b/tests/auto/quick/qquickshadereffect/data/deleteShaderEffectSource.qml @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Particles 2.0 diff --git a/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml b/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml index 9257e9a01a..88e44bab68 100644 --- a/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml +++ b/tests/auto/quick/qquickshadereffect/data/deleteSourceItem.qml @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Particles 2.0 diff --git a/tests/auto/quick/qquickshadereffect/data/hideParent.qml b/tests/auto/quick/qquickshadereffect/data/hideParent.qml index e862dfaa01..2566cc276e 100644 --- a/tests/auto/quick/qquickshadereffect/data/hideParent.qml +++ b/tests/auto/quick/qquickshadereffect/data/hideParent.qml @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.12 diff --git a/tests/auto/quick/qquickshadereffect/data/testProperties.qml b/tests/auto/quick/qquickshadereffect/data/testProperties.qml new file mode 100644 index 0000000000..e513cf0406 --- /dev/null +++ b/tests/auto/quick/qquickshadereffect/data/testProperties.qml @@ -0,0 +1,48 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick + +Item { + id: root + width: 640 + height: 480 + + property bool finished + + Rectangle { + id: rect + color: "red" + width: 300 + height: 300 + Text { + text: "Hello world" + anchors.centerIn: parent + color: "#00FF00" + } + layer.enabled: true + layer.effect: ShaderEffect { + objectName: "shaderEffect" + fragmentShader: "qrc:/data/testprop.frag" + + // This is intended to exercise the uniform data copy logic in + // QSGRhiShaderEffectMaterialShader::updateUniformData() to see if + // the undocumented combinations for passing in a vector with more + // components than the shader variable works, and no assertions or + // crashes occur. + + property variant aVec4: Qt.point(0.1, 0.0) // third and fourth are 0 + property variant aVec3: Qt.point(0.1, 0.5) // third will be 0 + property variant aVec2: Qt.vector4d(0.1, 0.5, 1.0, 1.0) // only first two are used + property real f: 0.0 + property variant aFloat: Qt.size(0.1 + f, 0.1) // only first is used + + NumberAnimation on f { + from: 0.0 + to: 1.0 + duration: 1000 + onFinished: root.finished = true + } + } + } +} diff --git a/tests/auto/quick/qquickshadereffect/data/testprop.frag b/tests/auto/quick/qquickshadereffect/data/testprop.frag new file mode 100644 index 0000000000..86f007bcb4 --- /dev/null +++ b/tests/auto/quick/qquickshadereffect/data/testprop.frag @@ -0,0 +1,28 @@ +#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; + vec4 aVec4; + vec3 aVec3; + vec2 aVec2; + float aFloat; +}; + +void main() +{ + vec4 c = texture(source, qt_TexCoord0); + vec4 v = aVec4; + v.rgb += aVec3; + v.rg += aVec2; + v.r += aFloat; + c *= v; + if (c.a == 0.0) + c.a = 1.0; + fragColor = c * qt_Opacity; +} diff --git a/tests/auto/quick/qquickshadereffect/data/twoImagesOneShaderEffect.qml b/tests/auto/quick/qquickshadereffect/data/twoImagesOneShaderEffect.qml index 46d81f2106..b32dc7fbb6 100644 --- a/tests/auto/quick/qquickshadereffect/data/twoImagesOneShaderEffect.qml +++ b/tests/auto/quick/qquickshadereffect/data/twoImagesOneShaderEffect.qml @@ -1,52 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Canonical Limited and/or its subsidiary(-ies). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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$ -** -****************************************************************************/ +// Copyright (C) 2016 Canonical Limited and/or its subsidiary(-ies). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.4 |