diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2010-02-18 10:58:03 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2010-02-18 12:48:56 (GMT) |
commit | 37d4bde65a28a10efdd9c09b88007acd7339629a (patch) | |
tree | c6b502994ab7c754a591f667d8212d33a72c8ebc /tests/benchmarks | |
parent | 5cd93666050076053d547d1b3ba4041b8fae58ec (diff) | |
download | Qt-37d4bde65a28a10efdd9c09b88007acd7339629a.zip Qt-37d4bde65a28a10efdd9c09b88007acd7339629a.tar.gz Qt-37d4bde65a28a10efdd9c09b88007acd7339629a.tar.bz2 |
Reduced the memory footprint of qttrace files.
A couple of improvements have been made:
* Use single precision floats for the traces.
* Reduce the number of variant wrapped transforms by introducing a new
translate command.
* Reduce the number of bytes streamed per image / pixmap draw command.
* Add versioning info to qttrace files to be more future proof.
Reviewed-by: Gunnar Sletta
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp index c3afffa..86daca0 100644 --- a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp +++ b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp @@ -185,7 +185,13 @@ ReplayWidget::ReplayWidget(const QString &filename_) char *data; uint size; in.readBytes(data, size); - bool isTraceFile = size == 7 && qstrncmp(data, "qttrace", 7) == 0; + bool isTraceFile = size >= 7 && qstrncmp(data, "qttrace", 7) == 0; + uint version = 0; + if (size == 9 && qstrncmp(data, "qttraceV2", 9) == 0) { + in.setFloatingPointPrecision(QDataStream::SinglePrecision); + in >> version; + } + delete [] data; if (!isTraceFile) { printf("File '%s' is not a trace file\n", qPrintable(filename_)); @@ -193,7 +199,7 @@ ReplayWidget::ReplayWidget(const QString &filename_) } in >> buffer >> updates; - printf("Read paint buffer with %d frames\n", buffer.numFrames()); + printf("Read paint buffer version %d with %d frames\n", version, buffer.numFrames()); resize(buffer.boundingRect().size().toSize()); |