diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-26 10:35:18 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-26 10:35:18 (GMT) |
commit | a69cb9bb828ed0c8e1a5caca62eb5d2960952d17 (patch) | |
tree | b2550ae42e852fc24ff8a4a5dfdc0e91c7572c76 /tools | |
parent | 56ca72ca00f030390e1c164f5c60a2016479bc72 (diff) | |
parent | 0a3ce6fa04ed2b085fe72b89d302a3a5f9e82948 (diff) | |
download | Qt-a69cb9bb828ed0c8e1a5caca62eb5d2960952d17.zip Qt-a69cb9bb828ed0c8e1a5caca62eb5d2960952d17.tar.gz Qt-a69cb9bb828ed0c8e1a5caca62eb5d2960952d17.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (30 commits)
Fixed an infinite loop that could occur when reading invalid BMP images.
Updated docs regarding QGLWidget::renderText() limitations.
Added optimization flag to QGraphicsItemPrivate.
Fixed child items with graphics effects not inheriting opacity.
Made the trace replayer handle limited resolution cases better.
Small optimization in raster paint engine.
Another ASSERT while deleting spans
Implement QDirectFBPixmapData::scroll
Potential crash when adding items from QGraphicsWidget::polishEvent().
QGraphicsWidget is painted twice on the inital show.
Fix QPainter::redirection() to pass autotest.
Re-added the Close button in QPrintPreviewDialog for Mac/Carbon.
revert parts of 10392eef4fd4f9
Fix y-inverted pixmaps properly.
Fix rendering with simple shader in GL2 engine
removed a debug trace
Fix documentation bug in QColor
Don't use a mutex lock in QPainter::redirection unless strictly required
Only send QGraphicsItem::ParentChange(d) notifications from setParentItem.
Pass value as const void *const to QGraphicsSceneIndex::itemChange.
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qttracereplay/main.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp index 85e9b12..a932d72 100644 --- a/tools/qttracereplay/main.cpp +++ b/tools/qttracereplay/main.cpp @@ -52,6 +52,7 @@ public: ReplayWidget(const QString &filename); void paintEvent(QPaintEvent *event); + void resizeEvent(QResizeEvent *event); public slots: void updateRect(); @@ -64,14 +65,15 @@ public: int currentIteration; QTime timer; + QList<uint> visibleUpdates; QList<uint> iterationTimes; QString filename; }; void ReplayWidget::updateRect() { - if (!updates.isEmpty()) - update(updates.at(currentFrame)); + if (!visibleUpdates.isEmpty()) + update(updates.at(visibleUpdates.at(currentFrame))); } void ReplayWidget::paintEvent(QPaintEvent *) @@ -80,10 +82,10 @@ void ReplayWidget::paintEvent(QPaintEvent *) // p.setClipRegion(frames.at(currentFrame).updateRegion); - buffer.draw(&p, currentFrame); + buffer.draw(&p, visibleUpdates.at(currentFrame)); ++currentFrame; - if (currentFrame >= buffer.numFrames()) { + if (currentFrame >= visibleUpdates.size()) { currentFrame = 0; ++currentIteration; @@ -119,7 +121,7 @@ void ReplayWidget::paintEvent(QPaintEvent *) if (iterationTimes.size() >= 10 || stddev < 4) { printf("%s, iterations: %d, frames: %d, min(ms): %d, median(ms): %d, stddev: %f %%, max(fps): %f\n", qPrintable(filename), - iterationTimes.size(), updates.size(), min, median, stddev, 1000. * updates.size() / min); + iterationTimes.size(), visibleUpdates.size(), min, median, stddev, 1000. * visibleUpdates.size() / min); deleteLater(); return; } @@ -130,6 +132,21 @@ void ReplayWidget::paintEvent(QPaintEvent *) QTimer::singleShot(0, this, SLOT(updateRect())); } +void ReplayWidget::resizeEvent(QResizeEvent *event) +{ + visibleUpdates.clear(); + + QRect bounds = rect(); + for (int i = 0; i < updates.size(); ++i) { + if (updates.at(i).intersects(bounds)) + visibleUpdates << i; + } + + if (visibleUpdates.size() != updates.size()) + printf("Warning: skipped %d frames due to limited resolution\n", updates.size() - visibleUpdates.size()); + +} + ReplayWidget::ReplayWidget(const QString &filename_) : currentFrame(0) , currentIteration(0) @@ -138,7 +155,6 @@ ReplayWidget::ReplayWidget(const QString &filename_) setWindowTitle(filename); QFile file(filename); - QRect bounds; if (!file.open(QIODevice::ReadOnly)) { printf("Failed to load input file '%s'\n", qPrintable(filename_)); return; |