]> git.cworth.org Git - apitrace/blobdiff - gui/retracer.cpp
Auto detect the API from the trace.
[apitrace] / gui / retracer.cpp
index 50b35d47f52d070ad999e45ec938e3dc21ca5a90..d0e07ef9f4d54066e56042ed8df7ae16fd036427 100644 (file)
@@ -1,6 +1,7 @@
 #include "retracer.h"
 
 #include "apitracecall.h"
+#include "thumbnail.h"
 
 #include "image.hpp"
 
@@ -233,7 +234,7 @@ void Retracer::run()
     } else if (m_api == trace::API_EGL) {
         prog = QLatin1String("eglretrace");
     } else {
-        Q_ASSERT(0);
+        emit finished(QLatin1String("Unsupported API"));
         return;
     }
 
@@ -339,8 +340,8 @@ void Retracer::run()
                     Q_ASSERT(readBytes == rowBytes);
                 }
 
-                QImage thumbnail = snapshot.scaled(16, 16, Qt::KeepAspectRatio, Qt::FastTransformation);
-                thumbnails.append(thumbnail);
+                QImage thumb = thumbnail(snapshot);
+                thumbnails.append(thumb);
             }
 
             Q_ASSERT(process.state() != QProcess::Running);