aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-01-07 20:34:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-12 19:48:23 +0000
commitdecda424d551e5d8593a4d73bee1298520f9991b (patch)
tree8b545e6882ada3737b20f241ebfafa1d033c0584
parent83647e8f9e9629c71691cdec6c02fc889f128d06 (diff)
Add Lancelot tests for both types of clipping
Scissor-based clipping is exercised by existing tests, the stencil-based one however is likely not. Add a simple test case for both. Task-number: QTBUG-89898 Change-Id: I6cba2e30542fba074ee052782170e150ae2f074a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit e3cca3df718d8ff298d2d73ce4d6139a3ba620f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_multi.qml38
-rw-r--r--tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_scissor.qml30
-rw-r--r--tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_stencil.qml31
3 files changed, 99 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_multi.qml b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_multi.qml
new file mode 100644
index 0000000000..277ac4f2db
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_multi.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 320
+ height: 480
+ property int standardWidth: 60
+ property int standardHeight: 60
+ property int standardSpacing: 20
+ property bool smoothing: true
+ Rectangle {
+ width: 150
+ height: 150
+ anchors.centerIn: parent
+ color: "black"
+ clip: true
+ rotation: 45
+ Rectangle {
+ width: 200
+ height: 200
+ anchors.centerIn: parent
+ color: "lightGray"
+ clip: true
+ Grid {
+ anchors.centerIn: parent
+ columns: 4
+ spacing: standardSpacing
+ Rectangle{ color: "red"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardHeight/2 ; axis{x: 0; y: 0; z:1} angle: 5; } smooth: smoothing}
+ Rectangle{ color: "orange"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 10; } smooth: smoothing }
+ Rectangle{ color: "yellow"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing }
+ Rectangle{ color: "blue"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 20; } smooth: smoothing }
+ Rectangle{ color: "green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardWidth/2 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing}
+ Rectangle{ color: "indigo"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 30; } smooth: smoothing}
+ Rectangle{ color: "violet"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 35; } smooth: smoothing }
+ Rectangle{ color: "light green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 40; } smooth: smoothing }
+ }
+ }
+ }
+}
diff --git a/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_scissor.qml b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_scissor.qml
new file mode 100644
index 0000000000..71379ff1bb
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_scissor.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 320
+ height: 480
+ property int standardWidth: 60
+ property int standardHeight: 60
+ property int standardSpacing: 20
+ property bool smoothing: true
+ Rectangle {
+ width: 200
+ height: 200
+ anchors.centerIn: parent
+ color: "lightGray"
+ clip: true
+ Grid {
+ anchors.centerIn: parent
+ columns: 4
+ spacing: standardSpacing
+ Rectangle{ color: "red"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardHeight/2 ; axis{x: 0; y: 0; z:1} angle: 5; } smooth: smoothing}
+ Rectangle{ color: "orange"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 10; } smooth: smoothing }
+ Rectangle{ color: "yellow"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing }
+ Rectangle{ color: "blue"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 20; } smooth: smoothing }
+ Rectangle{ color: "green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardWidth/2 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing}
+ Rectangle{ color: "indigo"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 30; } smooth: smoothing}
+ Rectangle{ color: "violet"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 35; } smooth: smoothing }
+ Rectangle{ color: "light green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 40; } smooth: smoothing }
+ }
+ }
+}
diff --git a/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_stencil.qml b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_stencil.qml
new file mode 100644
index 0000000000..f6167e70e0
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_stencil.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 320
+ height: 480
+ property int standardWidth: 60
+ property int standardHeight: 60
+ property int standardSpacing: 20
+ property bool smoothing: true
+ Rectangle {
+ width: 200
+ height: 200
+ anchors.centerIn: parent
+ color: "lightGray"
+ rotation: 45
+ clip: true
+ Grid {
+ anchors.centerIn: parent
+ columns: 4
+ spacing: standardSpacing
+ Rectangle{ color: "red"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardHeight/2 ; axis{x: 0; y: 0; z:1} angle: 5; } smooth: smoothing}
+ Rectangle{ color: "orange"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 10; } smooth: smoothing }
+ Rectangle{ color: "yellow"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing }
+ Rectangle{ color: "blue"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 20; } smooth: smoothing }
+ Rectangle{ color: "green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: standardWidth/2; origin.y: standardWidth/2 ; axis{x: 0; y: 0; z:1} angle: 15; } smooth: smoothing}
+ Rectangle{ color: "indigo"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 30; } smooth: smoothing}
+ Rectangle{ color: "violet"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 35; } smooth: smoothing }
+ Rectangle{ color: "light green"; width: standardWidth; height: standardHeight; transform: Rotation { origin.x: 0; origin.y: 0 ; axis{x: 0; y: 0; z:1} angle: 40; } smooth: smoothing }
+ }
+ }
+}