aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/manual/gputhroughput/drawcalls.qml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/manual/gputhroughput/drawcalls.qml')
-rw-r--r--benchmarks/manual/gputhroughput/drawcalls.qml34
1 files changed, 34 insertions, 0 deletions
diff --git a/benchmarks/manual/gputhroughput/drawcalls.qml b/benchmarks/manual/gputhroughput/drawcalls.qml
new file mode 100644
index 0000000..7d9a14b
--- /dev/null
+++ b/benchmarks/manual/gputhroughput/drawcalls.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+
+Item {
+ id: root;
+
+ property real cellSize: Math.floor(Math.sqrt(width * height / (count / 2)))
+ property int count: 250
+ property int staticCount: 0
+
+ Grid {
+ width: root.width
+ height: root.height
+ columns: Math.ceil(root.width / root.cellSize);
+ rows: Math.ceil(root.height / root.cellSize);
+ Repeater {
+ model: root.count / 2
+ Rectangle {
+ opacity: 0.9
+ width: root.cellSize
+ height: root.cellSize
+ color: Qt.hsla(index / count, 0.5, 0.5);
+ Image {
+ // partially overlap the next cells to provoke separate draw calls.
+ x: parent.width / 2
+ y: parent.height / 2
+ width: x + 2
+ height: y + 2
+ sourceSize: Qt.size(width, height);
+ source: "../../../shared/butterfly-wide.png"
+ }
+ }
+ }
+ }
+}