summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
commit12a5ddf456ba8549645a8cb28a8b4ed6197a14da (patch)
tree63ee2c88af936e0609a3a194f5bcc304c4c0b707 /tests/manual
Import relevant source from Qt 4.8
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/declarative/declarative.pro3
-rw-r--r--tests/manual/declarative/qmlshadersplugin/main.cpp67
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml83
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml57
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml82
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml267
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml133
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml119
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml91
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml97
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml93
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml84
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml96
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml102
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml101
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml104
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml108
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml74
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml85
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml109
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg11
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.pngbin0 -> 1153 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.pngbin0 -> 219220 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.pngbin0 -> 293803 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.pngbin0 -> 40220 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml236
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpgbin0 -> 337569 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp168
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h69
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri148
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro29
42 files changed, 3646 insertions, 0 deletions
diff --git a/tests/manual/declarative/declarative.pro b/tests/manual/declarative/declarative.pro
new file mode 100644
index 00000000..337db2f9
--- /dev/null
+++ b/tests/manual/declarative/declarative.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin
+
diff --git a/tests/manual/declarative/qmlshadersplugin/main.cpp b/tests/manual/declarative/qmlshadersplugin/main.cpp
new file mode 100644
index 00000000..d0f15ca7
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/main.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QtOpenGL>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+
+ QmlApplicationViewer viewer;
+ viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ viewer.setViewport(glWidget);
+ viewer.setAttribute(Qt::WA_OpaquePaintEvent);
+ viewer.setAttribute(Qt::WA_NoSystemBackground);
+ viewer.setOrientation(QmlApplicationViewer::Auto);
+ viewer.setMainQmlFile(QLatin1String("qml/qmlshadersplugintest/main.qml"));
+ viewer.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
new file mode 100644
index 00000000..ab8df750
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //effect.active = !effect.active
+ effect.visible = !effect.visible
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.visible ? "Effect active (display should be green)" : "Effect not active (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
new file mode 100644
index 00000000..fe9bc40f
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent;
+
+ ShaderEffectItem {
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
new file mode 100644
index 00000000..1aa0708a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.blending = !effect.blending
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.blending ? "Effect blending (display should be orange)" : "Effect not blending (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
new file mode 100644
index 00000000..5920e642
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
@@ -0,0 +1,267 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: blendModeTest
+ property real blendItemHeight: 60
+
+ anchors.fill: parent;
+
+ Rectangle {
+ width: parent.width / 6
+ height: parent.height
+ color: "black"
+ }
+ Rectangle {
+ x: parent.width/6 * 1
+ width: parent.width / 6
+ height: parent.height
+ color: "white"
+ }
+ Rectangle {
+ x: parent.width/6 * 2
+ width: parent.width / 6
+ height: parent.height
+ color: "gray"
+ }
+ Rectangle {
+ x: parent.width/6 * 3
+ width: parent.width / 6
+ height: parent.height
+ color: "red"
+ }
+ Rectangle {
+ x: parent.width/6 * 4
+ width: parent.width / 6
+ height: parent.height
+ color: "green"
+ }
+ Rectangle {
+ x: parent.width/6 * 5
+ width: parent.width / 6
+ height: parent.height
+ color: "blue"
+ }
+
+
+ Image {
+ anchors.fill: parent;
+ source: "image.png"
+
+ }
+
+ Rectangle {
+ id: first
+ anchors.top: parent.top
+ anchors.topMargin: 60
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#8000ff00"
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #8000ff00"
+ color: "white"
+ }
+ }
+ Rectangle {
+ id: second
+ anchors.top: first.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#ff00ff00"
+ opacity: 0.5
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #ff00ff00, opacity 0.5"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.top: second.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 1.0, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.top: effect.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 0.5, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 0.5, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+
+ Image {
+ id: image1
+ source: "green_image_transparent.png"
+ anchors.top: effect2.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ }
+ Text {
+ anchors.bottom: image1.bottom
+ anchors.bottomMargin: 5
+ text: " Image, green and 50% alpha"
+ color: "white"
+ }
+
+
+ ShaderEffectItem {
+ id: effect3
+ property variant source: ShaderEffectSource {
+ sourceItem: image1
+ hideSource: false
+ }
+ anchors.top: image1.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green 50% alpha."
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect4
+ property variant source: ShaderEffectSource {
+ sourceItem: Image { source: "green_image_transparent.png" }
+ hideSource: true
+ }
+ anchors.top: effect3.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source image green 50% alpha."
+ color: "white"
+ }
+ }
+
+
+ Rectangle {
+ id: greenRect2
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ opacity: 0.5
+ color: "green"
+ }
+
+
+ ShaderEffectItem {
+ id: effect5
+ property variant source: ShaderEffectSource { sourceItem: greenRect2; hideSource: true }
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green rect with 0.5 opacity."
+ color: "white"
+ }
+ }
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ }
+ }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Blending test"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
new file mode 100644
index 00000000..588a740e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id :root
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect1.visible = !effect1.visible
+ effect2.visible = !effect2.visible
+ //effect3.visible = !effect3.visible
+ }
+ }
+
+ Rectangle {
+ id: a
+ x: 90
+ y: 90
+ color: "red"
+ width: 220
+ height: 220
+ Rectangle {
+ id: b
+ x: 10
+ y: 10
+ color: "blue"
+ width: 100
+ height: 100
+ rotation: 5
+ Rectangle {
+ id: c
+ x: 10
+ y: 10
+ color: "black"
+ width: 80
+ height: 80
+ }
+ }
+ Rectangle {
+ id: d
+ x: 10
+ y: 110
+ color: "yellow"
+ width: 100
+ height: 100
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: a
+ property variant source: ShaderEffectSource{ sourceItem: a; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ x: 100
+ y: 100
+ width: 100
+ height: 100
+ rotation: 5
+ property variant source: ShaderEffectSource{ sourceItem: b; hideSource: true }
+ }
+
+// ShaderEffectItem {
+// id: effect3
+// x: 110
+// y: 210
+// width: 80
+// height: 80
+// property variant source: ShaderEffectSource{ sourceItem: c; hideSource: true }
+// }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect1.visible ? "Effects active" : "Effects NOT active"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
new file mode 100644
index 00000000..5030eb36
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+
+ }
+ }
+
+ Rectangle {
+ id: theSource
+ color: "red"
+ anchors.centerIn: parent;
+ width: parent.width/2
+ height: parent.height/2
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: theSource;
+ property variant source: ShaderEffectSource{ sourceItem: theSource; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.fill: effect1;
+ property variant source: effect1
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0.st).rgb, 1.0);
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ id: effect3
+ x: effect2.x
+ y: effect2.y
+ width: effect2.width
+ height: effect2.height
+
+ property variant source: ShaderEffectSource { sourceItem: effect2 ; hideSource: false }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Red rect inside green fullscreen rect."
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
new file mode 100644
index 00000000..3a7d33d6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "gray"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.format == ShaderEffectSource.Alpha)
+ theSource.format = ShaderEffectSource.RGB
+ else if (theSource.format == ShaderEffectSource.RGB)
+ theSource.format = ShaderEffectSource.RGBA
+ else if (theSource.format == ShaderEffectSource.RGBA)
+ theSource.format = ShaderEffectSource.Alpha
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Source format test: " + theSource.format
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
new file mode 100644
index 00000000..87cbac3b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.fragmentShader == effect.redFragmentShader ? effect.fragmentShader = effect.greenFragmentShader : effect.fragmentShader = effect.redFragmentShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string redFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+
+ property string greenFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ fragmentShader: redFragmentShader
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.fragmentShader == effect.redFragmentShader ? "Effect (display should be red)" : "Effect (display should be green)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
new file mode 100644
index 00000000..9c1a731c
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ console.log("Grabbed!")
+ theSource.grab();
+ }
+ }
+
+ Image {
+ id: theSourcImage
+ source: "image_opaque.png"
+ opacity: 0.5
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: theSourcImage
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with grab (opacity 0.5)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
new file mode 100644
index 00000000..5122fcb8
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //theSource.hideOriginal = !theSource.hideOriginal
+ theSource.hideSource = !theSource.hideSource
+ }
+ }
+
+ Rectangle {
+ id: redRect
+ anchors.fill: parent;
+ color: "red"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redRect
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main() {
+ // Empty fragmentshader, we do not write any pixels via this effect item. We only observe hideoriginal functionality.
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ //text: theSource.hideOriginal ? "Hideoriginal true (display should be green)" : "Hideoriginal false (display should be red)"
+ text: theSource.hideSource ? "HideSource true (display should be green)" : "HideSource false (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
new file mode 100644
index 00000000..003e9455
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatHorizontally
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? "HorizontalWrap RepeatHorizontally" : "HorizontalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
new file mode 100644
index 00000000..fbec2000
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.smooth = !theSource.smooth
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ width: parent.width * 2.0
+ height: parent.height * 2.0
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: !theSource.smooth ? "Filtering nearest (faster)" : "Filtering linear (better quality)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
new file mode 100644
index 00000000..96dbb119
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: imageMarginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+
+ onTriggered: {
+ if (imageMarginTester.testMarginX < 20) {
+ imageMarginTester.testMarginX = 50
+ imageMarginTester.testMarginY = 120
+ }
+ else {
+ imageMarginTester.testMarginX = 10
+ imageMarginTester.testMarginY = 10
+ }
+
+ console.log("onTriggered...")
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered done")
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + imageMarginTester.testMarginX + "x" + imageMarginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
new file mode 100644
index 00000000..c5cc0de6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
new file mode 100644
index 00000000..3066f9ca
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = false
+ } else if (!theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (!theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = true
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "wallpaper.jpg"
+ mipmap: false
+ smooth: false
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent;
+ width: parent.width * 0.8
+ height: parent.height * 0.8
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Mipmap: " + theSource.mipmap + ", Smooth: " + theSource.smooth
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
new file mode 100644
index 00000000..1a0c4753
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered")
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
new file mode 100644
index 00000000..0dafe547
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
new file mode 100644
index 00000000..d17d7743
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.live = !theSource.live
+ theSource.grab() // This tests grabbing screenshot from static source
+ }
+ }
+
+ Rectangle {
+ id: greenRect
+ anchors.fill: parent;
+ color: theSource.live ? "green" : "red" // This works if we use grab()
+ property int counter: 0
+ Text {
+ id: counterText
+ anchors.centerIn: parent
+ text: greenRect.counter
+ font.pixelSize: 48
+ }
+ Timer {
+ running: true
+ interval: 100
+ repeat: true
+ onTriggered: {
+ greenRect.counter++
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: greenRect
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.live ? "live true (color green, number changes)" : "live false (color red, same number)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
new file mode 100644
index 00000000..e4375a55
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.meshResolution.width == 1 ? effect.meshResolution = Qt.size(40,40) : effect.meshResolution = Qt.size(1,1)
+ }
+ }
+
+ Rectangle {
+ id: thesource
+ anchors.centerIn: parent;
+ color: "green"
+ width: parent.width
+ height: parent.height
+ Image {
+ anchors.centerIn: parent;
+ source: "image_opaque.png"
+ }
+ }
+
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: thesource;
+ property variant source: ShaderEffectSource { sourceItem: thesource }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+
+ highp vec4 shift = vec4(cos(1071. * qt_MultiTexCoord0.x + 1.0) + sin(2051. * qt_MultiTexCoord0.y + 1.0),
+ cos(1131. * qt_MultiTexCoord0.x + 1.0) + sin(3039. * qt_MultiTexCoord0.x + 1.0), 0, 0) * 3.0;
+
+ if (qt_MultiTexCoord0.x < 0.01 || qt_MultiTexCoord0.x > 0.99)
+ shift.x = 0.;
+ if (qt_MultiTexCoord0.y < 0.01 || qt_MultiTexCoord0.y > 0.99)
+ shift.y = 0.;
+
+ gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex + shift);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.meshResolution.width == 1 ? "Resolution (1,1) (image looks normal)" : "Resolution (40,40) (image looks distorted)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
new file mode 100644
index 00000000..58776ebf
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
new file mode 100644
index 00000000..df019066
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effect.opacity > 0.9)
+ effect.opacity = 0.0
+ else if (effect.opacity < 0.5)
+ effect.opacity = 0.5
+ else if (effect.opacity < 0.9)
+ effect.opacity = 1.0
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform highp float qt_Opacity;
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0).rgb, qt_Opacity);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with opacity: " + effect.opacity
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
new file mode 100644
index 00000000..4b7cf757
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.rotation < 45)
+ effectWrapper.rotation = 45
+ else if (effectWrapper.rotation < 90)
+ effectWrapper.rotation = 90
+ else if (effectWrapper.rotation < 180)
+ effectWrapper.rotation = 0
+
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is rotated " + effectWrapper.rotation + " degrees"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
new file mode 100644
index 00000000..76dde8df
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.scale < 0.3)
+ effectWrapper.scale = 0.3
+ else if (effectWrapper.scale < 1.7)
+ effectWrapper.scale = 1.7
+ else if (effectWrapper.scale < 2.0)
+ effectWrapper.scale = 0.1
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+ scale: 0.1
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is scaled " + effectWrapper.scale
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
new file mode 100644
index 00000000..9ae62fe5
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.textureSize.width == 64 ? theSource.textureSize = Qt.size(360,640) : theSource.textureSize = Qt.size(64,64)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ textureSize: Qt.size(64,64)
+ smooth: true
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "textureSize:" + theSource.textureSize.width + "x" + theSource.textureSize.height
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
new file mode 100644
index 00000000..c3940f65
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ height: parent.height / 2
+ blending: false
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ y: parent.height / 2
+ height: parent.height / 2
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
new file mode 100644
index 00000000..79c67ccb
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Rectangle {
+ id: rect;
+ anchors.centerIn: parent
+ width: 1
+ height: 10
+
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#ff0000" }
+ GradientStop { position: 0.5; color: "#00ff00" }
+ GradientStop { position: 1; color: "#0000ff" }
+ }
+ }
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: maskSource
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectSource {
+ id: colorSource
+ sourceItem: rect;
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant colorSource: colorSource
+ property variant maskSource: maskSource;
+
+ fragmentShader: "
+ uniform lowp sampler2D maskSource;
+ uniform lowp sampler2D colorSource;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
new file mode 100644
index 00000000..e808038a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.vertexShader == effect.defaultVertexShader ? effect.vertexShader = effect.dummyVertexShader : effect.vertexShader = effect.defaultVertexShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string defaultVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ property string dummyVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Vertex * vec4(0.0, 0.0, 0.0, 0.0001);
+ }
+ "
+
+ vertexShader: defaultVertexShader
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.vertexShader == effect.defaultVertexShader ? "Effect (display shoud be green)" : "Effect (display shoud be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
new file mode 100644
index 00000000..5fdfd01c
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatVertically ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatVertically
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatVertically ? "Wrap RepeatVertically" : "VerticalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
new file mode 100644
index 00000000..45b0441e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.Repeat ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.Repeat
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.Repeat ? "Wrap Repeat" : "Wrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
new file mode 100644
index 00000000..3005133b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<rect fill="none" width="30" height="30"/>
+<path fill="#FFFFFF" d="M19,8h-9V5c0-0.389-0.225-0.74-0.576-0.906C9.289,4.031,9.145,4,9,4C8.771,4,8.543,4.079,8.359,4.231
+ l-6,5.001C2.132,9.422,2,9.703,2,10s0.132,0.578,0.359,0.768l6,5C8.543,15.921,8.771,16,9,16c0.145,0,0.289-0.031,0.424-0.094
+ C9.775,15.741,10,15.389,10,15v-3h9c2.757,0,5,2.243,5,5s-2.243,5-5,5h-6.917c-1.104,0-2,0.896-2,2s0.896,2,2,2H19
+ c4.963,0,9-4.037,9-9S23.963,8,19,8z"/>
+</svg>
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
new file mode 100644
index 00000000..f3024f7e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
new file mode 100644
index 00000000..144c02d5
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
new file mode 100644
index 00000000..c73d3892
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
new file mode 100644
index 00000000..b2267737
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
new file mode 100644
index 00000000..4a5f6bdc
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
@@ -0,0 +1,236 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ Rectangle {
+ id: background
+ visible: testCaseList.visible
+ anchors.fill: parent
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#EEEEEE" }
+ GradientStop { position: 1.0; color: "#AAAAAA" }
+ }
+ }
+
+ Loader {
+ id: testLoader
+ width: parent.width
+ height: parent.height
+ visible: !testCaseList.visible
+ }
+
+ ListModel {
+ id: testcaseModel
+ ListElement { name: "TestEffectHierarchy.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestGrab.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestLive.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestImageFiltering.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestWrapRepeat.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHorizontalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestVerticalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMargins.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestEffectInsideAnotherEffect.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMarginsWithTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHideOriginal.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestActive.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlending.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlendingModes.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestOpacity.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestFragmentShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestVertexShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestMeshResolution.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestRotation.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestScale.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestBasic.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestOneSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwiceOnSameSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwoSources.qml"; group: "Scenegraph effect tests" }
+ }
+
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: testCaseList.width
+ height: 35
+ color: "#00000000"
+
+ Text {
+ text: section
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignLeft
+ anchors.fill: parent
+ anchors.leftMargin: 5
+ font.bold: true
+ style: Text.Raised
+ styleColor: "white"
+ }
+ }
+ }
+
+ ListView {
+ id: testCaseList
+
+ property int hideTranslation: 0
+ transform: Translate {
+ x: testCaseList.hideTranslation
+ }
+
+ anchors.fill: parent
+ anchors.topMargin: 10
+ anchors.leftMargin: 5
+ anchors.rightMargin: 5
+ anchors.bottomMargin: 10
+
+ model: testcaseModel
+ spacing: 3
+
+ state: "testStopped"
+
+ section.property: "group"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+
+ delegate: Rectangle {
+ width: parent.width
+ height: 50
+ radius: 5
+ border.width: 1
+ border.color: "#888888"
+ color: delegateMouseArea.pressed ? "#AAAAFF" : "#FFFFFF"
+ Text {
+ id: delegateText;
+ text: " " + name
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 16
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ id: delegateText2;
+ text: "> "
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 20
+ smooth: true
+ color: "gray"
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignRight
+ }
+
+ MouseArea {
+ id: delegateMouseArea
+ anchors.fill: parent;
+ onClicked: {
+ testCaseList.state = "testRunning"
+ testLoader.source = name
+ console.log(name)
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "testRunning"
+ PropertyChanges { target: testCaseList; visible: false; hideTranslation: -main.width }
+ },
+ State {
+ name: "testStopped"
+ PropertyChanges { target: testCaseList; visible: true; hideTranslation: 0 }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "testRunning"
+ SequentialAnimation {
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ PropertyAction { target: testCaseList; property: "visible"; value: false }
+ }
+ },
+ Transition {
+ to: "testStopped"
+ SequentialAnimation {
+ PropertyAction { target: testCaseList; property: "visible"; value: true }
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ }
+ }
+
+ ]
+ }
+
+ Rectangle {
+ visible: true
+ anchors.bottom: main.bottom
+ anchors.left: main.left
+ anchors.right: main.right
+ height: 40
+ color: "#cc000000"
+ Item {
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ Image {
+ source: "back.svg"
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent;
+ onClicked: {
+ if (testCaseList.visible){
+ Qt.quit()
+ } else if (!testCaseList.state != "testStopped") {
+ testCaseList.state = "testStopped"
+ testLoader.source = ""
+ }
+ }
+ }
+ }
+}
+
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
new file mode 100644
index 00000000..5bc7b585
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..b49fe0e8
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0xdf1f version 0x10008
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#ifdef QMLJSDEBUGGER
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#ifdef QMLOBSERVER
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(Orientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != Auto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case LockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case LockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case Auto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::show()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ QDeclarativeView::show();
+#endif
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..8ba35e9d
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x39ee version 0x10008
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+public:
+ enum Orientation {
+ LockPortrait,
+ LockLandscape,
+ Auto
+ };
+
+ QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(Orientation orientation);
+ void show();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..524d7c3f
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,148 @@
+# checksum 0x5b42 version 0x70012
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
+}
+
+contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
+ DEFINES += HARMATTAN_BOOSTER
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+ isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ target ~= s,\\\\\\.?\\\\,\\,
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ desktopfile.files = $${TARGET}_harmattan.desktop
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ targetFullPath ~= s,/\\.?/,/,
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ installPrefix = /opt/$${TARGET}
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ target.path = $${installPrefix}/bin
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 00000000..98101fb6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,29 @@
+QT += declarative opengl
+
+# Add more folders to ship with the application, here
+folder_01.source = qml/qmlshadersplugintest
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve Qml modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE40472A7
+
+# Define QMLJSDEBUGGER to enable basic debugging (setting breakpoints etc)
+# Define QMLOBSERVER for advanced features (requires experimental QmlInspector plugin!)
+#DEFINES += QMLJSDEBUGGER
+#DEFINES += QMLOBSERVER
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()