summaryrefslogtreecommitdiffstats
path: root/tools/qttracereplay
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-02-18 10:58:03 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2010-02-18 12:48:56 (GMT)
commit37d4bde65a28a10efdd9c09b88007acd7339629a (patch)
treec6b502994ab7c754a591f667d8212d33a72c8ebc /tools/qttracereplay
parent5cd93666050076053d547d1b3ba4041b8fae58ec (diff)
downloadQt-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 'tools/qttracereplay')
-rw-r--r--tools/qttracereplay/main.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp
index 82373f7..be7906b 100644
--- a/tools/qttracereplay/main.cpp
+++ b/tools/qttracereplay/main.cpp
@@ -183,15 +183,21 @@ ReplayWidget::ReplayWidget(const QString &filename_, int from_, int to_, bool si
char *data;
uint size;
in.readBytes(data, size);
- bool isTraceFile = size == 7 && qstrncmp(data, "qttrace", 7) == 0;
- delete [] data;
+ 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;
+ }
+
if (!isTraceFile) {
printf("File '%s' is not a trace file\n", qPrintable(filename_));
return;
}
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());