[PATCH 0/2] Capture and display frame thumbnails in qapitrace. (Pass 2)
Dan McCabe
zen3d.linux at gmail.com
Mon Mar 5 17:20:38 PST 2012
This patch set automatically captures and displays thumbnails for each
frame in qapitrace.
qapitrace spawns glretrace in a separate process to replay traces and
capture relevent information about those traces. In the first patch, a
sequence of snapshots is generated and captured thumbnails. In the second
patch, those thumbnails are associated with the approproate ApiTraceFrame.
When the ApiTraceEvent is processed for each frame, the thumbnail is
displayed at the front of the frame's information.
Deltas from the previous iteration of the patch set:
1) Replaced readAllStandardOutput with QProcess::setReadChannel() and
QProcess::read() while capturing snapshot stream. This eliminates the
out-of-memory exceptions I was encountering in my previous patch set.
2) Testing for going past end of QList in bindThumbnailsToFrames. This
should eliminate asset failures that Jose encountered (but which I never
saw).
3) Moved thumbnail scaling from the paint method to capture in retracer.
4) Used camel case.
5) I think I changed the code to deal with memory leaks of QList<QImage>
per my understanding of Zack's suggestion, but I don't know Qt memory
management well enough to be certain I did it right.
6) Eliminated abbreviations of words (snaps => snapshots, thumbs =>
thumbnails).
7) Changed ApiTrace::changed() to accept ApiTraceEvent* per Zack's
suggestion.
8) Changed dynamic data notification per my understanding of Zack's
suggestion. Thumbnails now appear automatically after glretrace completes.
Open issue: I use knowledge of the header of a PMN image inside the snapshot
stream capture code to read the right number of header lines. Actual parsing
is still done locally in the PMN module. This is NOT a good example of
information hiding. A better way of doing this is to create a separate
qimage_PNM reader header and source (i.e., creating a module that knows
about QIODevice and the structure of PMN images). Perhaps I will add this
later. However, the code as written does work correctly. It's just not the
best example of good software engineering practices.
Future feature: Enable glretrace to run headless.
Future feature: Only run glretrace on those frames visible in the current
window of qapitrace, reducing glretrace overhead.
Future feature: Display thumbnail when hovering over line of frame.
More information about the apitrace
mailing list