From 418c1cf3ad9e3a39df21220805f0691a399dd041 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 3 Aug 2009 16:10:12 +1000 Subject: Add another benchmark --- .../qmlcomponent/samegame/BoomBlock.qml | 54 +++++++++++++++++++++ .../qmlcomponent/samegame/pics/blueStar.png | Bin 0 -> 278 bytes .../qmlcomponent/samegame/pics/blueStone.png | Bin 0 -> 2691 bytes .../qmlcomponent/samegame/pics/greenStar.png | Bin 0 -> 273 bytes .../qmlcomponent/samegame/pics/greenStone.png | Bin 0 -> 2662 bytes .../qmlcomponent/samegame/pics/redStar.png | Bin 0 -> 274 bytes .../qmlcomponent/samegame/pics/redStone.png | Bin 0 -> 2604 bytes .../qmlcomponent/samegame/pics/yellowStone.png | Bin 0 -> 2667 bytes .../declarative/qmlcomponent/tst_qmlcomponent.cpp | 1 + 9 files changed, 55 insertions(+) create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStar.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStone.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStar.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStone.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStar.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStone.png create mode 100644 tests/benchmarks/declarative/qmlcomponent/samegame/pics/yellowStone.png diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml new file mode 100644 index 0000000..8a505da --- /dev/null +++ b/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml @@ -0,0 +1,54 @@ +import Qt 4.6 + +Item { id:block + property bool dying: false + property bool spawned: false + property int type: 0 + property int targetX: 0 + property int targetY: 0 + + x: Follow { enabled: spawned; source: targetX; spring: 2; damping: 0.2 } + y: Follow { source: targetY; spring: 2; damping: 0.2 } + + Image { id: img + source: { + if(type == 0){ + "pics/redStone.png"; + } else if(type == 1) { + "pics/blueStone.png"; + } else { + "pics/greenStone.png"; + } + } + opacity: 0 + opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + anchors.fill: parent + } + + Particles { id: particles + width:1; height:1; anchors.centerIn: parent; opacity: 0 + lifeSpan: 700; lifeSpanDeviation: 600; count:0; streamIn: false + angle: 0; angleDeviation: 360; velocity: 100; velocityDeviation:30 + source: { + if(type == 0){ + "pics/redStar.png"; + } else if (type == 1) { + "pics/blueStar.png"; + } else { + "pics/greenStar.png"; + } + } + } + + states: [ + State{ name: "AliveState"; when: spawned == true && dying == false + SetProperties { target: img; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + SetProperties { target: particles; count: 50 } + SetProperties { target: particles; opacity: 1 } + SetProperties { target: particles; emitting: false } // i.e. emit only once + SetProperties { target: img; opacity: 0 } + } + ] +} diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStar.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStar.png new file mode 100644 index 0000000..ff9588f Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStar.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStone.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStone.png new file mode 100644 index 0000000..bf342e0 Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/blueStone.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStar.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStar.png new file mode 100644 index 0000000..cd06854 Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStar.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStone.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStone.png new file mode 100644 index 0000000..5ac14a5 Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/greenStone.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStar.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStar.png new file mode 100644 index 0000000..0a4dffe Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStar.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStone.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStone.png new file mode 100644 index 0000000..b099f60 Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/redStone.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/pics/yellowStone.png b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/yellowStone.png new file mode 100644 index 0000000..c56124a Binary files /dev/null and b/tests/benchmarks/declarative/qmlcomponent/samegame/pics/yellowStone.png differ diff --git a/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp b/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp index 1920bf2..f032004 100644 --- a/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp +++ b/tests/benchmarks/declarative/qmlcomponent/tst_qmlcomponent.cpp @@ -60,6 +60,7 @@ void tst_qmlcomponent::creation_data() QTest::newRow("MyQmlObject: basic binding") << "myqmlobject_binding.txt"; QTest::newRow("Synthesized properties") << "synthesized_properties.txt"; QTest::newRow("Synthesized properties.2") << "synthesized_properties.2.txt"; + QTest::newRow("SameGame - BoomBlock") << "samegame/BoomBlock.qml"; } void tst_qmlcomponent::creation() -- cgit v0.12