aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-15 11:36:52 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-17 13:37:24 +0000
commit2401162f340bb50b58de701eede0b55c43753185 (patch)
tree5e83bd383db26403231875bf1225ff850c1fbc54 /tests/manual
parent843f72bd317f195ee31921acf8132074a7c50d4a (diff)
D3D12: Text enablers
Enablers for native text rendering. Distance field support is postponed for the time being. The main feature here is the revised texture handling where it is now possible to schedule the update of multiple sub-regions from a list of QImages. BGRA is now used where appropriate, meaning for example that RGB32 needs no QImage conversion anymore. The skeletons of the glyph nodes, the basic text material and the glyph cache are added as well. Also fixes cleanup when closing the window by properly reimplementing invalidate() in the rendercontext. The default rectangle, image and glyph nodes are refactored a bit once again: QSGBasicSomethingNode is now the common (albeit optional), abstract class, living in its own file, whereas QSGDefaultSomethingNode is the GL-specific one, like before. This prepares the future renaming for QSGDefault -> QSGOpenGL. Change-Id: I6dbb4ece10be39fd214bb64082d79607389e3e6e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/nodetypes/Images.qml22
-rw-r--r--tests/manual/nodetypes/Text.qml48
-rw-r--r--tests/manual/nodetypes/main.qml3
-rw-r--r--tests/manual/nodetypes/nodetypes.cpp1
-rw-r--r--tests/manual/nodetypes/nodetypes.pro2
-rw-r--r--tests/manual/nodetypes/nodetypes.qrc1
6 files changed, 75 insertions, 2 deletions
diff --git a/tests/manual/nodetypes/Images.qml b/tests/manual/nodetypes/Images.qml
index f37ed1217b..7c1ba5345b 100644
--- a/tests/manual/nodetypes/Images.qml
+++ b/tests/manual/nodetypes/Images.qml
@@ -57,11 +57,30 @@ Item {
// changing the mipmap property results in the creation of a brand new
// texture resource. enable the following to test.
// Timer {
-// interval: 5000
+// interval: 2000
// onTriggered: im.mipmap = false
// running: true
// }
+ SequentialAnimation on scale {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 1.0
+ to: 4.0
+ duration: 2000
+ }
+ NumberAnimation {
+ from: 4.0
+ to: 0.1
+ duration: 3000
+ }
+ NumberAnimation {
+ from: 0.1
+ to: 1.0
+ duration: 1000
+ }
+ }
+
Image {
anchors.centerIn: parent
source: "qrc:/face-smile.png"
@@ -73,5 +92,6 @@ Item {
anchors.bottom: parent.bottom
anchors.right: parent.right
antialiasing: true
+ NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; }
}
}
diff --git a/tests/manual/nodetypes/Text.qml b/tests/manual/nodetypes/Text.qml
new file mode 100644
index 0000000000..4edfc854bc
--- /dev/null
+++ b/tests/manual/nodetypes/Text.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ Text {
+ anchors.centerIn: parent
+ text: "árvíztűrő tükörfúrógép\nÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP"
+ }
+}
diff --git a/tests/manual/nodetypes/main.qml b/tests/manual/nodetypes/main.qml
index 94f154afdd..234b27c144 100644
--- a/tests/manual/nodetypes/main.qml
+++ b/tests/manual/nodetypes/main.qml
@@ -59,5 +59,8 @@ Item {
if (event.key === Qt.Key_I)
loader.source = "qrc:/Images.qml";
+
+ if (event.key === Qt.Key_T)
+ loader.source = "qrc:/Text.qml";
}
}
diff --git a/tests/manual/nodetypes/nodetypes.cpp b/tests/manual/nodetypes/nodetypes.cpp
index 6e4b6db2a2..80753de766 100644
--- a/tests/manual/nodetypes/nodetypes.cpp
+++ b/tests/manual/nodetypes/nodetypes.cpp
@@ -51,6 +51,7 @@ int main(int argc, char **argv)
qDebug(" [R] - Rectangles");
qDebug(" [4] - A lot of rectangles (perf)");
qDebug(" [I] - Images");
+ qDebug(" [T] - Text");
qDebug("\nPress S to stop the currently running test\n");
QQuickView view;
diff --git a/tests/manual/nodetypes/nodetypes.pro b/tests/manual/nodetypes/nodetypes.pro
index ae5a60e1bd..3efcc7b713 100644
--- a/tests/manual/nodetypes/nodetypes.pro
+++ b/tests/manual/nodetypes/nodetypes.pro
@@ -4,4 +4,4 @@ SOURCES += nodetypes.cpp
RESOURCES += nodetypes.qrc
-OTHER_FILES += main.qml Rects.qml LotsOfRects.qml Images.qml
+OTHER_FILES += main.qml Rects.qml LotsOfRects.qml Images.qml Text.qml
diff --git a/tests/manual/nodetypes/nodetypes.qrc b/tests/manual/nodetypes/nodetypes.qrc
index 924a262eb9..a4f78851fe 100644
--- a/tests/manual/nodetypes/nodetypes.qrc
+++ b/tests/manual/nodetypes/nodetypes.qrc
@@ -4,6 +4,7 @@
<file>Rects.qml</file>
<file>LotsOfRects.qml</file>
<file>Images.qml</file>
+ <file>Text.qml</file>
<file>qt.png</file>
<file>face-smile.png</file>
</qresource>