aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuho Lääkkö <[email protected]>2024-08-13 09:47:22 +0300
committerJuho Lääkkö <[email protected]>2024-08-19 10:23:15 +0000
commit5cf6dc79bb9f246f910739f8d5596a7567f66668 (patch)
treecd817ae631df9b9a21a86119641962f04a8850de
parent0a46a640e317395abdc89d3910bdabf7b8017762 (diff)
Move WeirdShape component definition in shapespawner benchmarkHEADdev
Qmlbench handles all .qml ending files as benchmark. That causes unnecessary failure when WeirdShape component was defined in own qml file. Change-Id: I87d95e903b29714dfdc6acb5ce3aa909086d7493 Reviewed-by: Jonas Karlsson <[email protected]>
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml79
-rw-r--r--src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml30
3 files changed, 29 insertions, 81 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 093daa7..1ed122e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -203,7 +203,6 @@ set(qmlbench_resource_files
"benchmarks/auto/quick3d/principledmaterial/maps/metallic/metallic.jpg"
"benchmarks/auto/quick3d/principledmaterial/maps/metallic/normal.jpg"
"benchmarks/auto/quick3d/principledmaterial/maps/metallic/roughness.jpg"
- "benchmarks/auto/quick3d/shapespawner/WeirdShape.qml"
"benchmarks/auto/quick3d/shapespawner/shapespawner.qml"
"benchmarks/auto/quick3d/shapespawner/weirdShape.mesh"
"shared/butterfly-collapsed.png"
diff --git a/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml b/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml
deleted file mode 100644
index 9bd820b..0000000
--- a/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick3D
-
-Node {
- id: weirdShape
-
- property real xRotation: Math.random() * (360 - (-360)) + -360
- property real yRotation: Math.random() * (360 - (-360)) + -360
- property real zRotation: Math.random() * (360 - (-360)) + -360
-
- property real hue: Math.random()
-
- Model {
- source: "weirdShape.mesh"
- scale: Qt.vector3d(150, 150, 150)
- eulerRotation.x: 90
-
- SequentialAnimation on eulerRotation {
- loops: Animation.Infinite
- PropertyAnimation {
- duration: Math.random() * (10000 - 1000) + 1000
- to: Qt.vector3d(xRotation - 360, yRotation - 360, zRotation - 360)
- from: Qt.vector3d(xRotation, yRotation, zRotation)
- }
- }
-
- materials: [ DefaultMaterial { diffuseColor: Qt.hsva(hue, 1.0, 1.0, 1.0) } ]
- }
-}
diff --git a/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml b/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml
index c3a9e05..d1a79f3 100644
--- a/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml
+++ b/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml
@@ -65,6 +65,34 @@ CreationBenchmark {
eulerRotation.y: -70
}
+ Component {
+ id: weirdShape
+ Node {
+ property real xRotation: Math.random() * (360 - (-360)) + -360
+ property real yRotation: Math.random() * (360 - (-360)) + -360
+ property real zRotation: Math.random() * (360 - (-360)) + -360
+
+ property real hue: Math.random()
+
+ Model {
+ source: "weirdShape.mesh"
+ scale: Qt.vector3d(150, 150, 150)
+ eulerRotation.x: 90
+
+ SequentialAnimation on eulerRotation {
+ loops: Animation.Infinite
+ PropertyAnimation {
+ duration: Math.random() * (10000 - 1000) + 1000
+ to: Qt.vector3d(xRotation - 360, yRotation - 360, zRotation - 360)
+ from: Qt.vector3d(xRotation, yRotation, zRotation)
+ }
+ }
+
+ materials: [ DefaultMaterial { diffuseColor: Qt.hsva(hue, 1.0, 1.0, 1.0) } ]
+ }
+ }
+ }
+
Node {
id: shapeSpawner
property real range: 300
@@ -77,7 +105,7 @@ CreationBenchmark {
var xPos = (2 * Math.random() * range) - range;
var yPos = (2 * Math.random() * range) - range;
var zPos = (2 * Math.random() * range) - range;
- var shapeComponent = Qt.createComponent("WeirdShape.qml");
+ var shapeComponent = weirdShape
let instance = shapeComponent.createObject(shapeSpawner,
{ "x": xPos, "y": yPos, "z": zPos, "scale": Qt.vector3d(0.05, 0.05, 0.05)});
instances.push(instance);