Changeset 651 for trunk/tools/qttracereplay
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/tools/qttracereplay/main.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 53 53 54 54 void paintEvent(QPaintEvent *event); 55 void resizeEvent(QResizeEvent *event); 55 56 56 57 public slots: … … 65 66 QTime timer; 66 67 68 QList<uint> visibleUpdates; 67 69 QList<uint> iterationTimes; 68 70 QString filename; … … 71 73 void ReplayWidget::updateRect() 72 74 { 73 if (! updates.isEmpty())74 update(updates.at( currentFrame));75 if (!visibleUpdates.isEmpty()) 76 update(updates.at(visibleUpdates.at(currentFrame))); 75 77 } 76 78 … … 81 83 // p.setClipRegion(frames.at(currentFrame).updateRegion); 82 84 83 buffer.draw(&p, currentFrame);85 buffer.draw(&p, visibleUpdates.at(currentFrame)); 84 86 85 87 ++currentFrame; 86 if (currentFrame >= buffer.numFrames()) {88 if (currentFrame >= visibleUpdates.size()) { 87 89 currentFrame = 0; 88 90 ++currentIteration; … … 120 122 if (iterationTimes.size() >= 10 || stddev < 4) { 121 123 printf("%s, iterations: %d, frames: %d, min(ms): %d, median(ms): %d, stddev: %f %%, max(fps): %f\n", qPrintable(filename), 122 iterationTimes.size(), updates.size(), min, median, stddev, 1000. * updates.size() / min);124 iterationTimes.size(), visibleUpdates.size(), min, median, stddev, 1000. * visibleUpdates.size() / min); 123 125 deleteLater(); 124 126 return; … … 131 133 } 132 134 135 void ReplayWidget::resizeEvent(QResizeEvent *event) 136 { 137 visibleUpdates.clear(); 138 139 QRect bounds = rect(); 140 for (int i = 0; i < updates.size(); ++i) { 141 if (updates.at(i).intersects(bounds)) 142 visibleUpdates << i; 143 } 144 145 if (visibleUpdates.size() != updates.size()) 146 printf("Warning: skipped %d frames due to limited resolution\n", updates.size() - visibleUpdates.size()); 147 148 } 149 133 150 ReplayWidget::ReplayWidget(const QString &filename_) 134 151 : currentFrame(0) … … 139 156 QFile file(filename); 140 157 141 QRect bounds;142 158 if (!file.open(QIODevice::ReadOnly)) { 143 159 printf("Failed to load input file '%s'\n", qPrintable(filename_));
Note:
See TracChangeset
for help on using the changeset viewer.