From decda424d551e5d8593a4d73bee1298520f9991b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 7 Jan 2021 20:34:55 +0100 Subject: 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 (cherry picked from commit e3cca3df718d8ff298d2d73ce4d6139a3ba620f9) Reviewed-by: Qt Cherry-pick Bot --- .../data/rotation/rotation_clip_multi.qml | 38 ++++++++++++++++++++++ .../data/rotation/rotation_clip_scissor.qml | 30 +++++++++++++++++ .../data/rotation/rotation_clip_stencil.qml | 31 ++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_multi.qml create mode 100644 tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_scissor.qml create mode 100644 tests/manual/scenegraph_lancelot/data/rotation/rotation_clip_stencil.qml (limited to 'tests/manual/scenegraph_lancelot/data') 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 } + } + } +} -- cgit v1.2.3