diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-25 19:07:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-25 19:07:32 (GMT) |
commit | ab96a3edd9a7f84dc055a9818ab60bc961a8b6c8 (patch) | |
tree | ae47bc6bfc1c31b677d42cdc2aa5bfce0e2b944b /tools | |
parent | 41422ea0072d0af5fb378c3754b697ec0534a27f (diff) | |
parent | 8ef52111099e1a588d872305d07f0f9e514fe2e3 (diff) | |
download | Qt-ab96a3edd9a7f84dc055a9818ab60bc961a8b6c8.zip Qt-ab96a3edd9a7f84dc055a9818ab60bc961a8b6c8.tar.gz Qt-ab96a3edd9a7f84dc055a9818ab60bc961a8b6c8.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: (29 commits)
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.
Optimize QGraphicsItem::setFlags.
...
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; |